unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25951: 26.0.50; Error when ediffing files that are visited using quoted file names
@ 2017-04-23 16:54 Philipp Stephani
  2017-04-29 11:49 ` bug#25951: [PATCH] Fix quoted files for 'verify-visited-file-modtime' Philipp Stephani
  0 siblings, 1 reply; 9+ messages in thread
From: Philipp Stephani @ 2017-04-23 16:54 UTC (permalink / raw)
  To: npostavs; +Cc: 25951

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

<npostavs@users.sourceforge.net> schrieb am Sa., 22. Apr. 2017 um 22:31 Uhr:

> Philipp Stephani <p.stephani2@gmail.com> writes:
>
> > <npostavs@users.sourceforge.net> schrieb am Sa., 22. Apr. 2017 um 00:48
> Uhr:
> >
> >> Philipp Stephani <p.stephani2@gmail.com> 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:
> >>
> >>     (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.
>
> Oh, I think I get it now.  It could be written like this, right?
>
>     (cl-letf* ((buf (or (car arguments) (current-buffer)))
>                ((buffer-local-value buffer-file-name buf)
>                 (substring (buffer-file-name buf) 2)))
>       (apply operation arguments))
>

Yes, that should work, thanks. Will send a new patch in a second.

[-- Attachment #2: Type: text/html, Size: 2393 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-05-07 11:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <83fugvpw24.fsf@gnu.org>
2017-04-29 12:20 ` bug#25951: [PATCH] Fix quoted files for 'verify-visited-file-modtime' Philipp Stephani
     [not found] ` <20170429122027.39318-1-phst@google.com>
2017-05-06 19:27   ` Philipp
     [not found]   ` <CAArVCkQ_mFGskvFHG9cVw=2fTxfROkDEshaxgGjrgk=oRBe4jA@mail.gmail.com>
2017-05-06 20:28     ` Glenn Morris
2017-05-06 20:41       ` npostavs
2017-05-06 21:21         ` bug#25951: [PATCH] Fix bootstrap build of files.el Philipp
2017-05-06 21:27         ` bug#25951: [PATCH] Fix quoted files for 'verify-visited-file-modtime' Philipp
     [not found]         ` <20170506212157.62158-1-phst@google.com>
2017-05-07  1:24           ` bug#25951: [PATCH] Fix bootstrap build of files.el Glenn Morris
     [not found]           ` <5gfugho3vw.fsf@fencepost.gnu.org>
2017-05-07 11:35             ` Philipp
2017-04-23 16:54 bug#25951: 26.0.50; Error when ediffing files that are visited using quoted file names Philipp Stephani
2017-04-29 11:49 ` bug#25951: [PATCH] Fix quoted files for 'verify-visited-file-modtime' Philipp Stephani

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).