diff options
author | Karl Fogel <kfogel@red-bean.com> | 2002-06-12 21:44:33 +0000 |
---|---|---|
committer | Karl Fogel <kfogel@red-bean.com> | 2002-06-12 21:44:33 +0000 |
commit | 76bc6ee3862e35bb4ea9e6c5c8d3359b7a5e7611 (patch) | |
tree | d2b445d2103b18ce7804ccc5f60ab88d910aabe1 /lisp/bookmark.el | |
parent | b3e8cc4dfb1d02a69b6d59e944a1a935909bf853 (diff) | |
download | emacs-76bc6ee3862e35bb4ea9e6c5c8d3359b7a5e7611.tar.gz |
* bookmark.el (bookmark-file-or-variation-thereof): Restore vc-backend
check, thanks to Robert Thorpe <robert.thorpe@antenova.com> for
noticing. Redocument.
Diffstat (limited to 'lisp/bookmark.el')
-rw-r--r-- | lisp/bookmark.el | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 5d56d9ca31f..97217a10e79 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1072,19 +1072,25 @@ of the old one in the permanent bookmark record." (defun bookmark-file-or-variation-thereof (file) - "Return FILE (a string) or a reasonable variation that exists, else nil. -Reasonable variations of the name are made by appending suffixes defined -in `Info-suffix-list'." + "Return FILE (a string) if it exists, or return a reasonable +variation of FILE if that exists. Reasonable variations are checked +by appending suffixes defined in `Info-suffix-list'. If cannot find FILE +nor a reasonable variation thereof, then still return FILE if it can +be retrieved from a VC backend, else return nil." (if (file-exists-p file) file - (require 'info) ; ensure Info-suffix-list is bound - (catch 'found - (mapc (lambda (elt) - (let ((suffixed-file (concat file (car elt)))) - (if (file-exists-p suffixed-file) - (throw 'found suffixed-file)))) - Info-suffix-list) - nil))) + (or + (progn (require 'info) ; ensure Info-suffix-list is bound + (catch 'found + (mapc (lambda (elt) + (let ((suffixed-file (concat file (car elt)))) + (if (file-exists-p suffixed-file) + (throw 'found suffixed-file)))) + Info-suffix-list) + nil)) + ;; Last possibility: try VC + (if (vc-backend file) file)))) + (defun bookmark-jump-noselect (str) ;; a leetle helper for bookmark-jump :-) |