소스 검색

Add flyspell-prog-mode support to toggle

Josh Bicking 7 년 전
부모
커밋
a3ddd3c510
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      emacs

+ 11 - 1
emacs

@@ -415,7 +415,17 @@ scroll-step 1)
  "u" 'undo-tree-visualize
  "m" 'recentf-open-files
  "l" 'auto-fill-mode
- "s" '(lambda () (interactive) (if flyspell-mode (funcall 'flyspell-mode '0) (flyspell-mode) (flyspell-buffer)))
+ "s" '(lambda ()
+	(interactive)
+	(if (string= (buffer-local-value 'major-mode (current-buffer)) "text-mode")
+	    (if flyspell-mode
+		(funcall 'flyspell-mode '0)
+	      (flyspell-mode)
+	      (flyspell-buffer))
+	  (if flyspell-mode
+	      (funcall 'flyspell-mode '0)
+	    (flyspell-prog-mode)
+	    (flyspell-buffer))))
  ;"a" 'auto-complete-mode
  "a" 'company-mode
  "g" 'magit-status