1072 |
|
|
1073 |
|
|
1074 |
(defun bookmark-file-or-variation-thereof (file) |
(defun bookmark-file-or-variation-thereof (file) |
1075 |
"Return FILE (a string) if it exists in any reasonable variation, else nil. |
"Return FILE if it exists, or return the first variation based on |
1076 |
Reasonable variations are FILE.gz, FILE.Z, FILE.info, FILE.info.gz, etc." |
`Info-suffix-list' that exists, else return nil." |
1077 |
(cond |
(if (file-exists-p file) |
1078 |
((file-exists-p file) file) |
file |
1079 |
((file-exists-p (concat file ".Z")) (concat file ".Z")) |
(require 'info) ; ensure Info-suffix-list is bound |
1080 |
((file-exists-p (concat file ".gz")) (concat file ".gz")) |
(catch 'found |
1081 |
((file-exists-p (concat file ".z")) (concat file ".z")) |
(mapc (lambda (elt) |
1082 |
((file-exists-p (concat file ".info")) (concat file ".info")) |
(let ((suffixed-file (concat file (car elt)))) |
1083 |
((file-exists-p (concat file ".info.gz")) (concat file ".info.gz")) |
(if (file-exists-p suffixed-file) |
1084 |
((file-exists-p (concat file ".info.Z")) (concat file ".info.Z")) |
(throw 'found suffixed-file)))) |
1085 |
((file-exists-p (concat file ".info.z")) (concat file ".info.z")) |
Info-suffix-list) |
1086 |
((vc-backend file) file) ; maybe VC has it? |
nil))) |
|
(t nil))) |
|
1087 |
|
|
1088 |
|
|
1089 |
(defun bookmark-jump-noselect (str) |
(defun bookmark-jump-noselect (str) |