From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: doc-view support for bookmark.el Date: Thu, 27 Dec 2007 10:21:48 +0100 Message-ID: <87abnwv6fn.fsf@member.fsf.org> References: <8763yn3v07.fsf@member.fsf.org> <87prwu3kg0.fsf@member.fsf.org> <87prwu77ug.fsf@member.fsf.org> <87lk7hz3rg.fsf@red-bean.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1198747342 9750 80.91.229.12 (27 Dec 2007 09:22:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2007 09:22:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 27 10:22:36 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J7owl-0001wk-Ap for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2007 10:22:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J7owP-000387-EU for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2007 04:22:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J7ow7-00036G-9y for emacs-devel@gnu.org; Thu, 27 Dec 2007 04:21:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J7ow5-00035b-29 for emacs-devel@gnu.org; Thu, 27 Dec 2007 04:21:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J7ow4-00035J-7f for emacs-devel@gnu.org; Thu, 27 Dec 2007 04:21:52 -0500 Original-Received: from out4.smtp.messagingengine.com ([66.111.4.28]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J7ow3-0006dD-Sp for emacs-devel@gnu.org; Thu, 27 Dec 2007 04:21:52 -0500 Original-Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 5AA138287E for ; Thu, 27 Dec 2007 04:21:51 -0500 (EST) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 27 Dec 2007 04:21:51 -0500 X-Sasl-enc: JRI4x10wdcP2YDcXR609WVqyKSL8zlL+BLlGlF4nRtT6 1198747310 Original-Received: from baldur (dslb-084-063-037-075.pools.arcor-ip.net [84.63.37.75]) by mail.messagingengine.com (Postfix) with ESMTP id 80B4A24E5A for ; Thu, 27 Dec 2007 04:21:50 -0500 (EST) Mail-Followup-To: emacs-devel@gnu.org In-Reply-To: <87lk7hz3rg.fsf@red-bean.com> (Karl Fogel's message of "Wed, 26 Dec 2007 10:53:39 -0800") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:85502 Archived-At: Karl Fogel writes: Hi Karl, > I like your new bookmark abstractions, Tassilo! :-) > A few comments: > > Tassilo Horn 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