diff options
author | Glenn Morris <rgm@gnu.org> | 2009-09-09 02:36:38 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2009-09-09 02:36:38 +0000 |
commit | 2b2eb43148f0560583dd548aed491cbbc1ae6fc9 (patch) | |
tree | 77d20996e4dd0ccb175f935ad934fe7e0b4c6d4c /lisp/ffap.el | |
parent | 07cd41530f4ab95111a468ac6ed1453a3a430796 (diff) |
(ffap-file-at-point): Handle absolute (non-remote) files with line
numbers too. (Bug#4374)
Diffstat (limited to 'lisp/ffap.el')
-rw-r--r-- | lisp/ffap.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/ffap.el b/lisp/ffap.el index 6aa6913dbe..3eb21a5366 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1,7 +1,7 @@ ;;; ffap.el --- find file (or url) at point -;; Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Author: Michelangelo Grigni <mic@mathcs.emory.edu> ;; Maintainer: FSF @@ -1177,6 +1177,9 @@ which may actually result in an url rather than a filename." ((and abs (ffap-file-remote-p name))) ;; Ok, not remote, try the existence test even if it is absolute: ((and abs (ffap-file-exists-string name))) + ;; Try stripping off line numbers. + ((and abs (string-match ":[0-9]" name) + (ffap-file-exists-string (substring name 0 (match-beginning 0))))) ;; 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)) |