From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#25951: 26.0.50; Error when ediffing files that are visited using quoted file names Date: Sat, 22 Apr 2017 19:43:09 +0000 Message-ID: References: <877f2dqst0.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1143d6b80df2a6054dc69614 X-Trace: blaine.gmane.org 1492890260 24005 195.159.176.226 (22 Apr 2017 19:44:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Apr 2017 19:44:20 +0000 (UTC) Cc: 25951@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 22 21:44:16 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d20x5-00067x-Dh for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Apr 2017 21:44:15 +0200 Original-Received: from localhost ([::1]:36675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d20x8-000529-9u for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Apr 2017 15:44:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d20x1-00050W-J4 for bug-gnu-emacs@gnu.org; Sat, 22 Apr 2017 15:44:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d20ws-0000p3-9J for bug-gnu-emacs@gnu.org; Sat, 22 Apr 2017 15:44:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d20ws-0000ov-5O for bug-gnu-emacs@gnu.org; Sat, 22 Apr 2017 15:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d20wr-00013f-Nq for bug-gnu-emacs@gnu.org; Sat, 22 Apr 2017 15:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Apr 2017 19:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25951 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25951-submit@debbugs.gnu.org id=B25951.14928902074018 (code B ref 25951); Sat, 22 Apr 2017 19:44:01 +0000 Original-Received: (at 25951) by debbugs.gnu.org; 22 Apr 2017 19:43:27 +0000 Original-Received: from localhost ([127.0.0.1]:34735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d20wJ-00012k-2q for submit@debbugs.gnu.org; Sat, 22 Apr 2017 15:43:27 -0400 Original-Received: from mail-wm0-f52.google.com ([74.125.82.52]:36076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d20wH-00012U-Fa for 25951@debbugs.gnu.org; Sat, 22 Apr 2017 15:43:26 -0400 Original-Received: by mail-wm0-f52.google.com with SMTP id o81so36590761wmb.1 for <25951@debbugs.gnu.org>; Sat, 22 Apr 2017 12:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tSNwOUfGeTXq6tf7rzHsmmRkt0g8BbSwW5AAGiC9XDo=; b=jEsDW0edm7HIUxolkYaz3iJglkEt2Hk5iz1g/V1v5OC/qUoXfRXcF+JJ6t/ELap8Cg hfFQW8mKnJVYOBSqF4icXdOleJSsmZmEyn5maFi3Kj8IQ25zoOF/oHtjIvSy9OCe/aet c2WLBF41IIL1u37bBaATzDl+b6FqdBpyP314trGTYPQu6VtRQ/hrVFg+CNnYh4Gw4+wh jLWi+EH02Rc9dNHYFGip4wrnDXKPcaXqmi/GUpRM6kHBLirYNicD96+aSDMs3r254+pG 5nIVOMlunL3kPMLBZqgpvD4WgUgl97r5NOjIB+XizcvPHQ2ifr2lhyvoryfx+xBXna6X B8FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tSNwOUfGeTXq6tf7rzHsmmRkt0g8BbSwW5AAGiC9XDo=; b=HF+Z+16XF2mZAqa4Nt9UQhl2xtlS7S/VshxsKHG4Btpx7qXtUlh09RT9LgtecVWILC QV3te61BMD2A3fE4P9jxwdlZ0g5udlsBmCcL/fIQfiTqeeX2egosrBp0owvGiKNM6uTf 5RP5R5wuoZHEr2WiUni4ntyowpaqJ4ShqIppt4YhXbV29vh63rT9pbKG5rBCLM7JqzQa 3NUEcGFiPDDtQnyZnZKEpsaSeGLG52rmaOUufm2ZgimAqcx12ySv0pmHsP6eJ11zkIzz sIUNb4yla+AhG2OHw6Zs2zPt7i2TApSru2Y84hYTarCs39Bi6xVyMKZvz+gRLzvOcg54 U9dw== X-Gm-Message-State: AN3rC/5bKb/13f58KGsY/o/LLv1VaQ8AMTN6GGKK97GWijX7Ur1ykOvX B05uO5eKOAt7cAJXh/FMO2Ahdlw/UQ== X-Received: by 10.28.55.9 with SMTP id e9mr3793509wma.44.1492890199911; Sat, 22 Apr 2017 12:43:19 -0700 (PDT) In-Reply-To: <877f2dqst0.fsf@users.sourceforge.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131892 Archived-At: --001a1143d6b80df2a6054dc69614 Content-Type: text/plain; charset=UTF-8 schrieb am Sa., 22. Apr. 2017 um 00:48 Uhr: > Philipp Stephani writes: > > > + (let ((buffer (current-buffer))) > > + ;; `unquote-then-quote' is only used for the > > + ;; `verify-visited-file-modtime' action, which takes a buffer > > + ;; as only optional argument. > > + (with-current-buffer (or (car arguments) buffer) > > + (let ((buffer-file-name (substring buffer-file-name 2))) > > + ;; Make sure to hide the temporary buffer change from the > > + ;; underlying operation. > > + (with-current-buffer buffer > > + (apply operation arguments)))))) > > I think this could be simplified by using the buffer-file-name function: > > ;; `unquote-then-quote' is only used for the > ;; `verify-visited-file-modtime' action, which takes a buffer > ;; as only optional argument. > (let ((buffer-file-name > (substring (buffer-file-name (car arguments)) 2))) > (apply operation arguments)) > That's not the same, it will set the file name of the wrong buffer. --001a1143d6b80df2a6054dc69614 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


<npostavs@users.sourceforge.= net> schrieb am Sa., 22. Apr. 2017 um 00:48=C2=A0Uhr:
Philipp Stephani <p.stephani2@gmail.com> writes:

> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((buffer (current-buffer)))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; `unquote-then-quote' is only= used for the
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; `verify-visited-file-modtime'= ; action, which takes a buffer
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; as only optional argument.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-current-buffer (or (car argum= ents) buffer)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((buffer-file-name (sub= string buffer-file-name 2)))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Make sure to hide = the temporary buffer change from the
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; underlying operati= on.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-current-buffer = buffer
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(apply operati= on arguments))))))

I think this could be simplified by using the buffer-file-name function:
=C2=A0 =C2=A0 ;; `unquote-then-quote' is only used for the
=C2=A0 =C2=A0 ;; `verify-visited-file-modtime' action, which takes a bu= ffer
=C2=A0 =C2=A0 ;; as only optional argument.
=C2=A0 =C2=A0 (let ((buffer-file-name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(substring (buffer-file-name (car = arguments)) 2)))
=C2=A0 =C2=A0 =C2=A0 (apply operation arguments))

=
That's not the same, it will set the file name of the wrong = buffer.=C2=A0
--001a1143d6b80df2a6054dc69614--