GNU bug report logs - #7284
[PATCH] `find-change-log' fails in *derived* Diff modes

Previous Next

Package: emacs;

Reported by: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>

Date: Tue, 26 Oct 2010 19:45:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7284 in the body.
You can then email your comments to 7284 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7284; Package emacs. (Tue, 26 Oct 2010 19:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 26 Oct 2010 19:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] `find-change-log' fails in *derived* Diff modes
Date: Tue, 26 Oct 2010 15:47:43 -0400
[Message part 1 (text/plain, inline)]
Running `C-x 4 a' (add-change-log-entry-other-window) in a derived mode
of Diff mode (psvn-diff-mode, magit-diff-mode, and so on) does not open
the correct ChangeLog file.  The following patch fixes the problem.

--- lisp/vc/add-log.el~	2010-09-21 14:11:28.216630100 -0400
+++ lisp/vc/add-log.el	2010-10-25 16:46:49.808297800 -0400
@@ -701,7 +701,7 @@
 Optional arg BUFFER-FILE overrides `buffer-file-name'."
   ;; If we are called from a diff, first switch to the source buffer;
   ;; in order to respect buffer-local settings of change-log-default-name, etc.
-  (with-current-buffer (let ((buff (if (eq major-mode 'diff-mode)
+  (with-current-buffer (let ((buff (if (derived-mode-p 'diff-mode)
 				       (car (ignore-errors
 					     (diff-find-source-location))))))
 			 (if (buffer-live-p buff) buff



Perhaps, more of the cases of Emacs's Lisp that have (eq major-mode ...)
should be converted to (derived-mode-p ...).  Obviously, they'll need
to be studied on a case-by-case basis since there might be cases when
only the exact major-mode is intended to be matched.

Thanks for Emacs,
/a
[add-log_derived-diff-mode.patch (application/octet-stream, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7284; Package emacs. (Tue, 26 Oct 2010 21:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 7284 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Cc: 7284 <at> debbugs.gnu.org
Subject: Re: bug#7284: [PATCH] `find-change-log' fails in *derived* Diff modes
Date: Tue, 26 Oct 2010 17:35:16 -0400
> -  (with-current-buffer (let ((buff (if (eq major-mode 'diff-mode)
> +  (with-current-buffer (let ((buff (if (derived-mode-p 'diff-mode)

Thanks.

> Perhaps, more of the cases of Emacs's Lisp that have (eq major-mode ...)
> should be converted to (derived-mode-p ...).

Indeed.

> Obviously, they'll need to be studied on a case-by-case basis since
> there might be cases when only the exact major-mode is intended to
> be matched.

These are exceedingly rare.  At least, I can't remember las time I came
across one of those.


        Stefan




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 27 Oct 2010 21:41:02 GMT) Full text and rfc822 format available.

Notification sent to "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>:
bug acknowledged by developer. (Wed, 27 Oct 2010 21:41:02 GMT) Full text and rfc822 format available.

Message #13 received at 7284-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Subject: Re: bug#7284: [PATCH] `find-change-log' fails in *derived* Diff modes
Date: Wed, 27 Oct 2010 17:38:46 -0400
> -  (with-current-buffer (let ((buff (if (eq major-mode 'diff-mode)
> +  (with-current-buffer (let ((buff (if (derived-mode-p 'diff-mode)

Installed in the emacs-23 branch, thank you,


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Nov 2010 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 211 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.