From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tokuya Kameshima Subject: Re: org-bookmark.el Date: Thu, 28 Feb 2008 23:20:59 +0900 Message-ID: References: <87ir0ajrol.fsf@bzg.ath.cx> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUjfF-0003kU-GP for emacs-orgmode@gnu.org; Thu, 28 Feb 2008 09:23:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUjfA-0003iW-3W for emacs-orgmode@gnu.org; Thu, 28 Feb 2008 09:23:12 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUjf9-0003iI-Pd for emacs-orgmode@gnu.org; Thu, 28 Feb 2008 09:23:07 -0500 Received: from mx53.ms.so-net.ne.jp ([202.238.83.3]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JUjf4-0002p9-3X for emacs-orgmode@gnu.org; Thu, 28 Feb 2008 09:23:07 -0500 In-Reply-To: <87ir0ajrol.fsf@bzg.ath.cx> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: kames@fa2.so-net.ne.jp Carstens and Bastien, Thank you for your comments and suggestions. I would appreciate if you add the code to the distribution. > On top of this, when `org-bookmark' is in use, storing a link while > visiting a file (or while in dired-mode) could first check if the file > at point is bookmarked: if it is, then `org-bookmark-store-link' would > be used; if it isn't, storing the file would fall back on the current > mechanism. It sounds nice. But it is possible for a single file to be bookmarked by two or more. I can not find a good way to select one from multiple bookmarks referring to the same file. Do you have any idea? At the end of this mail, I attached the revised elisp code. Only ";; This file is not part of GNU Emacs." line is updated. Thanks, --Tokuya On Wed, 27 Feb 2008 16:21:46 +0000, Bastien Guerry wrote: > > Tokuya Kameshima writes: > > > I wrote an emacs code, org-bookmark.el, which supports for orgmode > > links to Emacs bookmarks. You can store the links in the Bookmark > > List buffer by running M-x org-store-link. > > Great, thanks. > > > Not sure it's useful, but I regularly uses this bookmark links to > > follow daily or weekly changing file links. > > I guess it is useful for those who prefer to update their bookmarks > rather than to update their Org links directly. > > On top of this, when `org-bookmark' is in use, storing a link while > visiting a file (or while in dired-mode) could first check if the file > at point is bookmarked: if it is, then `org-bookmark-store-link' would > be used; if it isn't, storing the file would fall back on the current > mechanism. > > BTW, would you be okay to add this to the CONTRIB/ directory in the git > repository? Let me know, I can do it for you. > > > ;;; org-bookmark.el - Support for links to Emacs bookmark > > ;; Carstens outline-mode for keeping track of everything. > > ;; Copyright (C) 2008 Free Software Foundation, Inc. > > ;; > > ;; Author: Tokuya Kameshima > > ;; Version: 1.0 > > ;; Keywords: outlines, hypermedia, calendar, wp > > ;; > > ;; This file is part of GNU Emacs. > > This line should rather mention: > > "This file is not part of GNU Emacs." > > -- > Bastien ;;; org-bookmark.el - Support for links to Emacs bookmark ;; Carstens outline-mode for keeping track of everything. ;; Copyright (C) 2008 Free Software Foundation, Inc. ;; ;; Author: Tokuya Kameshima ;; Version: 1.0 ;; Keywords: outlines, hypermedia, calendar, wp ;; ;; This file is not part of GNU Emacs. ;; ;; Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'org) (require 'bookmark) (org-add-link-type "bookmark" 'org-bookmark-open) (add-hook 'org-store-link-functions 'org-bookmark-store-link) (defun org-bookmark-open (bookmark) "Visit the bookmark BOOKMARK." (bookmark-jump bookmark)) (defun org-bookmark-store-link () "Store a link to the current line's bookmark in Emacs bookmark list window." (if (eq major-mode 'bookmark-bmenu-mode) (let ((bookmark (bookmark-bmenu-bookmark))) (if bookmark (org-store-link-props :link (org-make-link "bookmark:" bookmark) :description bookmark))))) (provide 'org-bookmark) ;;; org-bookmark.el ends here