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: Bastien
Subject: Re: bookmark.el and lisp/gnus/gnus-bookmark.el
Date: Thu, 06 Mar 2008 23:15:41 +0000
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> He added the buffer-local variable `bookmark-make-cell-function', which
>> lets you define a handler for a mode: when setting a bookmark, a handler
>> is added to the record and jumping to the bookmark will use this handler
>> instead of `bookmark-jump' (see `bookmark-jump-internal'.)
>
>> This is all good, but it only works for buffer visiting files and
>> Info-mode. 
>
> I don't understand why you think so.  Could you explain in more
> details?

This boils down to this: having a `bookmark-make-name-function' doing
for the names of the bookmarks what `bookmark-make-cell-function' does
for the records.  This would be locally set depending on the mode we're
in.  

For now the the name of the bookmark is set by bookmark-buffer-file-name
which doesn't return anything unless you are in a buffer visiting a file
or an Info node, or dired.

> BTW bookmark-make-cell-function needs to be fixed so it doesn't receive
> any `info-node' argument.  This was needed back when
> bookmark-make-cell-function didn't exist, but now that info uses
> bookmark-make-cell-function, bookmark.el shouldn't need any
> info-specific code.
>
>> - run every function in `bookmark-set-functions' until one returns
>>   something useful (those functions returning something similar to
>>   ` bookmark-buffer-file-name');
>
> What would it do differently from bookmark-make-cell-function?

Yes, bookmark-set-functions was not the right thing.  
Having a buffer-local value for `bookmark-make-name-function'
should be enough.  

This is rather simple, and will help getting rid of the code.  
Should I go for this?

-- 
Bastien




reply via email to

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