unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Roland McGrath <roland@frob.com>
To: bug-gnu-emacs@gnu.org
Subject: add-change-add-log-entry regression, with fix
Date: Thu,  5 Jul 2007 12:17:44 -0700 (PDT)	[thread overview]
Message-ID: <20070705191744.9D6104D0435@magilla.localdomain> (raw)

Before version 22, a function on change-log-mode-hook could set
add-log-mailing-address or add-log-full-name as a buffer-local variable in
the change-log-mode buffer and have this affect what
add-change-add-log-entry inserted in the buffer.  In 22, this is broken.

This patch restores the behavior that hooks have been able to rely on since 18.


Thanks,
Roland


--- add-log.el.orig	2007-07-05 12:15:24.000000000 -0700
+++ add-log.el	2007-07-05 12:15:05.000000000 -0700
@@ -509,19 +509,19 @@ non-nil, otherwise in local time."
 	 (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)))
+	 bound full-name mailing-address)
 
     (if whoami
 	(progn
-	  (setq full-name (read-string "Full name: " full-name))
+	  (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: " mailing-address))))
+		(read-string "Mailing address: "
+			     (or add-log-mailing-address user-mail-address)))))
 
     (unless (equal file-name buffer-file-name)
       (if (or other-window (window-dedicated-p (selected-window)))
@@ -532,6 +532,11 @@ non-nil, otherwise in local time."
     (undo-boundary)
     (goto-char (point-min))
 
+    (or full-name
+	(setq full-name (or add-log-full-name (user-full-name))))
+    (or mailing-address
+	 (setq 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")

             reply	other threads:[~2007-07-05 19:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-05 19:17 Roland McGrath [this message]
     [not found] <mailman.3111.1183669091.32220.bug-gnu-emacs@gnu.org>
2007-07-20 20:24 ` add-change-add-log-entry regression, with fix Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070705191744.9D6104D0435@magilla.localdomain \
    --to=roland@frob.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).