(defcustom bookmark-menu-length 70
"*Maximum length of a bookmark name displayed on a popup menu."
:type 'integer
- :group 'boolean)
+ :group 'bookmark)
;;; No user-serviceable parts beyond this point.
(defun bookmark-file-or-variation-thereof (file)
- "Return FILE if it exists, or return the first variation based on
-`Info-suffix-list' that exists, else return nil."
+ "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)