all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-devel@gnu.org
Subject: Re: doc-view support for bookmark.el
Date: Thu, 27 Dec 2007 10:21:48 +0100	[thread overview]
Message-ID: <87abnwv6fn.fsf@member.fsf.org> (raw)
In-Reply-To: <87lk7hz3rg.fsf@red-bean.com> (Karl Fogel's message of "Wed, 26 Dec 2007 10:53:39 -0800")

Karl Fogel <kfogel@red-bean.com> writes:

Hi Karl,

> I like your new bookmark abstractions, Tassilo!

:-)

> A few comments:
>
> Tassilo Horn <tassilo@member.fsf.org> writes:
>> --- lisp/bookmark.el	25 Sep 2007 10:43:39 -0000	1.98
>> +++ lisp/bookmark.el	25 Dec 2007 21:51:50 -0000
>> @@ -480,6 +482,22 @@
>>      (interactive-p)
>>      (setq bookmark-history (cons ,string bookmark-history))))
>>  
>> +(defvar bookmark-make-cell-function 'bookmark-make-cell-for-text-file
>> +  "A function that should be called to create the bookmark
>> +record.  Modes may set this variable buffer-locally to enable
>> +bookmarking of non-text files like images or pdf documents.
>> +
>> +The function will be called with two arguments: ANNOTATION and
>> +INFO-NODE.  See `bookmark-make-cell-for-text-file' for a
>> +description.
>> +
>> +The returned record may contain a special cons (handler
>> +. some-function) which sets the handler function that should be
>> +used to open this bookmark instead of `bookmark-jump-noselect'.
>> +It should return a cons (BUFFER . POINT) indicating buffer
>> +showing the bookmarked location and the value of point in that
>> +buffer.  Like `bookmark-jump-noselect' the buffer shouldn't be
>> +selected by the handler.")
>
> Okay, so "(BUFFER . POINT)" is now an exported interface, not just an
> internal interface that we would be free to change inside bookmark.el.
> Therefore, let's make it more extensible than a dotted pair.  The
> cleanest thing would probably be an association list:
>
>    '((buffer BUFFER) (point POINT))
>
> That way, callers will be compatible even if we extend the type later:
>
>    '((buffer BUFFER) (point POINT) ...)

Yes, that seems to be a good idea.  And since it's a trivial change to
adapt current callers, I don't see any reason not to do it.  (Drew, I
hope we can still be friends. ;-))

> And a comment regarding documentation:
>
> Normally, a function type's documentation should all be in one place,
> I think, not referring out to specific instances.  So normally, I
> would suggest replacing this...
>
>    The function will be called with two arguments: ANNOTATION and
>    INFO-NODE.  See `bookmark-make-cell-for-text-file' for a
>    description.
>
> ... with full documentation of the INFO-NODE argument.  But in this
> case, the better thing might be to implement
> `bookmark-make-cell-for-info-node' as a separate instance of
> `bookmark-make-cell-function', adjusting everything else in the
> obvious way.

Definitely.  I didn't want to document INFO-NODE, because it hardly
makes any sense for anything but bookmarks in info docs.  Basically the
yet to be done `bookmark-make-cell-for-info-node' can use
`b-m-c-f-text-file' and install only another handler
(bookmark-jump-info), so that `bookmark-jump-noselect' can be split into
`bookmark-jump-text' and `bookmark-jump-info'.  Then the INFO-NODE arg
could be dropped.

I'm not sure when I find some time to work on that.  Xmas was a good
excuse not to work on my diploma thesis, but I mustn't put it off any
longer.  So if sombody wants to do it, go for it.

Bye,
Tassilo

  parent reply	other threads:[~2007-12-27  9:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-25 10:54 doc-view support for bookmark.el Tassilo Horn
2007-12-25 11:43 ` Stefan Monnier
2007-12-25 14:42   ` Tassilo Horn
2007-12-25 17:32     ` Stefan Monnier
2007-12-25 19:00       ` Tassilo Horn
2007-12-25 22:00       ` Tassilo Horn
2007-12-25 22:05         ` Nick Roberts
2007-12-25 22:25           ` Tassilo Horn
2007-12-25 23:07         ` Stefan Monnier
2007-12-26  8:22           ` Tassilo Horn
2007-12-26 11:52             ` bookmark support for doc-view and image-mode (was: doc-view support for bookmark.el) Tassilo Horn
2007-12-26 18:53         ` doc-view support for bookmark.el Karl Fogel
2007-12-26 17:08           ` Drew Adams
2007-12-26 20:21             ` Karl Fogel
2007-12-27  9:21           ` Tassilo Horn [this message]
2007-12-27 15:34             ` Drew Adams
2007-12-28  9:10             ` Karl Fogel
2007-12-28 23:44           ` Kim F. Storm
2007-12-29  7:40             ` Karl Fogel
2007-12-29  7:43             ` Stefan Monnier
2007-12-30  0:34               ` Kim F. Storm
2008-01-02  2:18                 ` Stefan Monnier
2008-01-02  9:43                   ` Kim F. Storm
2008-01-02 20:22                     ` Stefan Monnier
2007-12-25 17:24 ` Drew Adams
2007-12-25 17:54 ` martin rudalics
2007-12-25 18:43   ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87abnwv6fn.fsf@member.fsf.org \
    --to=tassilo@member.fsf.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.