--- Begin Message ---
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 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
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.
--- End Message ---
--- Begin Message ---
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 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
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.
--- End Message ---