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: Stefan Monnier
Subject: Re: bookmark.el and lisp/gnus/gnus-bookmark.el
Date: Fri, 07 Mar 2008 16:51:54 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>>> 2. Use `bookmark-make-name-function' function in `bookmark-set' instead
>>> of `bookmark-make-record-function':
>> You mean for making it buffer-local, right?
> Right!

I do not understand.  Bookmark.el shouldn't make any of those variables
buffer-local, AFAICT.

>> But wouldn't we need to make them *both* buffer-local?  External code
>> will still need to call `bookmark-make-record-function' too.

> Yes, they should be both buffer-local.

Let the modes that use them call make-local-variable.

> My single remaining hesitation is this one: having two buffer local
> variables is a bit too much, since each mode would have to set them
> both.  Better use `bookmark-make-record-function' for both purposes:
> returning a name *or* returning a record.

> For example, the function for text files would look like:

> (defun bookmark-make-record-for-text-file (annotation &optional name)
>    "Return the record.  
> If optional arg NAME is non-nil, just return the default name for
> this bookmark."
>    ...)

> I think it's easier.  Each mode should have to worry about one
> buffer-local variable (and each dev would only read one docstring...)

This might work, tho I'd throw away the `name' arg.  Let the
buffer-local function build a bookmark record (i.e. a cons cell of the
form (NAME . ALIST)) with any name it chooses, and then change the name
according to the user's choice.  I.e. make the bookmark record before
even prompting the user for a name.


        Stefan




reply via email to

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