From: Glenn Morris Date: Wed, 8 May 2013 06:56:37 +0000 (-0700) Subject: m4-mode misc small cleanup X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~253 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9ecf672a9f26dd471731566d6304034a7e0c354b;p=emacs.git m4-mode misc small cleanup * lisp/progmodes/m4-mode.el (m4-program): Assume it is in PATH. (m4-mode-syntax-table): Init in the defvar. (m4-mode-abbrev-table): Let define-derived-mode define it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f1aa40ccc9a..45f74725c15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-05-08 Glenn Morris + + * progmodes/m4-mode.el (m4-program): Assume it is in PATH. + (m4-mode-syntax-table): Init in the defvar. + (m4-mode-abbrev-table): Let define-derived-mode define it. + 2013-05-08 Tom Tromey * progmodes/m4-mode.el (m4-mode-syntax-table): diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el index ffd79b354d5..5d6921911d2 100644 --- a/lisp/progmodes/m4-mode.el +++ b/lisp/progmodes/m4-mode.el @@ -45,15 +45,10 @@ :prefix "m4-" :group 'languages) -(defcustom m4-program - (cond - ((file-exists-p "/usr/local/bin/m4") "/usr/local/bin/m4") - ((file-exists-p "/usr/bin/m4") "/usr/bin/m4") - ((file-exists-p "/bin/m4") "/bin/m4") - ((file-exists-p "/usr/ccs/bin/m4") "/usr/ccs/bin/m4") - ( t "m4") - ) - "File name of the m4 executable." +(defcustom m4-program "m4" + "File name of the m4 executable. +If m4 is not in your PATH, set this to an absolute file name." + :version "24.4" :type 'file :group 'm4) @@ -85,19 +80,20 @@ :group 'm4) ;;this may still need some work -(defvar m4-mode-syntax-table nil +(defvar m4-mode-syntax-table + (let ((table (make-syntax-table))) + (modify-syntax-entry ?` "('" table) + (modify-syntax-entry ?' ")`" table) + (modify-syntax-entry ?# "<\n" table) + (modify-syntax-entry ?\n ">#" table) + (modify-syntax-entry ?{ "_" table) + (modify-syntax-entry ?} "_" table) + (modify-syntax-entry ?* "w" table) + (modify-syntax-entry ?_ "_" table) + (modify-syntax-entry ?\" "w" table) + (modify-syntax-entry ?\" "w" table) + table) "Syntax table used while in `m4-mode'.") -(setq m4-mode-syntax-table (make-syntax-table)) -(modify-syntax-entry ?` "('" m4-mode-syntax-table) -(modify-syntax-entry ?' ")`" m4-mode-syntax-table) -(modify-syntax-entry ?# "<\n" m4-mode-syntax-table) -(modify-syntax-entry ?\n ">#" m4-mode-syntax-table) -(modify-syntax-entry ?{ "_" m4-mode-syntax-table) -(modify-syntax-entry ?} "_" m4-mode-syntax-table) -(modify-syntax-entry ?* "w" m4-mode-syntax-table) -(modify-syntax-entry ?_ "_" m4-mode-syntax-table) -(modify-syntax-entry ?\" "w" m4-mode-syntax-table) -(modify-syntax-entry ?\" "w" m4-mode-syntax-table) (defvar m4-mode-map (let ((map (make-sparse-keymap)) @@ -117,12 +113,6 @@ :help "Send contents of the current region to m4")) map)) -(defvar m4-mode-abbrev-table nil - "Abbrev table used while in `m4-mode'.") - -(unless m4-mode-abbrev-table - (define-abbrev-table 'm4-mode-abbrev-table ())) - (defun m4-m4-buffer () "Send contents of the current buffer to m4." (interactive) @@ -151,7 +141,6 @@ ;;;###autoload (define-derived-mode m4-mode prog-mode "m4" "A major mode to edit m4 macro files." - :abbrev-table m4-mode-abbrev-table (setq-local comment-start "#") (setq-local parse-sexp-ignore-comments t) (setq-local add-log-current-defun-function #'m4-current-defun-name)