diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/config-utilities.el | 5 | ||||
| -rw-r--r-- | modules/flycheck-config.el | 19 | ||||
| -rw-r--r-- | modules/flyspell-config.el | 64 |
3 files changed, 42 insertions, 46 deletions
diff --git a/modules/config-utilities.el b/modules/config-utilities.el index c6942015..3aaa006d 100644 --- a/modules/config-utilities.el +++ b/modules/config-utilities.el @@ -107,11 +107,6 @@ Will recompile natively if supported, or byte-compiled if not." (locate-library (symbol-name x)))))) (goto-char (point-min)))) -;; ------------------------------ Font Lock Studio ----------------------------- -;; debugger for font lock keywords - -(use-package font-lock-studio - :demand t) (provide 'config-utilities) ;;; config-utilities.el ends here diff --git a/modules/flycheck-config.el b/modules/flycheck-config.el index f0ca71fe..37b8e657 100644 --- a/modules/flycheck-config.el +++ b/modules/flycheck-config.el @@ -10,25 +10,26 @@ (interactive) (if (not (abbrev-mode)) (abbrev-mode)) - (flyspell-on-for-buffer-type) + ;; (flyspell-on-for-buffer-type) (if (not (flycheck-mode)) (flycheck-mode))) -;;;; ---------------------------------- Linting -------------------------------- +;; ---------------------------------- Linting ---------------------------------- + +(defun cj/flycheck-list-errors () + "Display flycheck's error list and switch to its buffer." + (interactive) + (flycheck-list-errors) + (switch-to-buffer-other-window "*Flycheck errors*")) (use-package flycheck :defer .5 :hook (sh-mode emacs-lisp-mode) - :preface - (defun cj/flycheck-list-errors () - "Display flycheck's error list and switch to its buffer." - (interactive) - (flycheck-list-errors) - (switch-to-buffer-other-window "*Flycheck errors*")) :bind ("C-; ?" . cj/flycheck-list-errors) :config ;; don't warn about double-spaces after period. - (setq-default checkdoc-arguments '("sentence-end-double-space" nil "warn-escape" nil)) + (setq-default checkdoc-arguments '("sentence-end-double-space" nil + "warn-escape" nil)) ;; proselint must be installed via the OS (flycheck-define-checker proselint diff --git a/modules/flyspell-config.el b/modules/flyspell-config.el index 1e3f0535..0adafc6b 100644 --- a/modules/flyspell-config.el +++ b/modules/flyspell-config.el @@ -88,42 +88,42 @@ ;; ------------------------------ Flyspell Toggle ------------------------------ ;; easy toggling flyspell and also leverage the 'for-buffer-type' functionality. -(defun flyspell-toggle () - "Turn Flyspell on if it is off, or off if it is on. -When turning on,it uses `flyspell-on-for-buffer-type' so code-vs-text is -handled appropriately." - (interactive) - (if (symbol-value flyspell-mode) - (progn ; flyspell is on, turn it off - (message "Flyspell off") - (flyspell-mode -1)) - ;; else - flyspell is off, turn it on - (progn - (flyspell-on-for-buffer-type) - (message "Flyspell on")))) -(define-key global-map (kbd "C-c f") 'flyspell-toggle ) +;; (defun flyspell-toggle () +;; "Turn Flyspell on if it is off, or off if it is on. +;; When turning on,it uses `flyspell-on-for-buffer-type' so code-vs-text is +;; handled appropriately." +;; (interactive) +;; (if (symbol-value flyspell-mode) +;; (progn ; flyspell is on, turn it off +;; (message "Flyspell off") +;; (flyspell-mode -1)) +;; ;; else - flyspell is off, turn it on +;; (progn +;; (flyspell-on-for-buffer-type) +;; (message "Flyspell on")))) +;; (define-key global-map (kbd "C-c f") 'flyspell-toggle ) ;; ------------------------ Flyspell On For Buffer Type ------------------------ ;; check strings and comments in prog mode; check everything in text mode -(defun flyspell-on-for-buffer-type () - "Enable Flyspell for the major mode and check the current buffer. -If flyspell is already enabled, do nothing. If the mode is derived from -`prog-mode', enable `flyspell-prog-mode' so only strings and comments get -checked. If the buffer is text based `flyspell-mode' is enabled to check -all text." - (interactive) - (unless flyspell-mode ; if not already on - (cond - ((derived-mode-p 'prog-mode) - (flyspell-prog-mode) - (flyspell-buffer) - ((derived-mode-p 'text-mode) - (flyspell-mode 1) - (flyspell-buffer)))))) - -(add-hook 'after-change-major-mode-hook 'flyspell-on-for-buffer-type) -(add-hook 'find-file-hook 'flyspell-on-for-buffer-type) +;; (defun flyspell-on-for-buffer-type () +;; "Enable Flyspell for the major mode and check the current buffer. +;; If flyspell is already enabled, do nothing. If the mode is derived from +;; `prog-mode', enable `flyspell-prog-mode' so only strings and comments get +;; checked. If the buffer is text based `flyspell-mode' is enabled to check +;; all text." +;; (interactive) +;; (unless flyspell-mode ; if not already on +;; (cond +;; ((derived-mode-p 'prog-mode) +;; (flyspell-prog-mode) +;; (flyspell-buffer) +;; ((derived-mode-p 'text-mode) +;; (flyspell-mode 1) +;; (flyspell-buffer)))))) + +;; (add-hook 'after-change-major-mode-hook 'flyspell-on-for-buffer-type) +;; (add-hook 'find-file-hook 'flyspell-on-for-buffer-type) ;; ---------------------------- Flyspell Then Abbrev --------------------------- ;; Spell check the buffer and create abbrevs to avoid future misspellings. |
