aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2003-01-18 21:20:10 +0000
committerStefan Monnier2003-01-18 21:20:10 +0000
commit5a9ac14b684ae85e54ed236cad679eaae7eb26a5 (patch)
treebca79f826e4e323678b868bf286b4852d3331039
parent017708e9dd7509011f5df38409c489240a773eea (diff)
downloademacs-5a9ac14b684ae85e54ed236cad679eaae7eb26a5.tar.gz
emacs-5a9ac14b684ae85e54ed236cad679eaae7eb26a5.zip
(add-change-log-entry): Don't leave space at eol.
(add-log-current-defun): Perl functions names can't have (or {.
-rw-r--r--lisp/add-log.el56
1 files changed, 27 insertions, 29 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 711bc64c193..86902d88432 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -545,36 +545,34 @@ non-nil, otherwise in local time."
545 ;; Now insert the function name, if we have one. 545 ;; Now insert the function name, if we have one.
546 ;; Point is at the item for this file, 546 ;; Point is at the item for this file,
547 ;; either at the end of the line or at the first blank line. 547 ;; either at the end of the line or at the first blank line.
548 (if defun 548 (if (not defun)
549 (progn 549 ;; No function name, so put in a colon unless we have just a star.
550 ;; Make it easy to get rid of the function name. 550 (unless (save-excursion
551 (undo-boundary) 551 (beginning-of-line 1)
552 (unless (save-excursion 552 (looking-at "\\s *\\(\\*\\s *\\)?$"))
553 (beginning-of-line 1) 553 (insert ": ")
554 (looking-at "\\s *$")) 554 (if version (insert version ?\ )))
555 (insert ?\ )) 555 ;; Make it easy to get rid of the function name.
556 ;; See if the prev function name has a message yet or not. 556 (undo-boundary)
557 ;; If not, merge the two items.
558 (let ((pos (point-marker)))
559 (if (and (skip-syntax-backward " ")
560 (skip-chars-backward "):")
561 (looking-at "):")
562 (progn (delete-region (+ 1 (point)) (+ 2 (point))) t)
563 (> fill-column (+ (current-column) (length defun) 3)))
564 (progn (delete-region (point) pos)
565 (insert ", "))
566 (goto-char pos)
567 (insert "("))
568 (set-marker pos nil))
569 (insert defun "): ")
570 (if version
571 (insert version ?\ )))
572 ;; No function name, so put in a colon unless we have just a star.
573 (unless (save-excursion 557 (unless (save-excursion
574 (beginning-of-line 1) 558 (beginning-of-line 1)
575 (looking-at "\\s *\\(\\*\\s *\\)?$")) 559 (looking-at "\\s *$"))
576 (insert ": ") 560 (insert ?\ ))
577 (if version (insert version ?\ )))))) 561 ;; See if the prev function name has a message yet or not.
562 ;; If not, merge the two items.
563 (let ((pos (point-marker)))
564 (skip-syntax-backward " ")
565 (skip-chars-backward "):")
566 (if (and (looking-at "):")
567 (> fill-column (+ (current-column) (length defun) 4)))
568 (progn (delete-region (point) pos) (insert ", "))
569 (if (looking-at "):")
570 (delete-region (+ 1 (point)) (line-end-position)))
571 (goto-char pos)
572 (insert "("))
573 (set-marker pos nil))
574 (insert defun "): ")
575 (if version (insert version ?\ )))))
578 576
579;;;###autoload 577;;;###autoload
580(defun add-change-log-entry-other-window (&optional whoami file-name) 578(defun add-change-log-entry-other-window (&optional whoami file-name)
@@ -829,7 +827,7 @@ Has a preference of looking backwards."
829 (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t) 827 (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t)
830 (match-string-no-properties 1))) 828 (match-string-no-properties 1)))
831 ((memq major-mode '(perl-mode cperl-mode)) 829 ((memq major-mode '(perl-mode cperl-mode))
832 (if (re-search-backward "^sub[ \t]+\\([^ \t\n]+\\)" nil t) 830 (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
833 (match-string-no-properties 1))) 831 (match-string-no-properties 1)))
834 ;; Emacs's autoconf-mode installs its own 832 ;; Emacs's autoconf-mode installs its own
835 ;; `add-log-current-defun-function'. This applies to 833 ;; `add-log-current-defun-function'. This applies to