From: Karl Fogel Date: Wed, 12 Jun 2002 21:44:33 +0000 (+0000) Subject: * bookmark.el (bookmark-file-or-variation-thereof): Restore vc-backend X-Git-Tag: ttn-vms-21-2-B4~14641 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=76bc6ee3862e35bb4ea9e6c5c8d3359b7a5e7611;p=emacs.git * bookmark.el (bookmark-file-or-variation-thereof): Restore vc-backend check, thanks to Robert Thorpe for noticing. Redocument. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b40fd1505e..eacc3f1ab48 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-06-12 Karl Fogel + + * bookmark.el (bookmark-file-or-variation-thereof): Restore + vc-backend check, thanks to Robert Thorpe for noticing. + 2002-06-12 Eli Zaretskii * textmodes/bibtex.el: Change the maintainer to "none". diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 5d56d9ca31f..97217a10e79 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1072,19 +1072,25 @@ of the old one in the permanent bookmark record." (defun bookmark-file-or-variation-thereof (file) - "Return FILE (a string) or a reasonable variation that exists, else nil. -Reasonable variations of the name are made by appending suffixes defined -in `Info-suffix-list'." + "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) ;; a leetle helper for bookmark-jump :-)