bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10160: 24.0.91; diff-hunk-file-names returns quoted file names


From: Lars Ingebrigtsen
Subject: bug#10160: 24.0.91; diff-hunk-file-names returns quoted file names
Date: Fri, 16 Jul 2021 15:50:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]