From: Lars Ingebrigtsen <larsi@gnus.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 10160@debbugs.gnu.org
Subject: bug#10160: 24.0.91; diff-hunk-file-names returns quoted file names
Date: Fri, 16 Jul 2021 15:50:41 +0200 [thread overview]
Message-ID: <87a6mm8j0u.fsf@gnus.org> (raw)
In-Reply-To: <871usr410u.fsf@gmx.de> (Michael Albinus's message of "Tue, 29 Nov 2011 12:32:33 +0100")
Michael Albinus <michael.albinus@gmx.de> writes:
> diff-hunk-file-names reads file names from the *Diff* buffer. The first
> line (the diff command itself) can contain labels, marked with -L. If
> these labels contains quoted characters like in remote file names, the
> quotation is returned. Example:
>
> diff -c -L /ftp\:slbhao\:/home/albinus/src/tramp/lisp/tramp.el -L /ftp\:slbhao\:/home/albinus/src/emacs/lisp/net/tramp.el /tmp/ange-ftp13518wvE.el /tmp/ange-ftp1351895K.el
Looking at the code, it just returns the first two "words" after
"diff -OPTION":
;; this assumes that there are no spaces in filenames
(when (re-search-backward
"^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?"
nil t)
(list (if old (match-string 2) (match-string 4))
(if old (match-string 4) (match-string 2)))))))))
I guess we could filter out "-L +\\S-+" before matching? But I don't
think I've ever seen "-L" in the wild, so I don't know whether it's
worth doing.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2021-07-16 13:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-29 11:32 bug#10160: 24.0.91; diff-hunk-file-names returns quoted file names Michael Albinus
2011-11-29 18:50 ` Stefan Monnier
2011-11-29 19:01 ` Michael Albinus
2021-07-16 13:50 ` Lars Ingebrigtsen [this message]
2021-08-14 13:51 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6mm8j0u.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=10160@debbugs.gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).