]> code.delx.au - gnu-emacs/blobdiff - lisp/add-log.el
(byte-compile-fix-header): Fix the way of checking the existence of
[gnu-emacs] / lisp / add-log.el
index a89cbd49f6d5667ab29086daa14df1a9ef55cf2f..8f34c8f1f1e3cd232991b36810f2f7eeeadf93d6 100644 (file)
@@ -173,11 +173,12 @@ Note: The search is conducted only within 10%, at the beginning of the file."
     ;; Conditionals.
     ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 font-lock-variable-name-face))
     ;;
+    ;; Function of change.
+    ("<\\([^>\n]+\\)>\\(:\\| (\\)" (1 font-lock-variable-name-face))
+    ;;
     ;; Acknowledgements.
-    ("^\t\\(From\\|Patch\\(es\\)? by\\|Report\\(ed by\\| from\\)\\|Suggest\\(ed by\\|ion from\\)\\)"
-     1 font-lock-comment-face)
-    ("  \\(From\\|Patch\\(es\\)? by\\|Report\\(ed by\\| from\\)\\|Suggest\\(ed by\\|ion from\\)\\)"
-     1 font-lock-comment-face))
+    ("\\(^\t\\|  \\)\\(From\\|Patch\\(es\\)? by\\|Report\\(ed by\\| from\\)\\|Suggest\\(ed by\\|ion from\\)\\)"
+     2 font-lock-comment-face))
   "Additional expressions to highlight in Change Log mode.")
 
 (defvar change-log-mode-map (make-sparse-keymap)
@@ -449,7 +450,20 @@ non-nil, otherwise in local time."
                    (beginning-of-line 1)
                    (looking-at "\\s *$"))
            (insert ?\ ))
-         (insert "(" defun "): ")
+         ;; See if the prev function name has a message yet or not
+         ;; If not, merge the two entries.
+         (let ((pos (point-marker)))
+           (if (and (skip-syntax-backward " ")
+                    (skip-chars-backward "):")
+                    (looking-at "):")
+                    (progn (delete-region (+ 1 (point)) (+ 2 (point))) t)
+                    (> fill-column (+ (current-column) (length defun) 3)))
+               (progn (delete-region (point) pos)
+                      (insert ", "))
+             (goto-char pos)
+             (insert "("))
+           (set-marker pos nil))
+         (insert defun "): ")
          (if version
              (insert version ?\ )))
       ;; No function name, so put in a colon unless we have just a star.
@@ -523,7 +537,7 @@ Prefix arg means justify as well."
     t))
 \f
 (defcustom add-log-current-defun-header-regexp
-  "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[-_a-zA-Z]+\\)[ \t]*[:=]"
+  "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]"
   "*Heuristic regexp used by `add-log-current-defun' for unknown major modes."
   :type 'regexp
   :group 'change-log)