aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/bookmark.el34
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 476a66d8c97..b6e084d6898 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1077,6 +1077,22 @@ of the old one in the permanent bookmark record."
1077 (bookmark-show-annotation bookmark))))) 1077 (bookmark-show-annotation bookmark)))))
1078 1078
1079 1079
1080(defun bookmark-file-or-variation-thereof (file)
1081 "Return FILE (a string) if it exists in any reasonable variation, else nil.
1082Reasonable variations are FILE.gz, FILE.Z, FILE.info, FILE.info.gz, etc."
1083 (cond
1084 ((file-exists-p file) file)
1085 ((file-exists-p (concat file ".Z")) (concat file ".Z"))
1086 ((file-exists-p (concat file ".gz")) (concat file ".gz"))
1087 ((file-exists-p (concat file ".z")) (concat file ".z"))
1088 ((file-exists-p (concat file ".info")) (concat file ".info"))
1089 ((file-exists-p (concat file ".info.gz")) (concat file ".info.gz"))
1090 ((file-exists-p (concat file ".info.Z")) (concat file ".info.Z"))
1091 ((file-exists-p (concat file ".info.z")) (concat file ".info.z"))
1092 ((vc-backend file) file) ; maybe VC has it?
1093 (t nil)))
1094
1095
1080(defun bookmark-jump-noselect (str) 1096(defun bookmark-jump-noselect (str)
1081 ;; a leetle helper for bookmark-jump :-) 1097 ;; a leetle helper for bookmark-jump :-)
1082 ;; returns (BUFFER . POINT) 1098 ;; returns (BUFFER . POINT)
@@ -1088,23 +1104,7 @@ of the old one in the permanent bookmark record."
1088 (info-node (bookmark-get-info-node str)) 1104 (info-node (bookmark-get-info-node str))
1089 (orig-file file) 1105 (orig-file file)
1090 ) 1106 )
1091 (if (or 1107 (if (setq file (bookmark-file-or-variation-thereof file))
1092 (file-exists-p file)
1093 ;; Else try some common compression extensions, which Emacs
1094 ;; usually handles right. I hope.
1095 (setq file
1096 (or
1097 (let ((altname (concat file ".Z")))
1098 (and (file-exists-p altname)
1099 altname))
1100 (let ((altname (concat file ".gz")))
1101 (and (file-exists-p altname)
1102 altname))
1103 (let ((altname (concat file ".z")))
1104 (and (file-exists-p altname)
1105 altname))
1106 ;; Check VC incarnations, preparatory to checkout
1107 (if (vc-backend file) file nil))))
1108 (save-excursion 1108 (save-excursion
1109 (save-window-excursion 1109 (save-window-excursion
1110 (if info-node 1110 (if info-node