branch: elpa/cdlatex commit 64eb3570b55a40e15729b5cad5cad78593e56701 Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Use define-minor-mode to define cdlatex-mode --- cdlatex.el | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/cdlatex.el b/cdlatex.el index f76c03c393..4f4d38387a 100644 --- a/cdlatex.el +++ b/cdlatex.el @@ -634,7 +634,7 @@ automatic help when idle for more than this amount of time." (cdlatex-mode t)) ;;;###autoload -(defun cdlatex-mode (&optional arg) +(define-minor-mode cdlatex-mode "Minor mode for editing scientific LaTeX documents. Here is a list of features: \\<cdlatex-mode-map> @@ -688,29 +688,10 @@ displaying the available characters and their meanings. Under X, many functions will be available also in a menu on the menu bar. - - (interactive "P") - (setq cdlatex-mode (not (or (and (null arg) cdlatex-mode) - (<= (prefix-numeric-value arg) 0)))) - - ; Add or remove the menu, and run the hook - (if cdlatex-mode - (progn - (easy-menu-add cdlatex-mode-menu) - (run-hooks 'cdlatex-mode-hook) - (cdlatex-compute-tables)) - (easy-menu-remove cdlatex-mode-menu))) - -(or (assoc 'cdlatex-mode minor-mode-alist) - (setq minor-mode-alist - (cons '(cdlatex-mode " CDL") minor-mode-alist))) - -(or (assoc 'cdlatex-mode minor-mode-map-alist) - (setq minor-mode-map-alist - (cons (cons 'cdlatex-mode cdlatex-mode-map) - minor-mode-map-alist))) - Entering `cdlatex-mode' calls the hook cdlatex-mode-hook." + :lighter " CDL" + (when cdlatex-mode + (cdlatex-compute-tables))) ;;; =========================================================================== ;;;