Philipp Stephani <p.stephani2@gmail.com> writes:
> <npostavs@users.sourceforge.net> schrieb am Sa., 22. Apr. 2017 um 0=
0:48 Uhr:
>
>> Philipp Stephani <p.stephani2@gmail.com> writes:
>>
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((buffer (current-buffer)))<=
br>
>> > +=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-mo=
dtime' action, which takes a buffer
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; as only optional argume=
nt.
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-current-buffer (or (=
car arguments) buffer)
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((buffer-file-=
name (substring 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;; underlyin=
g operation.
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-curren=
t-buffer buffer
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(appl=
y operation arguments))))))
>>
>> I think this could be simplified by using the buffer-file-name fun=
ction:
>>
>>=C2=A0 =C2=A0 =C2=A0(let ((buffer-file-name
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (substring (buffer-file-n=
ame (car arguments)) 2)))
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0(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.=C2=A0 It could be written like this, right?
=C2=A0 =C2=A0 (cl-letf* ((buf (or (car arguments) (current-buffer)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((buffer-local-value=
buffer-file-name buf)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (substring (buffer-=
file-name buf) 2)))
=C2=A0 =C2=A0 =C2=A0 (apply operation arguments))
=
Yes, that should work, thanks. Will send a new patch in a second=
.=C2=A0