]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Use `add-log-current-defun-function' for ChangeLog creation.
authorAkim Demaille <akim@epita.fr>
Mon, 8 Oct 2001 08:21:18 +0000 (08:21 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 8 Oct 2001 08:21:18 +0000 (08:21 +0000)
Suggested by Tom Tromey.
* lib/emacs/autotest-mode.el (autotest-mode-map): New.
(autotest-mode): Adjust.
* lib/emacs/autoconf-mode.el (autoconf-mode-map): Modernize, map
'comment-region onto `C-c ;'.
Comments are `#', not `dnl'.
(autoconf-current-defun): New.
(autoconf-font-lock-keywords): Recognize `m4_defun'.

ChangeLog
lib/emacs/autoconf-mode.el
lib/emacs/autotest-mode.el

index 115a25ba76ddc18df66f821a07740382e359de7f..5cf6ed2c332eb19abeff9b35550c87c68bd25ffc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-10-08  Akim Demaille  <akim@epita.fr>
+
+       Use `add-log-current-defun-function' for ChangeLog creation.
+       Suggested by Tom Tromey.
+
+       * lib/emacs/autotest-mode.el (autotest-mode-map): New.
+       (autotest-mode): Adjust.
+       * lib/emacs/autoconf-mode.el (autoconf-mode-map): Modernize, map
+       'comment-region onto `C-c ;'.
+       Comments are `#', not `dnl'.
+       (autoconf-current-defun): New.
+       (autoconf-font-lock-keywords): Recognize `m4_defun'.
+
 2001-10-08  Akim Demaille  <akim@epita.fr>
 
        * lib/autoconf/general.m4 (_m4_divert(BODY)): Move to...
index e8fa46caffbefda70c1b7b93eaa56e9d45c932e6..b50a0015f5b9025f3ee322dd3c5a60ec1f339ae3 100644 (file)
@@ -33,7 +33,7 @@
   `(("\\bdnl \\(.*\\)"  1 font-lock-comment-face t)
     ("\\$[0-9*#@]" . font-lock-variable-name-face)
     ("\\b\\(m4_\\)?\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|gnu\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)\\b" . font-lock-keyword-face)
-    ("^\\(\\(m4_\\)?define\\|A._DEFUN\\)(\\[?\\([A-Za-z0-9_]+\\)" 3 font-lock-function-name-face)
+    ("^\\(\\(m4_\\)?define\\|A._DEFUN\\|m4_defun\\)(\\[?\\([A-Za-z0-9_]+\\)" 3 font-lock-function-name-face)
     "default font-lock-keywords")
 )
 
 
 (defvar autoconf-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map "\C-c\C-c" 'comment-region)
+    (define-key map '[(control c) (\;)] 'comment-region)
     map))
 
+(defun autoconf-current-defun ()
+  "Autoconf value for `add-log-current-defun-function'.
+This tells add-log.el how to find the current macro."
+  (save-excursion
+    (if (re-search-backward "^\\(m4_define\\|m4_defun\\|A._DEFUN\\)(\\[*\\([A-Za-z0-9_]+\\)" nil t)
+       (buffer-substring (match-beginning 2)
+                         (match-end 2))
+      nil)))
+
 ;;;###autoload
 (defun autoconf-mode ()
-  "A major-mode to edit autoconf input files like configure.in
+  "A major-mode to edit Autoconf files like configure.ac.
 \\{autoconf-mode-map}
 "
   (interactive)
   (kill-all-local-variables)
   (use-local-map autoconf-mode-map)
 
+  (make-local-variable 'add-log-current-defun-function)
+  (setq add-log-current-defun-function 'autoconf-current-defun)
+
   (make-local-variable 'comment-start)
-  (setq comment-start "dnl")
+  (setq comment-start "")
   (make-local-variable 'parse-sexp-ignore-comments)
   (setq parse-sexp-ignore-comments t)
 
index 44dce2c602d056c4f61c59ba6a15e99bab2a3ac9..05568c4e4db183cd5059407329975b0b4cbc8422 100644 (file)
     (define-key map '[(control c) (\;)] 'comment-region)
     map))
 
+(defun autotest-current-defun ()
+  "Autotest value for `add-log-current-defun-function'.
+This tells add-log.el how to find the current test group/macro."
+  (save-excursion
+    (if (re-search-backward "^\\(m4_define\\|m4_defun\\|AT_SETUP\\)(\\[+\\([^]]+\\)" nil t)
+       (buffer-substring (match-beginning 2)
+                         (match-end 2))
+      nil)))
+
 ;;;###autoload
 (defun autotest-mode ()
-  "A major-mode to edit Autotest input files like testsuite.at
+  "A major-mode to edit Autotest files like testsuite.at.
 \\{autotest-mode-map}
 "
   (interactive)
   (kill-all-local-variables)
   (use-local-map autotest-mode-map)
 
+  (make-local-variable 'add-log-current-defun-function)
+  (setq add-log-current-defun-function 'autotest-current-defun)
+
   (make-local-variable 'comment-start)
   (setq comment-start "# ")
   (make-local-variable 'parse-sexp-ignore-comments)