all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)
@ 2009-09-08 14:42 ` hans bennekop
  2009-09-09  0:54   ` Juri Linkov
  2009-09-09  2:45   ` bug#4374: marked as done (find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)) Emacs bug Tracking System
  0 siblings, 2 replies; 4+ messages in thread
From: hans bennekop @ 2009-09-08 14:42 UTC (permalink / raw)
  To: bug-gnu-emacs

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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)
  2009-09-08 14:42 ` bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) hans bennekop
@ 2009-09-09  0:54   ` Juri Linkov
  2009-09-09  2:45   ` bug#4374: marked as done (find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)) Emacs bug Tracking System
  1 sibling, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2009-09-09  0:54 UTC (permalink / raw)
  To: hans bennekop; +Cc: 4374

> 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/





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4374: marked as done (find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.))
  2009-09-08 14:42 ` bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) hans bennekop
  2009-09-09  0:54   ` Juri Linkov
@ 2009-09-09  2:45   ` Emacs bug Tracking System
  1 sibling, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-09-09  2:45 UTC (permalink / raw)
  To: Glenn Morris

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Your message dated Tue, 08 Sep 2009 22:36:42 -0400
with message-id <xnzl94269x.fsf@fencepost.gnu.org>
and subject line Re: bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)
has caused the Emacs bug report #4374,
regarding find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4374: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4374
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4093 bytes --]

From: hans bennekop <ylphcm@googlemail.com>
To: bug-gnu-emacs@gnu.org
Subject: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)
Date: Tue, 08 Sep 2009 16:42:29 +0200
Message-ID: <4AA66D55.4010507@gmail.com>

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.



[-- Attachment #3: Type: message/rfc822, Size: 1873 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: 4374-done@emacsbugs.donarmstrong.com
Subject: Re: bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)
Date: Tue, 08 Sep 2009 22:36:42 -0400
Message-ID: <xnzl94269x.fsf@fencepost.gnu.org>

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)
@ 2009-09-09  6:24 hans bennekop
  0 siblings, 0 replies; 4+ messages in thread
From: hans bennekop @ 2009-09-09  6:24 UTC (permalink / raw)
  To: juri; +Cc: bug-gnu-emacs

 > 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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-09  6:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <xnzl94269x.fsf@fencepost.gnu.org>
2009-09-08 14:42 ` bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) hans bennekop
2009-09-09  0:54   ` Juri Linkov
2009-09-09  2:45   ` bug#4374: marked as done (find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.)) Emacs bug Tracking System
2009-09-09  6:24 bug#4374: find-file-at-point doesn't recognize absolute file paths with trailing line numbers. (Patch included.) hans bennekop

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.