* org-mode automatically sets bookmarks org-capture-last-stored etc. @ 2013-07-18 8:34 Oleh 2013-07-18 12:41 ` Oleh 2013-08-08 6:46 ` Carsten Dominik 0 siblings, 2 replies; 5+ messages in thread From: Oleh @ 2013-07-18 8:34 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 586 bytes --] Hi all, I'd like to point out that it's inconvenient for me that org stores the bookmarks "org-capture-last-stored", "org-refile-last-stored" and "org-capture-last-stored-marker" when I do capture/refile. I'd like an option to turn them off selectively. Also it would be nice to customize the default names of these bookmarks. For the moment, I've just disabled in the source the "org-capture-last-stored-marker" and renamed the others to "oc: org-capture-last-stored-marker" and "or: org-refile-last-stored". But messing with the source is not a permanent solution. regards, Oleh [-- Attachment #2: Type: text/html, Size: 893 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: org-mode automatically sets bookmarks org-capture-last-stored etc. 2013-07-18 8:34 org-mode automatically sets bookmarks org-capture-last-stored etc Oleh @ 2013-07-18 12:41 ` Oleh 2013-07-18 12:42 ` Oleh 2013-08-08 6:46 ` Carsten Dominik 1 sibling, 1 reply; 5+ messages in thread From: Oleh @ 2013-07-18 12:41 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 807 bytes --] Since there's no reaction, I'll just show my view of how it could be done. I attach the patch. regards, Oleh On Thu, Jul 18, 2013 at 10:34 AM, Oleh <ohwoeowho@gmail.com> wrote: > Hi all, > > I'd like to point out that it's inconvenient for me > that org stores the bookmarks "org-capture-last-stored", > "org-refile-last-stored" and "org-capture-last-stored-marker" when I do > capture/refile. > I'd like an option to turn them off selectively. > Also it would be nice to customize the default names of these bookmarks. > > For the moment, I've just disabled in the source the > "org-capture-last-stored-marker" > and renamed the others to "oc: org-capture-last-stored-marker" and "or: > org-refile-last-stored". > But messing with the source is not a permanent solution. > > > regards, > Oleh > > > > [-- Attachment #2: Type: text/html, Size: 1456 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: org-mode automatically sets bookmarks org-capture-last-stored etc. 2013-07-18 12:41 ` Oleh @ 2013-07-18 12:42 ` Oleh 0 siblings, 0 replies; 5+ messages in thread From: Oleh @ 2013-07-18 12:42 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1.1: Type: text/plain, Size: 913 bytes --] On Thu, Jul 18, 2013 at 2:41 PM, Oleh <ohwoeowho@gmail.com> wrote: > Since there's no reaction, I'll just show my view of how it could be done. > I attach the patch. > > regards, > Oleh > > > On Thu, Jul 18, 2013 at 10:34 AM, Oleh <ohwoeowho@gmail.com> wrote: > >> Hi all, >> >> I'd like to point out that it's inconvenient for me >> that org stores the bookmarks "org-capture-last-stored", >> "org-refile-last-stored" and "org-capture-last-stored-marker" when I do >> capture/refile. >> I'd like an option to turn them off selectively. >> Also it would be nice to customize the default names of these bookmarks. >> >> For the moment, I've just disabled in the source the >> "org-capture-last-stored-marker" >> and renamed the others to "oc: org-capture-last-stored-marker" and "or: >> org-refile-last-stored". >> But messing with the source is not a permanent solution. >> >> >> regards, >> Oleh >> >> >> >> > [-- Attachment #1.2: Type: text/html, Size: 1873 bytes --] [-- Attachment #2: 0001-org.el-added-org-bookmark-names-plist.patch --] [-- Type: application/octet-stream, Size: 3009 bytes --] From 1a5a0e612474e0881d9bd5a6f9f392819b4c9e28 Mon Sep 17 00:00:00 2001 From: oleh <wave@mail.ua> Date: Thu, 18 Jul 2013 14:37:59 +0200 Subject: [PATCH] org.el: added `org-bookmark-names-plist'. Whenever org calls `bookmark-set', it should get the bookmark name from `org-bookmark-names-plist'. When it's not there, don't call `bookmark-set'. --- lisp/org-capture.el | 6 ++++-- lisp/org.el | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index a4f0fd0..a81d14e 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1267,8 +1267,10 @@ Of course, if exact position has been required, just put it there." (save-restriction (widen) (goto-char pos) - (with-demoted-errors - (bookmark-set "org-capture-last-stored")) + (let ((bookmark-name (plist-get org-bookmark-names-plist :last-capture))) + (when bookmark-name + (with-demoted-errors + (bookmark-set bookmark-name)))) (move-marker org-capture-last-stored-marker (point))))))) (defun org-capture-narrow (beg end) diff --git a/lisp/org.el b/lisp/org.el index fb5099e..1957e63 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -63,6 +63,9 @@ ;;; Code: (defvar org-inhibit-highlight-removal nil) ; dynamically scoped param +(defvar org-bookmark-names-plist + '(:last-capture "org-capture-last-stored" :last-refile "org-refile-last-stored" :last-capture-marker "org-capture-last-stored-marker")) + (defvar org-table-formula-constants-local nil "Local version of `org-table-formula-constants'.") (make-variable-buffer-local 'org-table-formula-constants-local) @@ -4837,7 +4840,7 @@ Support for group tags is controlled by the option ;; Process the tags. (when (and (not tags) org-tag-alist) (setq tags - (mapcar + (mapcar (lambda (tg) (cond ((eq (car tg) :startgroup) "{") ((eq (car tg) :endgroup) "}") ((eq (car tg) :grouptags) ":") @@ -11623,13 +11626,17 @@ prefix argument (`C-u C-u C-u C-c C-w')." (and org-auto-align-tags (let ((org-loop-over-headlines-in-active-region nil)) (org-set-tags nil t))) - (with-demoted-errors - (bookmark-set "org-refile-last-stored")) + (let ((bookmark-name (plist-get org-bookmark-names-plist :last-refile))) + (when bookmark-name + (with-demoted-errors + (bookmark-set bookmark-name)))) ;; If we are refiling for capture, make sure that the ;; last-capture pointers point here (when (org-bound-and-true-p org-refile-for-capture) - (with-demoted-errors - (bookmark-set "org-capture-last-stored-marker")) + (let ((bookmark-name (plist-get org-bookmark-names-plist :last-capture-marker))) + (when bookmark-name + (with-demoted-errors + (bookmark-set bookmark-name)))) (move-marker org-capture-last-stored-marker (point))) (if (fboundp 'deactivate-mark) (deactivate-mark)) (run-hooks 'org-after-refile-insert-hook)))) -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: org-mode automatically sets bookmarks org-capture-last-stored etc. 2013-07-18 8:34 org-mode automatically sets bookmarks org-capture-last-stored etc Oleh 2013-07-18 12:41 ` Oleh @ 2013-08-08 6:46 ` Carsten Dominik 2013-08-08 10:44 ` Carsten Dominik 1 sibling, 1 reply; 5+ messages in thread From: Carsten Dominik @ 2013-08-08 6:46 UTC (permalink / raw) To: Oleh; +Cc: emacs-orgmode On 18.7.2013, at 10:34, Oleh <ohwoeowho@gmail.com> wrote: > Hi all, > > I'd like to point out that it's inconvenient for me > that org stores the bookmarks "org-capture-last-stored", "org-refile-last-stored" and "org-capture-last-stored-marker" when I do capture/refile. Hi Oleh, can you explain why you find this inconvenient? - Carsten > I'd like an option to turn them off selectively. > Also it would be nice to customize the default names of these bookmarks. > > For the moment, I've just disabled in the source the "org-capture-last-stored-marker" > and renamed the others to "oc: org-capture-last-stored-marker" and "or: org-refile-last-stored". > But messing with the source is not a permanent solution. > > > regards, > Oleh > > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: org-mode automatically sets bookmarks org-capture-last-stored etc. 2013-08-08 6:46 ` Carsten Dominik @ 2013-08-08 10:44 ` Carsten Dominik 0 siblings, 0 replies; 5+ messages in thread From: Carsten Dominik @ 2013-08-08 10:44 UTC (permalink / raw) To: Oleh; +Cc: emacs-orgmode On 8.8.2013, at 08:46, Carsten Dominik <carsten.dominik@gmail.com> wrote: > > On 18.7.2013, at 10:34, Oleh <ohwoeowho@gmail.com> wrote: > >> Hi all, >> >> I'd like to point out that it's inconvenient for me >> that org stores the bookmarks "org-capture-last-stored", "org-refile-last-stored" and "org-capture-last-stored-marker" when I do capture/refile. > > Hi Oleh, > > can you explain why you find this inconvenient? After taking another look, I have installed a modified version of this patch. Thanks! - Carsten > > - Carsten > >> I'd like an option to turn them off selectively. >> Also it would be nice to customize the default names of these bookmarks. >> >> For the moment, I've just disabled in the source the "org-capture-last-stored-marker" >> and renamed the others to "oc: org-capture-last-stored-marker" and "or: org-refile-last-stored". >> But messing with the source is not a permanent solution. >> >> >> regards, >> Oleh >> >> >> > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-08-08 10:44 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-07-18 8:34 org-mode automatically sets bookmarks org-capture-last-stored etc Oleh 2013-07-18 12:41 ` Oleh 2013-07-18 12:42 ` Oleh 2013-08-08 6:46 ` Carsten Dominik 2013-08-08 10:44 ` Carsten Dominik
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.