From unknown Sun Aug 10 00:43:44 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7284 <7284@debbugs.gnu.org> To: bug#7284 <7284@debbugs.gnu.org> Subject: Status: [PATCH] `find-change-log' fails in *derived* Diff modes Reply-To: bug#7284 <7284@debbugs.gnu.org> Date: Sun, 10 Aug 2025 07:43:44 +0000 retitle 7284 [PATCH] `find-change-log' fails in *derived* Diff modes reassign 7284 emacs submitter 7284 "Aaron S. Hawley" severity 7284 normal tag 7284 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 26 15:44:30 2010 Received: (at submit) by debbugs.gnu.org; 26 Oct 2010 19:44:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PApRd-0004kz-P4 for submit@debbugs.gnu.org; Tue, 26 Oct 2010 15:44:30 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PApRc-0004ku-0i for submit@debbugs.gnu.org; Tue, 26 Oct 2010 15:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PApVW-00045p-UZ for submit@debbugs.gnu.org; Tue, 26 Oct 2010 15:48:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:53801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PApVR-00041X-KF for submit@debbugs.gnu.org; Tue, 26 Oct 2010 15:48:30 -0400 Received: from [140.186.70.92] (port=33225 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PApUr-0000zE-Qt for bug-gnu-emacs@gnu.org; Tue, 26 Oct 2010 15:48:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PApUo-0003mZ-L1 for bug-gnu-emacs@gnu.org; Tue, 26 Oct 2010 15:47:47 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:35939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PApUo-0003m1-Fi for bug-gnu-emacs@gnu.org; Tue, 26 Oct 2010 15:47:46 -0400 Received: by fxm2 with SMTP id 2so4761301fxm.0 for ; Tue, 26 Oct 2010 12:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=gjdZ7lygvRE2YrbqIubYd+xUCC4N6dCOYsBvo7eZGCk=; b=TTTzK7Gwx84nMoVUTa4e1H/T6tLcwBIvb+pqSdzFBw/QTkoCMjuZmcO2BzdnwRz1/c YxJelVeCtBEmpOjlRPy1AB7VtYay/4AnPO/3GVoafWLF7rSle1i519PhdU+vfRyeiUE+ MkHnf8y4ttPljB05CiwYNzcdpEho5ZBnWXyeg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=P+/q1O6Nn2vaWegLH+ezMWH21cVBDICHMTZefENFuBnGyuQHDbFs1LYGrnIOOpA39k LF3VY2zJlDiDOwknB16vOrx5biKtahBHdG/PVyxlaQBqPI/KMzLPwiH+pPWTV9q8rA8O HyAVhmjJ/FWeeYTnU3/6vCiVfE9d9sHgofC7E= MIME-Version: 1.0 Received: by 10.223.93.136 with SMTP id v8mr1293634fam.56.1288122464044; Tue, 26 Oct 2010 12:47:44 -0700 (PDT) Received: by 10.223.108.77 with HTTP; Tue, 26 Oct 2010 12:47:43 -0700 (PDT) Date: Tue, 26 Oct 2010 15:47:43 -0400 Message-ID: Subject: [PATCH] `find-change-log' fails in *derived* Diff modes From: "Aaron S. Hawley" To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary=20cf3054a2e3e587b604938a61ac X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.2 (-----) --20cf3054a2e3e587b604938a61ac Content-Type: text/plain; charset=ISO-8859-1 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 --20cf3054a2e3e587b604938a61ac Content-Type: application/octet-stream; name="add-log_derived-diff-mode.patch" Content-Disposition: attachment; filename="add-log_derived-diff-mode.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 LS0tIGxpc3AvdmMvYWRkLWxvZy5lbAkyMDEwLTA5LTIxIDE0OjExOjI4LjIxNjYzMDEwMCAtMDQw MAorKysgbGlzcC92Yy9hZGQtbG9nLmVsCTIwMTAtMTAtMjUgMTY6NDY6NDkuODA4Mjk3ODAwIC0w NDAwCkBAIC03MDEsNyArNzAxLDcgQEAKIE9wdGlvbmFsIGFyZyBCVUZGRVItRklMRSBvdmVycmlk ZXMgYGJ1ZmZlci1maWxlLW5hbWUnLiIKICAgOzsgSWYgd2UgYXJlIGNhbGxlZCBmcm9tIGEgZGlm ZiwgZmlyc3Qgc3dpdGNoIHRvIHRoZSBzb3VyY2UgYnVmZmVyOwogICA7OyBpbiBvcmRlciB0byBy ZXNwZWN0IGJ1ZmZlci1sb2NhbCBzZXR0aW5ncyBvZiBjaGFuZ2UtbG9nLWRlZmF1bHQtbmFtZSwg ZXRjLgotICAod2l0aC1jdXJyZW50LWJ1ZmZlciAobGV0ICgoYnVmZiAoaWYgKGVxIG1ham9yLW1v ZGUgJ2RpZmYtbW9kZSkKKyAgKHdpdGgtY3VycmVudC1idWZmZXIgKGxldCAoKGJ1ZmYgKGlmIChk ZXJpdmVkLW1vZGUtcCAnZGlmZi1tb2RlKQogCQkJCSAgICAgICAoY2FyIChpZ25vcmUtZXJyb3Jz CiAJCQkJCSAgICAgKGRpZmYtZmluZC1zb3VyY2UtbG9jYXRpb24pKSkpKSkKIAkJCSAoaWYgKGJ1 ZmZlci1saXZlLXAgYnVmZikgYnVmZgo= --20cf3054a2e3e587b604938a61ac-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 26 17:31:15 2010 Received: (at 7284) by debbugs.gnu.org; 26 Oct 2010 21:31:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PAr6x-0005U7-AB for submit@debbugs.gnu.org; Tue, 26 Oct 2010 17:31:15 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PAr6v-0005U2-Jb for 7284@debbugs.gnu.org; Tue, 26 Oct 2010 17:31:14 -0400 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o9QLZHBk005632; Tue, 26 Oct 2010 17:35:17 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id C69F4B4681; Tue, 26 Oct 2010 17:35:16 -0400 (EDT) From: Stefan Monnier To: "Aaron S. Hawley" Subject: Re: bug#7284: [PATCH] `find-change-log' fails in *derived* Diff modes Message-ID: References: Date: Tue, 26 Oct 2010 17:35:16 -0400 In-Reply-To: (Aaron S. Hawley's message of "Tue, 26 Oct 2010 15:47:43 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3660=0 X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 7284 Cc: 7284@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > - (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 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 17:40:25 2010 Received: (at 7284-done) by debbugs.gnu.org; 27 Oct 2010 21:40:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PBDjN-0000EN-2c for submit@debbugs.gnu.org; Wed, 27 Oct 2010 17:40:25 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PBDdo-0000Bo-Bi for 7284-done@debbugs.gnu.org; Wed, 27 Oct 2010 17:34:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgQJAJc4yExFxL/T/2dsb2JhbACgRnxywH2FSASSKg X-IronPort-AV: E=Sophos;i="4.58,248,1286164800"; d="scan'208";a="80862088" Received: from 69-196-191-211.dsl.teksavvy.com (HELO pastel.home) ([69.196.191.211]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 27 Oct 2010 17:38:47 -0400 Received: by pastel.home (Postfix, from userid 20848) id E89B6A8557; Wed, 27 Oct 2010 17:38:46 -0400 (EDT) From: Stefan Monnier To: "Aaron S. Hawley" Subject: Re: bug#7284: [PATCH] `find-change-log' fails in *derived* Diff modes Message-ID: References: Date: Wed, 27 Oct 2010 17:38:46 -0400 In-Reply-To: (Aaron S. Hawley's message of "Tue, 26 Oct 2010 15:47:43 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 7284-done X-Mailman-Approved-At: Wed, 27 Oct 2010 17:40:24 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > - (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 From unknown Sun Aug 10 00:43:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 25 Nov 2010 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator