emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/add-log.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/add-log.el,v
Date: Fri, 20 Jul 2007 20:24:00 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/07/20 20:23:59

Index: add-log.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/add-log.el,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -b -r1.187 -r1.188
--- add-log.el  20 Jul 2007 20:09:44 -0000      1.187
+++ add-log.el  20 Jul 2007 20:23:58 -0000      1.188
@@ -504,20 +504,7 @@
         (buffer-file (if buf-file-name (expand-file-name buf-file-name)))
         (file-name (expand-file-name (find-change-log file-name buffer-file)))
         ;; Set ITEM to the file name to use in the new item.
-        (item (add-log-file-name buffer-file file-name))
-        bound
-        (full-name (or add-log-full-name (user-full-name)))
-        (mailing-address (or add-log-mailing-address user-mail-address)))
-
-    (if whoami
-       (progn
-         (setq full-name (read-string "Full name: " full-name))
-         ;; Note that some sites have room and phone number fields in
-         ;; full name which look silly when inserted.  Rather than do
-         ;; anything about that here, let user give prefix argument so that
-         ;; s/he can edit the full name field in prompter if s/he wants.
-         (setq mailing-address
-               (read-string "Mailing address: " mailing-address))))
+        (item (add-log-file-name buffer-file file-name)))
 
     (unless (equal file-name buffer-file-name)
       (if (or other-window (window-dedicated-p (selected-window)))
@@ -528,6 +515,20 @@
     (undo-boundary)
     (goto-char (point-min))
 
+    (let ((full-name (or add-log-full-name (user-full-name)))
+          (mailing-address (or add-log-mailing-address user-mail-address)))
+
+      (when whoami
+        (setq full-name (read-string "Full name: "
+                                     (or add-log-full-name (user-full-name))))
+        ;; Note that some sites have room and phone number fields in
+        ;; full name which look silly when inserted.  Rather than do
+        ;; anything about that here, let user give prefix argument so that
+        ;; s/he can edit the full name field in prompter if s/he wants.
+        (setq mailing-address
+              (read-string "Mailing address: "
+                           (or add-log-mailing-address user-mail-address))))
+
     ;; If file starts with a copyright and permission notice, skip them.
     ;; Assume they end at first blank line.
     (when (looking-at "Copyright")
@@ -561,18 +562,18 @@
                     new-entries)
                (if use-hard-newlines hard-newline "\n")
                (if use-hard-newlines hard-newline "\n"))
-       (forward-line -1)))
+          (forward-line -1))))
 
     ;; Determine where we should stop searching for a usable
     ;; item to add to, within this entry.
-    (setq bound
+    (let ((bound
          (save-excursion
             (if (looking-at "\n*[^\n* \t]")
                 (skip-chars-forward "\n")
              (if add-log-keep-changes-together
                  (forward-page)        ; page delimits entries for date
                (forward-paragraph)))   ; paragraph delimits entries for file
-           (point)))
+             (point))))
 
     ;; Now insert the new line for this item.
     (cond ((re-search-forward "^\\s *\\*\\s *$" bound t)
@@ -609,7 +610,7 @@
           (forward-line -2)
           (indent-to left-margin)
           (insert "* ")
-          (if item (insert item))))
+             (if item (insert item)))))
     ;; Now insert the function name, if we have one.
     ;; Point is at the item for this file,
     ;; either at the end of the line or at the first blank line.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]