emacs-devel
[Top][All Lists]
Advanced

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

Re: bookmark.el and lisp/gnus/gnus-bookmark.el


From: Karl Fogel
Subject: Re: bookmark.el and lisp/gnus/gnus-bookmark.el
Date: Fri, 07 Mar 2008 12:34:36 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Bastien <address@hidden> writes:
> He is right about the fact that you forget to rename the variable, but
> renaming this variable is not enough - sorry to insist.

Oh, it's okay -- I wasn't claiming anything beyond Tassilo being right
about the intention of my rename.

> We also need to update `bookmark-buffer-name' so that it returns a
> sensible value in *any* mode: for now it only returns a value in a
> buffer visiting a file, in dired and in info mode.
>
> My proposal is to add this:
>
> (defvar bookmark-make-name-function nil
>   "A function that should be called to return the name of the bookmark.
> Modes may set this variable buffer-locally to enable a default name to
> be proposed when calling `bookmark-set'.")

Okay...

> I thought your mistake about not renaming `bookmark-make-cell-function'
> was not a mistake about renaming, but a mistake about forgetting to make 
> `bookmark-buffer-name'.handle this new variable.  

...no, all I was doing was the rename, but...

> I think we should:
>
> 1. Update `bookmark-buffer-name' like this:
>
> (defun bookmark-buffer-name ()
>   "Return the name of the current buffer's file, non-directory.
> In Info, return the current node."

...if we're going to have `bookmark-make-name-function' now, shouldn't
Info mode implement that function just like any other mode would?  Why
have bookmark.el handle Info-related things?

> 2. Use `bookmark-make-name-function' function in `bookmark-set' instead
>    of `bookmark-make-record-function':

You mean for making it buffer-local, right?  (We're not actually calling
it.)  But wouldn't we need to make them *both* buffer-local?  External
code will still need to call `bookmark-make-record-function' too.

> ...
>   (or
>    (local-variable-p 'bookmark-make-name-function)
>    (bookmark-buffer-file-name)
>    (error "Buffer not visiting a file or directory"))
> ...
>
> If you agree, I will make those changes.  They are required for the
> rewrite of gnus-bookmark.el.

The overall plan sounds reasonable to me, modulo the above questions.
Although I've been guilty earlier in this thread of agreeing to readily
without looking at the code, I have looked at the code this time, and
still agree! :-)

Thanks,
-Karl




reply via email to

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