# HG changeset patch # User Glenn Morris # Date 1252463798 0 # Node ID 386dbc11f8f75631149da3319b03a1cb84bf78a6 # Parent 978084a76b60eb1feaaa3c3551c9665946e1ec4e (ffap-file-at-point): Handle absolute (non-remote) files with line numbers too. (Bug#4374) diff -r 978084a76b60 -r 386dbc11f8f7 lisp/ChangeLog --- a/lisp/ChangeLog Wed Sep 09 02:34:17 2009 +0000 +++ b/lisp/ChangeLog Wed Sep 09 02:36:38 2009 +0000 @@ -1,3 +1,8 @@ +2009-09-09 Glenn Morris + + * ffap.el (ffap-file-at-point): Handle absolute (non-remote) files with + line numbers too. (Bug#4374) + 2009-09-08 Stefan Monnier * smerge-mode.el (smerge-remove-props, smerge-refine): diff -r 978084a76b60 -r 386dbc11f8f7 lisp/ffap.el --- a/lisp/ffap.el Wed Sep 09 02:34:17 2009 +0000 +++ b/lisp/ffap.el Wed Sep 09 02:36:38 2009 +0000 @@ -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 ;; Maintainer: FSF @@ -1177,6 +1177,9 @@ ((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))