summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-10-15 13:09:44 -0700
committerFranck Cuny <franck@fcuny.net>2022-10-15 13:09:44 -0700
commitafc8d13a0fb2f3b94e6885355df1a11320b8b1cc (patch)
treec0157c2c82bb5b87a40bb8980abed2c341300130
parentref(rust): delete the module (diff)
downloademacs.d-afc8d13a0fb2f3b94e6885355df1a11320b8b1cc.tar.gz
ref(text): group settings and require the modules
Require the modules that are needed at the top of the file and organize
the code in sections: settings, bindings and hooks.

Change-Id: Iced9ac0e6801b91cf9b9055176873ae73f7205bf
-rw-r--r--emacs/custom/my-text.el34
1 files changed, 19 insertions, 15 deletions
diff --git a/emacs/custom/my-text.el b/emacs/custom/my-text.el
index 91a7f54..f6d984f 100644
--- a/emacs/custom/my-text.el
+++ b/emacs/custom/my-text.el
@@ -5,16 +5,13 @@
 ;;; Code:
 
 (require 'markdown-mode)
+(require 'ispell)
+(require 'abbrev)
 
-(customize-set-variable 'ispell-program-name (executable-find "aspell"))
-(customize-set-variable 'ispell-dictionary "en_US")
-(customize-set-variable 'ispell-extra-args '("--camel-case"))
-
-(add-hook 'text-mode-hook 'flyspell-mode)
-(add-hook 'text-mode-hook 'goto-address-mode)
-
-(dolist (hook '(prog-mode-hook conf-mode-hook))
-  (add-hook hook 'flyspell-prog-mode))
+;;; settings
+(setq ispell-program-name (executable-find "aspell"))
+(setq ispell-dictionary "en_US")
+(setq ispell-extra-args '("--camel-case"))
 
 (add-to-list 'auto-mode-alist
              '("\\.\\(md\\|markdown\\)$" . markdown-mode) auto-mode-alist)
@@ -22,15 +19,22 @@
 ;; use GitHub's markdown flavor for README files
 (add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode))
 
-(customize-set-variable 'markdown-fontify-code-block-natively t)
 (when (executable-find "pandoc")
-  (customize-set-variable 'markdown-command "pandoc -f markdown -t html"))
+  (setq markdown-command "pandoc -f markdown -t html"))
 
 (setq only-global-abbrevs nil)
-(eval-after-load 'abbrev
-  (let ((table text-mode-abbrev-table))
-    (define-abbrev table "github" "GitHub")
-    (define-abbrev table "emacs" "Emacs")))
+(let ((table text-mode-abbrev-table))
+  (define-abbrev table "github" "GitHub")
+  (define-abbrev table "emacs" "Emacs"))
+
+;;; bindings
+
+;;; hooks
+(add-hook 'text-mode-hook 'flyspell-mode)
+(add-hook 'text-mode-hook 'goto-address-mode)
+
+(dolist (hook '(prog-mode-hook conf-mode-hook))
+  (add-hook hook 'flyspell-prog-mode))
 
 (dolist (hook '(text-mode-hook git-commit-mode-hook))
   (add-hook hook 'abbrev-mode))