diff options
| author | Karl Fogel | 2002-06-08 03:33:09 +0000 |
|---|---|---|
| committer | Karl Fogel | 2002-06-08 03:33:09 +0000 |
| commit | dd33e6e94bb011a3e6e9be7b00aedc89679f01ee (patch) | |
| tree | bdbc5f43a2bb8fcfa9bd6dd46adb8e470abc7712 | |
| parent | 1b65481e291ba1a8b9a21d688b8255459442c5f5 (diff) | |
| download | emacs-dd33e6e94bb011a3e6e9be7b00aedc89679f01ee.tar.gz emacs-dd33e6e94bb011a3e6e9be7b00aedc89679f01ee.zip | |
* bookmark.el (bookmark-file-or-variation-thereof): Just use
Info-suffix-list, as suggested by Stefan Monnier.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/bookmark.el | 25 |
2 files changed, 17 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index da57c509295..68fdbec84bd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2002-06-07 Karl Fogel <kfogel@red-bean.com> | ||
| 2 | |||
| 3 | * bookmark.el (bookmark-file-or-variation-thereof): Just use | ||
| 4 | Info-suffix-list, as suggested by Stefan Monnier. | ||
| 5 | |||
| 1 | 2002-06-05 Eli Zaretskii <eliz@is.elta.co.il> | 6 | 2002-06-05 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 7 | ||
| 3 | * select.el (xselect-convert-to-string): If VALUE is a string, | 8 | * select.el (xselect-convert-to-string): If VALUE is a string, |
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 53939f92ca6..c3bab39ba3d 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -1072,19 +1072,18 @@ of the old one in the permanent bookmark record." | |||
| 1072 | 1072 | ||
| 1073 | 1073 | ||
| 1074 | (defun bookmark-file-or-variation-thereof (file) | 1074 | (defun bookmark-file-or-variation-thereof (file) |
| 1075 | "Return FILE (a string) if it exists in any reasonable variation, else nil. | 1075 | "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." | 1076 | `Info-suffix-list' that exists, else return nil." |
| 1077 | (cond | 1077 | (if (file-exists-p file) |
| 1078 | ((file-exists-p file) file) | 1078 | file |
| 1079 | ((file-exists-p (concat file ".Z")) (concat file ".Z")) | 1079 | (require 'info) ; ensure Info-suffix-list is bound |
| 1080 | ((file-exists-p (concat file ".gz")) (concat file ".gz")) | 1080 | (catch 'found |
| 1081 | ((file-exists-p (concat file ".z")) (concat file ".z")) | 1081 | (mapc (lambda (elt) |
| 1082 | ((file-exists-p (concat file ".info")) (concat file ".info")) | 1082 | (let ((suffixed-file (concat file (car elt)))) |
| 1083 | ((file-exists-p (concat file ".info.gz")) (concat file ".info.gz")) | 1083 | (if (file-exists-p suffixed-file) |
| 1084 | ((file-exists-p (concat file ".info.Z")) (concat file ".info.Z")) | 1084 | (throw 'found suffixed-file)))) |
| 1085 | ((file-exists-p (concat file ".info.z")) (concat file ".info.z")) | 1085 | Info-suffix-list) |
| 1086 | ((vc-backend file) file) ; maybe VC has it? | 1086 | nil))) |
| 1087 | (t nil))) | ||
| 1088 | 1087 | ||
| 1089 | 1088 | ||
| 1090 | (defun bookmark-jump-noselect (str) | 1089 | (defun bookmark-jump-noselect (str) |