From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: Add org-bookmark-heading to Org proper? Date: Sat, 24 Sep 2016 20:40:26 -0500 Message-ID: <87eg48vjsl.fsf@alphapapa.net> References: <8760podmwr.fsf@alphapapa.net> <87lgyjk9rb.fsf@nicolasgoaziou.fr> <87h997zeop.fsf@alphapapa.net> <87k2e2i6m9.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnyRG-0004qW-Sk for emacs-orgmode@gnu.org; Sat, 24 Sep 2016 21:41:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnyRC-0002R3-Na for emacs-orgmode@gnu.org; Sat, 24 Sep 2016 21:41:05 -0400 Received: from [195.159.176.226] (port=47803 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnyRC-0002Py-GD for emacs-orgmode@gnu.org; Sat, 24 Sep 2016 21:41:02 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bnyQk-00008K-9B for emacs-orgmode@gnu.org; Sun, 25 Sep 2016 03:40:34 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Nicolas Goaziou writes: Hi Nicolas, > I think controlling how the bookmark locations are displayed is > a different feature, which may fit better in Bookmark than in Org. I think I see what you mean, but at the same time, it seems like an Org-specific feature since it calls org-tree-to-indirect-buffer. I guess I think of Org as building on core Emacs features, so putting an Org-specific feature in core bookmark.el seems...backwards? (Though I'm not sure that's what you meant...) > We could introduce a generic hook somewhere so that to permit users > adding their own display mechanism. However, the variable is, IMO, too > specific. That hook idea sounds interesting, but I'm not sure I understand how it would be different than the built-in bookmark-handler feature. bookmark-handle-bookmark says that the handler it calls, "changes current buffer and point and returns nil, or signals a `file-error'," so that's what my org-bookmark-jump handler does, in an Org-specific way. The indirect-buffer feature could of course be removed from org-bookmark-jump, and a user could add it himself as advice that runs afterward. Or maybe something like an org-bookmark-jump-hook could be added to call other functions after jumping to an Org bookmark. I guess this is what you meant, I just had to talk myself through it. :) > On another topic, by looking at bookmark.el, it seems you shouldn't > create the internal representation of the bookmarks by hand, and use > setters instead (e.g., `bookmark-set-filename'). I went by the docstring for bookmark-make-record-function, which says that modes can set it buffer-locally for locations that should be treated specially, and that the function called should return a record according to bookmark-alist. I guess the setters are intended for modifying existing bookmarks...? Thanks for your feedback.