[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: info,bookmark and bzip2

From: Karl Fogel
Subject: Re: info,bookmark and bzip2
Date: 12 Jun 2002 13:26:53 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

Karl Fogel <address@hidden> writes:
> "Robert Thorpe" <address@hidden> writes:
> > This works fine.  It doesn't check vc anymore as far as I can tell.
> >   I don't know whether this is a problem, I just thought you might 
> > have forgotten about it.
> Nope, that's a total oversight on my part, I'll put it back in.

Okay, I've restored the vc-backend check.  Somewhat arbitrarily, I
decided to put it *after* the checks for ".gz", ".Z", and so on,

This means that if file `foo' doesn't exist, but `foo,v' and `foo.gz'
both do exist, then jumping to a bookmark set in `foo' will open
foo.gz, rather than try to check foo out from RCS.  If you remove
foo.gz, then foo will be checked out from RCS.

Not sure there's a right answer here, but if anyone has any thoughts,
please make a noise.

Here's the new version of the function, as committed in revision 1.62
of bookmark.el:

(defun bookmark-file-or-variation-thereof (file)
  "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)
     (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))))
     ;; Last possibility: try VC
     (if (vc-backend file) file))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]