From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#10160: 24.0.91; diff-hunk-file-names returns quoted file names Date: Fri, 16 Jul 2021 15:50:41 +0200 Message-ID: <87a6mm8j0u.fsf@gnus.org> References: <871usr410u.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9848"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 10160@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 16 15:51:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4OFD-0002Mq-Ai for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Jul 2021 15:51:11 +0200 Original-Received: from localhost ([::1]:53932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4OFC-0002mF-B5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Jul 2021 09:51:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4OF6-0002lG-75 for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2021 09:51:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4OF4-0000pI-8F for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2021 09:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m4OF4-0003j5-7h for bug-gnu-emacs@gnu.org; Fri, 16 Jul 2021 09:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Jul 2021 13:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10160 X-GNU-PR-Package: emacs Original-Received: via spool by 10160-submit@debbugs.gnu.org id=B10160.162644345314295 (code B ref 10160); Fri, 16 Jul 2021 13:51:02 +0000 Original-Received: (at 10160) by debbugs.gnu.org; 16 Jul 2021 13:50:53 +0000 Original-Received: from localhost ([127.0.0.1]:50936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m4OEv-0003iU-Gy for submit@debbugs.gnu.org; Fri, 16 Jul 2021 09:50:53 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:41404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m4OEt-0003iF-8L for 10160@debbugs.gnu.org; Fri, 16 Jul 2021 09:50:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3JqAnCdJvoSg0rUZwliX1GDZorWSnBGBSZ7jGa+Atug=; b=EdW81vgxH1UNm+bFgdyyZO1C8i gtPAhef69x6Hk5At10pMqoNNdZmI8lV4Gndcn58qb4cvOtkXYs1RrOggu3exSnfgOemnD2mtLHUGx qA+rAe9P12WjEKMqmY0/rMCKoiAeLFn+QCqSsjioYb9NRy78fiF9pleapRcYhFORdrR0=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4OEk-0004tY-8m; Fri, 16 Jul 2021 15:50:44 +0200 X-Now-Playing: John T. Gast's _Inna Babalon_: "Jah Guidance" In-Reply-To: <871usr410u.fsf@gmx.de> (Michael Albinus's message of "Tue, 29 Nov 2011 12:32:33 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:210098 Archived-At: Michael Albinus 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