(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 (a string) if it exists in any reasonable variation, else nil.
-Reasonable variations are FILE.gz, FILE.Z, FILE.info, FILE.info.gz, etc."
- (cond
- ((file-exists-p file) file)
- ((file-exists-p (concat file ".Z")) (concat file ".Z"))
- ((file-exists-p (concat file ".gz")) (concat file ".gz"))
- ((file-exists-p (concat file ".z")) (concat file ".z"))
- ((file-exists-p (concat file ".info")) (concat file ".info"))
- ((file-exists-p (concat file ".info.gz")) (concat file ".info.gz"))
- ((file-exists-p (concat file ".info.Z")) (concat file ".info.Z"))
- ((file-exists-p (concat file ".info.z")) (concat file ".info.z"))
- ((vc-backend file) file) ; maybe VC has it?
- (t 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
+ (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)