aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2012-08-01 00:34:28 -0700
committerGlenn Morris2012-08-01 00:34:28 -0700
commit0d26d7c4dc79554439ad96fb7d9f75aa2085e0ca (patch)
tree70d0c27da29a61d00c347064d4a64e03121b4ce4 /lisp
parentfca64dbda173bb6ef2f8dd5fb436751677657ab2 (diff)
downloademacs-0d26d7c4dc79554439ad96fb7d9f75aa2085e0ca.tar.gz
emacs-0d26d7c4dc79554439ad96fb7d9f75aa2085e0ca.zip
Small tweaks for autoconf mode
* lisp/progmodes/autoconf.el (autoconf-definition-regexp): Add AH_TEMPLATE, adjust submatch numbering. (autoconf-font-lock-keywords, autoconf-imenu-generic-expression) (autoconf-current-defun-function): Update for above change. (autoconf-current-defun-function): First skip to end of current word.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/progmodes/autoconf.el9
2 files changed, 13 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f854e4b1c07..bc0496e0ca6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12012-08-01 Glenn Morris <rgm@gnu.org>
2
3 * progmodes/autoconf.el (autoconf-definition-regexp):
4 Add AH_TEMPLATE, adjust submatch numbering.
5 (autoconf-font-lock-keywords, autoconf-imenu-generic-expression)
6 (autoconf-current-defun-function): Update for above change.
7 (autoconf-current-defun-function): First skip to end of current word.
8
12012-08-01 Rupert Swarbrick <rswarbrick@gmail.com> (tiny change) 92012-08-01 Rupert Swarbrick <rswarbrick@gmail.com> (tiny change)
2 10
3 * calendar/cal-html.el (cal-html-insert-agenda-days): 11 * calendar/cal-html.el (cal-html-insert-agenda-days):
diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el
index 3225fef2dfa..c9c6a0b9dc6 100644
--- a/lisp/progmodes/autoconf.el
+++ b/lisp/progmodes/autoconf.el
@@ -43,12 +43,12 @@
43 "Hook run by `autoconf-mode'.") 43 "Hook run by `autoconf-mode'.")
44 44
45(defconst autoconf-definition-regexp 45(defconst autoconf-definition-regexp
46 "AC_\\(SUBST\\|DEFINE\\(_UNQUOTED\\)?\\)(\\[*\\(\\sw+\\)\\]*") 46 "A\\(?:H_TEMPLATE\\|C_\\(?:SUBST\\|DEFINE\\(?:_UNQUOTED\\)?\\)\\)(\\[*\\(\\sw+\\)\\]*")
47 47
48(defvar autoconf-font-lock-keywords 48(defvar autoconf-font-lock-keywords
49 `(("\\_<A[CHMS]_\\sw+" . font-lock-keyword-face) 49 `(("\\_<A[CHMS]_\\sw+" . font-lock-keyword-face)
50 (,autoconf-definition-regexp 50 (,autoconf-definition-regexp
51 3 font-lock-function-name-face) 51 1 font-lock-function-name-face)
52 ;; Are any other M4 keywords really appropriate for configure.ac, 52 ;; Are any other M4 keywords really appropriate for configure.ac,
53 ;; given that we do `dnl'? 53 ;; given that we do `dnl'?
54 ("changequote" . font-lock-keyword-face))) 54 ("changequote" . font-lock-keyword-face)))
@@ -61,7 +61,7 @@
61 table)) 61 table))
62 62
63(defvar autoconf-imenu-generic-expression 63(defvar autoconf-imenu-generic-expression
64 (list (list nil autoconf-definition-regexp 3))) 64 (list (list nil autoconf-definition-regexp 1)))
65 65
66;; It's not clear how best to implement this. 66;; It's not clear how best to implement this.
67(defun autoconf-current-defun-function () 67(defun autoconf-current-defun-function ()
@@ -71,10 +71,11 @@ searching backwards at another AC_... command."
71 (save-excursion 71 (save-excursion
72 (with-syntax-table (copy-syntax-table autoconf-mode-syntax-table) 72 (with-syntax-table (copy-syntax-table autoconf-mode-syntax-table)
73 (modify-syntax-entry ?_ "w") 73 (modify-syntax-entry ?_ "w")
74 (skip-syntax-forward "w" (line-end-position))
74 (if (re-search-backward autoconf-definition-regexp 75 (if (re-search-backward autoconf-definition-regexp
75 (save-excursion (beginning-of-defun) (point)) 76 (save-excursion (beginning-of-defun) (point))
76 t) 77 t)
77 (match-string-no-properties 3))))) 78 (match-string-no-properties 1)))))
78 79
79;;;###autoload 80;;;###autoload
80(define-derived-mode autoconf-mode prog-mode "Autoconf" 81(define-derived-mode autoconf-mode prog-mode "Autoconf"