From unknown Tue Sep 09 22:28:50 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) Reply-To: hans bennekop , 4374@debbugs.gnu.org Resent-From: hans bennekop Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Tue, 08 Sep 2009 14:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 4374 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125242098031504 (code B ref -1); Tue, 08 Sep 2009 14:50:04 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Sep 2009 14:43:00 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n88EgwLm031494 for ; Tue, 8 Sep 2009 07:42:59 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ml1uM-0005tS-5p for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 10:42:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ml1uH-0005nZ-KV for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 10:42:57 -0400 Received: from [199.232.76.173] (port=54477 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ml1uH-0005nM-BA for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 10:42:53 -0400 Received: from mail-bw0-f220.google.com ([209.85.218.220]:59735) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ml1uG-00079p-Vf for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 10:42:53 -0400 Received: by bwz20 with SMTP id 20so639986bwz.42 for ; Tue, 08 Sep 2009 07:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=IDMH+XDq6DbxelJKicyN40p98y6kXUtaj/HSdu2ZOJ0=; b=VbYM2K3P7igJCDhiPj06qq9S+qGNyaSh1Wj3RaYKYm+bfLuJiB3OYsdiNhU88ELIyM kk1B7Gc3MpwAgyXM4LM8aiapMyM53SGnaQAzr22mxbj0lyfzAmP/GYV+sqGlkgQ2pK9O /4h0w4sZQAmHxDOpj7fKSepRLig4aNF4Bq9dI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=KFeYu9TYk8l8Pg2hfmWM7H4uFDQ10sWSVIyUvUUmcFg+4CHcBxn8qAr2aZ1eSeRgSR 89+tNq0L9T+DMAtpIV4PrTLqDwyfPznALF/TsV8bYqgzTCaIU7rdCKcTEMg+cpcpKDp2 4pUhuxpyS6NH68TyYvEd8+DgyLVXvm71SxN3Q= Received: by 10.103.67.25 with SMTP id u25mr6749426muk.45.1252420969387; Tue, 08 Sep 2009 07:42:49 -0700 (PDT) Received: from ?192.168.1.25? (dslb-088-068-203-230.pools.arcor-ip.net [88.68.203.230]) by mx.google.com with ESMTPS id n10sm82375mue.37.2009.09.08.07.42.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 07:42:48 -0700 (PDT) Message-ID: <4AA66D55.4010507@gmail.com> Date: Tue, 08 Sep 2009 16:42:29 +0200 From: hans bennekop User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) I frequently run across absolute file paths with a trailing line-number specification, e.g. ~/foo.el:7. Find-file-at-point fails to recognize the file part and falls back to opening the parent dir. Here's the (trivial) fix: --- emacs-23/lisp/ffap.el +++ emacs-23/lisp/ffap-fix.el @@ -1170,7 +1170,7 @@ ;; remote, you probably already have a connection. ((and (not abs) (ffap-file-exists-string name))) ;; Try stripping off line numbers; good for compilation/grep output. - ((and (not abs) (string-match ":[0-9]" name) + ((and (string-match ":[0-9]" name) (ffap-file-exists-string (substring name 0 (match-beginning 0))))) ;; Try stripping off prominent (non-root - #) shell prompts ;; if the ffap-shell-prompt-regexp is non-nil. From unknown Tue Sep 09 22:28:50 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: hans bennekop Subject: bug#4374 closed by Glenn Morris (Re: bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)) Message-ID: References: <4AA66D55.4010507@gmail.com> X-Emacs-PR-Message: they-closed 4374 X-Emacs-PR-Package: emacs Reply-To: 4374@debbugs.gnu.org Date: Wed, 09 Sep 2009 02:45:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1252464304-11391-1" This is a multi-part message in MIME format... ------------=_1252464304-11391-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #4374: find-file-at-point doesn't recognize absolute file paths with traili= ng line numbers. (Patch included.) It has been closed by Glenn Morris . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Glenn Morris by replying to this email. --=20 4374: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D4374 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1252464304-11391-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4374-done) by emacsbugs.donarmstrong.com; 9 Sep 2009 02:36:45 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-7.7 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n892ahfO010075 for <4374-done@emacsbugs.donarmstrong.com>; Tue, 8 Sep 2009 19:36:44 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MlD34-00083i-Vh; Tue, 08 Sep 2009 22:36:43 -0400 From: Glenn Morris To: 4374-done@debbugs.gnu.org Subject: Re: bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) References: <4AA66D55.4010507@gmail.com> X-Spook: Clinton BLU-97 A/B NORAD CBNRC White House e-cash X-Ran: *V[!j User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii hans bennekop wrote: > I frequently run across absolute file paths with a trailing line-number > specification, e.g. ~/foo.el:7. > Find-file-at-point fails to recognize the file part and falls back to > opening the parent dir. (I guess path-separator is not ":" on your platform, since if it is this seems to work for me.) > Here's the (trivial) fix: I installed something similar. ------------=_1252464304-11391-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 8 Sep 2009 14:43:00 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n88EgwLm031494 for ; Tue, 8 Sep 2009 07:42:59 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ml1uM-0005tS-5p for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 10:42:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ml1uH-0005nZ-KV for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 10:42:57 -0400 Received: from [199.232.76.173] (port=54477 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ml1uH-0005nM-BA for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 10:42:53 -0400 Received: from mail-bw0-f220.google.com ([209.85.218.220]:59735) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ml1uG-00079p-Vf for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 10:42:53 -0400 Received: by bwz20 with SMTP id 20so639986bwz.42 for ; Tue, 08 Sep 2009 07:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=IDMH+XDq6DbxelJKicyN40p98y6kXUtaj/HSdu2ZOJ0=; b=VbYM2K3P7igJCDhiPj06qq9S+qGNyaSh1Wj3RaYKYm+bfLuJiB3OYsdiNhU88ELIyM kk1B7Gc3MpwAgyXM4LM8aiapMyM53SGnaQAzr22mxbj0lyfzAmP/GYV+sqGlkgQ2pK9O /4h0w4sZQAmHxDOpj7fKSepRLig4aNF4Bq9dI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=KFeYu9TYk8l8Pg2hfmWM7H4uFDQ10sWSVIyUvUUmcFg+4CHcBxn8qAr2aZ1eSeRgSR 89+tNq0L9T+DMAtpIV4PrTLqDwyfPznALF/TsV8bYqgzTCaIU7rdCKcTEMg+cpcpKDp2 4pUhuxpyS6NH68TyYvEd8+DgyLVXvm71SxN3Q= Received: by 10.103.67.25 with SMTP id u25mr6749426muk.45.1252420969387; Tue, 08 Sep 2009 07:42:49 -0700 (PDT) Received: from ?192.168.1.25? (dslb-088-068-203-230.pools.arcor-ip.net [88.68.203.230]) by mx.google.com with ESMTPS id n10sm82375mue.37.2009.09.08.07.42.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 07:42:48 -0700 (PDT) Message-ID: <4AA66D55.4010507@gmail.com> Date: Tue, 08 Sep 2009 16:42:29 +0200 From: hans bennekop User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) I frequently run across absolute file paths with a trailing line-number specification, e.g. ~/foo.el:7. Find-file-at-point fails to recognize the file part and falls back to opening the parent dir. Here's the (trivial) fix: --- emacs-23/lisp/ffap.el +++ emacs-23/lisp/ffap-fix.el @@ -1170,7 +1170,7 @@ ;; remote, you probably already have a connection. ((and (not abs) (ffap-file-exists-string name))) ;; Try stripping off line numbers; good for compilation/grep output. - ((and (not abs) (string-match ":[0-9]" name) + ((and (string-match ":[0-9]" name) (ffap-file-exists-string (substring name 0 (match-beginning 0))))) ;; Try stripping off prominent (non-root - #) shell prompts ;; if the ffap-shell-prompt-regexp is non-nil. ------------=_1252464304-11391-1-- From unknown Tue Sep 09 22:28:50 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) Reply-To: Juri Linkov , 4374@debbugs.gnu.org Resent-From: Juri Linkov Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 09 Sep 2009 03:20:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4374 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4374-submit@emacsbugs.donarmstrong.com id=B4374.125246605916762 (code B ref 4374); Wed, 09 Sep 2009 03:20:08 +0000 Received: (at 4374) by emacsbugs.donarmstrong.com; 9 Sep 2009 03:14:19 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx2.starman.ee (smtp-out2.starman.ee [85.253.0.4]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n893EHE1016755 for <4374@emacsbugs.donarmstrong.com>; Tue, 8 Sep 2009 20:14:19 -0700 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Received: from mail.starman.ee (82.131.28.177.cable.starman.ee [82.131.28.177]) by mx2.starman.ee (Postfix) with ESMTP id 879363F4295; Wed, 9 Sep 2009 06:14:11 +0300 (EEST) From: Juri Linkov To: hans bennekop Cc: 4374@debbugs.gnu.org Organization: JURTA References: <4AA66D55.4010507@gmail.com> Date: Wed, 09 Sep 2009 03:54:17 +0300 In-Reply-To: <4AA66D55.4010507@gmail.com> (hans bennekop's message of "Tue, 08 Sep 2009 16:42:29 +0200") Message-ID: <87my546fma.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > I frequently run across absolute file paths with a trailing line-number > specification, e.g. ~/foo.el:7. > Find-file-at-point fails to recognize the file part and falls back to > opening the parent dir. The part after the colon already gets removed by the following rule: ;; If it contains a colon, get rid of it (and return if exists) ((and (string-match path-separator name) (setq name (ffap-string-at-point 'nocolon)) (ffap-file-exists-string name))) I wonder what the value of `path-separator' do you have? Is it a colon? -- Juri Linkov http://www.jurta.org/emacs/ From unknown Tue Sep 09 22:28:50 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) Reply-To: hans bennekop , 4374@debbugs.gnu.org Resent-From: hans bennekop Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 09 Sep 2009 06:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4374 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125247749517857 (code B ref -1); Wed, 09 Sep 2009 06:30:04 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 9 Sep 2009 06:24:55 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.5 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n896OrLB017845 for ; Tue, 8 Sep 2009 23:24:54 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlGbp-0002RE-KE for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2009 02:24:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlGbk-0002Fx-8r for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2009 02:24:48 -0400 Received: from [199.232.76.173] (port=41675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlGbj-0002FU-Fw for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2009 02:24:43 -0400 Received: from mail-bw0-f220.google.com ([209.85.218.220]:63926) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MlGbi-0005D7-Ns for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2009 02:24:42 -0400 Received: by bwz20 with SMTP id 20so1130870bwz.42 for ; Tue, 08 Sep 2009 23:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:content-type :content-transfer-encoding; bh=eWMrCooDfkA9FoZGkIHMB2OAcrye37N3FAzCj/zIuWQ=; b=E4CebbGEf7LLjMQpN4HWsh2P2gPk9mBt2n8wCqtBrTqGTMC501v9JL7aZtmKnHjEEV znM83fon6RUOEdWPY+8aPUYLK/E8+aoGvyyeKt2ryIVsvWn+4R9lCo3YhH/VFRANMRAv L2p+0ms+0P4f/zfXFEt+wdQucHdE8RWDxACPM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:content-type:content-transfer-encoding; b=Oyapz/VSN7H6Zf2Wbg49aRYPFzQ0zV1sUnFUOHWWjFV6VzYLn2ac9mEvMjepnlJ3E7 93xikF7+n4XIZQDwIrisfnvgFnx+LE2ZuRlZFZQIE03DQXF5LgfUAXw4Pa/rAXvrHBn3 jL/OnHiye6IW6slT9A4VG4ZR1klDIIY+Rc3bA= Received: by 10.223.21.153 with SMTP id j25mr6894385fab.79.1252477481477; Tue, 08 Sep 2009 23:24:41 -0700 (PDT) Received: from ?192.168.1.25? (dslb-088-068-199-074.pools.arcor-ip.net [88.68.199.74]) by mx.google.com with ESMTPS id 1sm1187439fkt.51.2009.09.08.23.24.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 23:24:40 -0700 (PDT) Message-ID: <4AA74A14.2000205@gmail.com> Date: Wed, 09 Sep 2009 08:24:20 +0200 From: hans bennekop User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: juri@jurta.org CC: bug-gnu-emacs@gnu.org References: 87my546fma.fsf@mail.jurta.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) > I wonder what the value of `path-separator' do you have? Is it a colon? Oh, I didn't see that part. It's a semicolon (Windows). Since I don't know of any relevant OS where colons are permitted in a path, I'd vote for explicitly handling them to allow for compatibility with Unix style paths.