mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
(ffap-file-at-point): Test local file names
immediately. Strip off line numbers.
This commit is contained in:
parent
118069b3b0
commit
8005ea3f21
1 changed files with 7 additions and 1 deletions
|
|
@ -1100,7 +1100,13 @@ which may actually result in an url rather than a filename."
|
|||
(unwind-protect
|
||||
(cond
|
||||
;; Immediate rejects (/ and // are too common in C++):
|
||||
((member name '("" "/" "//")) nil)
|
||||
((member name '("" "/" "//" ".")) nil)
|
||||
;; Immediately test local filenames. If default-directory is
|
||||
;; 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)
|
||||
(ffap-file-exists-string (substring name 0 (match-beginning 0)))))
|
||||
;; Immediately test local filenames. If default-directory is
|
||||
;; remote, you probably already have a connection.
|
||||
((and (not abs) (ffap-file-exists-string name)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue