]> code.delx.au - gnu-emacs/blobdiff - lisp/bookmark.el
(decipher-mode-map): Use command remapping instead of
[gnu-emacs] / lisp / bookmark.el
index c3bab39ba3d33b5bd5354315c850056e8628f32a..2252087b102efc64c4c32d42ae45d6613e18bad6 100644 (file)
@@ -194,7 +194,7 @@ following in your `.emacs' file:
 (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.
@@ -1072,18 +1072,24 @@ of the old one in the permanent bookmark record."
 
 
 (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)