From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 18 03:50:48 2018 Received: (at submit) by debbugs.gnu.org; 18 Jul 2018 07:50:48 +0000 Received: from localhost ([127.0.0.1]:46127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ffhEW-000374-0o for submit@debbugs.gnu.org; Wed, 18 Jul 2018 03:50:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ffhET-00036o-DG for submit@debbugs.gnu.org; Wed, 18 Jul 2018 03:50:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffhEM-0007I2-Oa for submit@debbugs.gnu.org; Wed, 18 Jul 2018 03:50:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57938) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ffhEM-0007GP-Jl for submit@debbugs.gnu.org; Wed, 18 Jul 2018 03:50:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffhEL-0003oL-0T for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2018 03:50:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffhEH-00078P-PL for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2018 03:50:37 -0400 Received: from smtp-1.orcon.net.nz ([60.234.4.34]:50958) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffhEH-0006yT-3i for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2018 03:50:33 -0400 Received: from [150.107.172.125] (port=20748 helo=[192.168.20.103]) by smtp-1.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1ffhEB-0007vy-8A for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2018 19:50:27 +1200 To: bug-gnu-emacs@gnu.org From: Phil Sainty Subject: 26.1; [PATCH] Support indirect buffers in `diff-buffer-with-file' Message-ID: Date: Wed, 18 Jul 2018 19:50:26 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2E881EF4CCE1DD004A3957F4" Content-Language: en-GB X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.4 (-----) This is a multi-part message in MIME format. --------------2E881EF4CCE1DD004A3957F4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In an indirect buffer `buffer-file-name' is nil, and consequently M-x diff-buffer-with-file fails with "diff-no-select: Wrong type argument: stringp, nil" I think it would be sensible to use the base buffer's file name in this situation. Patch attached. -Phil In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2018-06-19 built on shodan Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 18.04 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Scanning for dabbrevs...done user-error: No dynamic expansion for ‘diff-bu’ found Configured using: 'configure --prefix=/home/phil/emacs/26.1/usr/local --with-x-toolkit=lucid --without-sound' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 THREADS LCMS2 Important settings: value of $LANG: en_NZ.UTF-8 locale-coding-system: utf-8 Major mode: Dired by name Minor modes in effect: show-paren-mode: t minibuffer-depth-indicate-mode: t winner-mode: t global-hl-line-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr dabbrev emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired-x easymenu paren mb-depth winner ring hl-line dired dired-loaddefs advice elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 101859 10773) (symbols 48 20824 1) (miscs 40 108 168) (strings 32 30401 971) (string-bytes 1 796958) (vectors 16 15482) (vector-slots 8 504854 6666) (floats 8 60 57) (intervals 56 279 0) (buffers 992 13)) --------------2E881EF4CCE1DD004A3957F4 Content-Type: text/x-patch; name="0001-lisp-vc-diff.el-diff-buffer-with-file-Support-indire.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-lisp-vc-diff.el-diff-buffer-with-file-Support-indire.pa"; filename*1="tch" >From d3a57c63deba7aafad821418902c47dfb4fc0ccf Mon Sep 17 00:00:00 2001 From: Phil Sainty Date: Wed, 18 Jul 2018 19:32:11 +1200 Subject: [PATCH] * lisp/vc/diff.el (diff-buffer-with-file): Support indirect buffers --- lisp/vc/diff.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index b850350..ac94586 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el @@ -226,8 +226,9 @@ diff-buffer-with-file "View the differences between BUFFER and its associated file. This requires the external program `diff' to be in your `exec-path'." (interactive "bBuffer: ") - (with-current-buffer (get-buffer (or buffer (current-buffer))) - (diff buffer-file-name (current-buffer) nil 'noasync))) + (let ((buf (get-buffer (or buffer (current-buffer))))) + (with-current-buffer (or (buffer-base-buffer buf) buf) + (diff buffer-file-name (current-buffer) nil 'noasync)))) (provide 'diff) -- 2.8.3 --------------2E881EF4CCE1DD004A3957F4-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 27 03:04:55 2018 Received: (at 32195) by debbugs.gnu.org; 27 Jul 2018 07:04:55 +0000 Received: from localhost ([127.0.0.1]:59480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fiwo3-0000b0-8W for submit@debbugs.gnu.org; Fri, 27 Jul 2018 03:04:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fiwo1-0000ao-Qx for 32195@debbugs.gnu.org; Fri, 27 Jul 2018 03:04:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fiwnr-00042V-Mr for 32195@debbugs.gnu.org; Fri, 27 Jul 2018 03:04:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fiwnr-00042R-J8; Fri, 27 Jul 2018 03:04:43 -0400 Received: from [176.228.60.248] (port=2797 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fiwnp-0008Fv-FM; Fri, 27 Jul 2018 03:04:42 -0400 Date: Fri, 27 Jul 2018 10:04:40 +0300 Message-Id: <83y3dxrwfr.fsf@gnu.org> From: Eli Zaretskii To: Phil Sainty In-reply-to: (message from Phil Sainty on Wed, 18 Jul 2018 19:50:26 +1200) Subject: Re: bug#32195: 26.1; [PATCH] Support indirect buffers in `diff-buffer-with-file' References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32195 Cc: 32195@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Phil Sainty > Date: Wed, 18 Jul 2018 19:50:26 +1200 > > In an indirect buffer `buffer-file-name' is nil, and consequently M-x > diff-buffer-with-file fails with "diff-no-select: Wrong type argument: > stringp, nil" > > I think it would be sensible to use the base buffer's file name in this > situation. > > Patch attached. Looks reasonable. Can you push (to the master branch), or do you need someone to do that for you? If the latter, please provide a commit log message. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 28 08:38:20 2018 Received: (at 32195-done) by debbugs.gnu.org; 28 Jul 2018 12:38:20 +0000 Received: from localhost ([127.0.0.1]:60790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjOUG-0000sq-4i for submit@debbugs.gnu.org; Sat, 28 Jul 2018 08:38:20 -0400 Received: from smtp-1.orcon.net.nz ([60.234.4.34]:57788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjOUE-0000sh-M5 for 32195-done@debbugs.gnu.org; Sat, 28 Jul 2018 08:38:19 -0400 Received: from [150.107.172.70] (port=44358 helo=[192.168.20.103]) by smtp-1.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1fjOUC-0004Vk-8J; Sun, 29 Jul 2018 00:38:16 +1200 Subject: Re: bug#32195: 26.1; [PATCH] Support indirect buffers in `diff-buffer-with-file' To: Eli Zaretskii References: <83y3dxrwfr.fsf@gnu.org> From: Phil Sainty Message-ID: Date: Sun, 29 Jul 2018 00:38:15 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <83y3dxrwfr.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32195-done Cc: 32195-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Pushed to master in commit 1bcf5d02da96784a04034b4c0aba8fdfa1413c4e -Phil From unknown Tue Aug 19 02:59:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 26 Aug 2018 11:24:07 +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