summaryrefslogtreecommitdiff
path: root/lisp/progmodes/autoconf.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-05-08 12:27:53 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-05-08 12:27:53 -0400
commit1d5963cc63979c4a19b5de3b9b537c1b3b61dda3 (patch)
treead1c4bba72a8c023dabbe48afd2e6692a09b2cc6 /lisp/progmodes/autoconf.el
parent86cec478835929993c71982c8da72594f0017950 (diff)
downloademacs-1d5963cc63979c4a19b5de3b9b537c1b3b61dda3.tar.gz
* lisp/progmodes/f90.el (f90-mode-syntax-table): Use symbol syntax for "_".
Change all regexps to use things like \_< and \_>. * lisp/progmodes/ada-mode.el (ada-mode-abbrev-table): Consolidate declaration. (ada-mode-syntax-table, ada-mode-symbol-syntax-table): Initialize in the declaration. (ada-create-syntax-table): Remove. (ada-capitalize-word): Don't mess with the syntax of "_" since it already has the right syntax nowadays. (ada-goto-next-word): Don't change the syntax of "_". * lisp/progmodes/autoconf.el (autoconf-definition-regexp) (autoconf-font-lock-keywords, autoconf-current-defun-function): Handle a _ with symbol syntax. (autoconf-mode): Don't change the syntax-table for imenu and font-lock. * lisp/progmodes/vera-mode.el (vera-underscore-is-part-of-word): * lisp/progmodes/prolog.el (prolog-underscore-wordchar-flag) (prolog-char-quote-workaround): * lisp/progmodes/cperl-mode.el (cperl-under-as-char): * lisp/progmodes/vhdl-mode.el (vhdl-underscore-is-part-of-word): Mark as obsolete. (vhdl-mode-syntax-table, vhdl-mode-ext-syntax-table): Initialize in their declaration. (vhdl-mode-syntax-table-init): Remove. * lisp/progmodes/ld-script.el (ld-script-mode-syntax-table): Use symbol syntax for "_". (ld-script-font-lock-keywords): Change regexps to use things like \_< and \_>. * lisp/progmodes/m4-mode.el (m4-mode-syntax-table): Add comment on last change. * lisp/font-lock.el (lisp-font-lock-keywords-2): Don't highlight obsolete with-wrapper-hook. * lisp/mh-e/mh-comp.el (mh-regexp-in-field-p): Minor simplification.
Diffstat (limited to 'lisp/progmodes/autoconf.el')
-rw-r--r--lisp/progmodes/autoconf.el19
1 files changed, 8 insertions, 11 deletions
diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el
index 8a99ad6e1b3..e6eaea985af 100644
--- a/lisp/progmodes/autoconf.el
+++ b/lisp/progmodes/autoconf.el
@@ -41,10 +41,10 @@
"Hook run by `autoconf-mode'.")
(defconst autoconf-definition-regexp
- "A\\(?:H_TEMPLATE\\|C_\\(?:SUBST\\|DEFINE\\(?:_UNQUOTED\\)?\\)\\)(\\[*\\(\\sw+\\)\\]*")
+ "A\\(?:H_TEMPLATE\\|C_\\(?:SUBST\\|DEFINE\\(?:_UNQUOTED\\)?\\)\\)(\\[*\\(\\(?:\\sw\\|\\s_\\)+\\)\\]*")
(defvar autoconf-font-lock-keywords
- `(("\\_<A[CHMS]_\\sw+" . font-lock-keyword-face)
+ `(("\\_<A[CHMS]_\\(?:\\sw\\|\\s_\\)+" . font-lock-keyword-face)
(,autoconf-definition-regexp
1 font-lock-function-name-face)
;; Are any other M4 keywords really appropriate for configure.ac,
@@ -67,13 +67,11 @@
This version looks back for an AC_DEFINE or AC_SUBST. It will stop
searching backwards at another AC_... command."
(save-excursion
- (with-syntax-table (copy-syntax-table autoconf-mode-syntax-table)
- (modify-syntax-entry ?_ "w")
- (skip-syntax-forward "w" (line-end-position))
- (if (re-search-backward autoconf-definition-regexp
- (save-excursion (beginning-of-defun) (point))
- t)
- (match-string-no-properties 1)))))
+ (skip-syntax-forward "w_" (line-end-position))
+ (if (re-search-backward autoconf-definition-regexp
+ (save-excursion (beginning-of-defun) (point))
+ t)
+ (match-string-no-properties 1))))
;;;###autoload
(define-derived-mode autoconf-mode prog-mode "Autoconf"
@@ -85,9 +83,8 @@ searching backwards at another AC_... command."
(setq-local syntax-propertize-function
(syntax-propertize-rules ("\\<dnl\\>" (0 "<"))))
(setq-local font-lock-defaults
- `(autoconf-font-lock-keywords nil nil (("_" . "w"))))
+ `(autoconf-font-lock-keywords nil nil))
(setq-local imenu-generic-expression autoconf-imenu-generic-expression)
- (setq-local imenu-syntax-alist '(("_" . "w")))
(setq-local indent-line-function #'indent-relative)
(setq-local add-log-current-defun-function
#'autoconf-current-defun-function))