* Question regarding org-capture-bookmark and org-bookmark-names-plist
@ 2024-02-07 20:07 Tim Wichmann
2024-02-08 13:29 ` Ihor Radchenko
0 siblings, 1 reply; 5+ messages in thread
From: Tim Wichmann @ 2024-02-07 20:07 UTC (permalink / raw)
To: emacs-orgmode
Hi all,
during last OrgMeetup, I proposed a new user option
`org-refile-bookmark', similar to the already existing option
`org-capture-bookmark'. Setting this new option to nil, `org-refile’
would not create a bookmark when refiling. (Use case: I am using
alphapapa's org-bookmark-heading package and want to prevent that each
captured/refiled entry gets an id.)
I was just about to send the corresponding feature request when I
stumbled across the documentation of `org-bookmark-names-plist'. It
states: „When a key does not show up in the property list, the
corresponding bookmark is not set.“
So, there is no need for a new user option: I simply have to remove the
:last-refile key from the plist, and no bookmark will be created on
refiling.
My question: Is this the intended way to suppress bookmark creation? If
so: Why is there the extra user option `org-capture-bookmark'? Isn't it
superfluous, as the same behavior can be achieved by removing the
:last-capture keyword from the plist? (Note, moreover, that currently
the :last-capture-marker bookmark is created even in case
`org-capture-bookmark' is set to nil, see `org-refile'.)
Best regards,
Tim.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Question regarding org-capture-bookmark and org-bookmark-names-plist
2024-02-07 20:07 Question regarding org-capture-bookmark and org-bookmark-names-plist Tim Wichmann
@ 2024-02-08 13:29 ` Ihor Radchenko
2024-02-08 18:09 ` Tim Wichmann
2024-02-08 20:58 ` Tim Wichmann
0 siblings, 2 replies; 5+ messages in thread
From: Ihor Radchenko @ 2024-02-08 13:29 UTC (permalink / raw)
To: Tim Wichmann; +Cc: emacs-orgmode
Tim Wichmann <schwurg@arcor.de> writes:
> during last OrgMeetup, I proposed a new user option
> `org-refile-bookmark', similar to the already existing option
> `org-capture-bookmark'. Setting this new option to nil, `org-refile’
> would not create a bookmark when refiling. (Use case: I am using
> alphapapa's org-bookmark-heading package and want to prevent that each
> captured/refiled entry gets an id.)
>
> I was just about to send the corresponding feature request when I
> stumbled across the documentation of `org-bookmark-names-plist'. It
> states: „When a key does not show up in the property list, the
> corresponding bookmark is not set.“
>
> So, there is no need for a new user option: I simply have to remove the
> :last-refile key from the plist, and no bookmark will be created on
> refiling.
You are right.
> My question: Is this the intended way to suppress bookmark creation?
I think so.
> ... If so: Why is there the extra user option `org-capture-bookmark'?
> Isn't it superfluous, as the same behavior can be achieved by removing
> the :last-capture keyword from the plist?
We first introduced `org-capture-bookmark' and only then added
`org-bookmark-names-plist'. Maybe we should obsolete
`org-capture-bookmark' to avoid confusion.
> ...(Note, moreover, that currently
> the :last-capture-marker bookmark is created even in case
> `org-capture-bookmark' is set to nil, see `org-refile'.)
May you elaborate? Are you sure that it is still the case on the latest main?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Question regarding org-capture-bookmark and org-bookmark-names-plist
2024-02-08 13:29 ` Ihor Radchenko
@ 2024-02-08 18:09 ` Tim Wichmann
2024-02-08 20:58 ` Tim Wichmann
1 sibling, 0 replies; 5+ messages in thread
From: Tim Wichmann @ 2024-02-08 18:09 UTC (permalink / raw)
To: emacs-orgmode
Dear Ihor,
Ihor Radchenko <yantar92@posteo.net> writes:
>> My question: Is this the intended way to suppress bookmark creation?
>
> I think so.
Great!
> We first introduced `org-capture-bookmark' and only then added
> `org-bookmark-names-plist'. Maybe we should obsolete
> `org-capture-bookmark' to avoid confusion.
Thanks for the clarification. Obsoleting `org-capture-bookmark' sounds
good, as the variable does not add new functionality which can not be
achieved with `org-bookmark-names-plist' already.
>> ...(Note, moreover, that currently
>> the :last-capture-marker bookmark is created even in case
>> `org-capture-bookmark' is set to nil, see `org-refile'.)
>
> May you elaborate? Are you sure that it is still the case on the latest main?
I double checked in newest version of defun `org-refile' in main branch:
The bookmark for :last-capture-marker is set independently of the value
of `org-capture-bookmark'. The corresponding code looks like this:
---[snip: org-refile.el, line 608 ff.]---
(when (bound-and-true-p org-capture-is-refiling)
(let ((bookmark-name (plist-get org-bookmark-names-plist
:last-capture-marker)))
(when bookmark-name
(condition-case err
(bookmark-set bookmark-name)
---[end snip]---
I would have expected that this bookmark is not set in case
`org-capture-bookmark' is set to nil, something like this:
---[snip]---
(when (bound-and-true-p org-capture-is-refiling)
(when org-capture-bookmark
(let ((bookmark-name (plist-get org-bookmark-names-plist
[...]
---[end snip]---
But, when obsoleting `org-capture-bookmark', this problem is solved
anyhow: Bookmark creation can be fully controlled using the plist
variable (and only there).
So, I vote for obsoleting `org-capture-bookmark'.
Thanks again for your help!
Best regards,
Tim.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Question regarding org-capture-bookmark and org-bookmark-names-plist
2024-02-08 13:29 ` Ihor Radchenko
2024-02-08 18:09 ` Tim Wichmann
@ 2024-02-08 20:58 ` Tim Wichmann
2024-02-09 16:50 ` Ihor Radchenko
1 sibling, 1 reply; 5+ messages in thread
From: Tim Wichmann @ 2024-02-08 20:58 UTC (permalink / raw)
To: emacs-orgmode
Dear Ihor,
Ihor Radchenko <yantar92@posteo.net> writes:
>> My question: Is this the intended way to suppress bookmark creation?
>
> I think so.
Great!
> We first introduced `org-capture-bookmark' and only then added
> `org-bookmark-names-plist'. Maybe we should obsolete
> `org-capture-bookmark' to avoid confusion.
Thanks for the clarification. Obsoleting `org-capture-bookmark' sounds
good, as the variable does not add new functionality which can not be
achieved with `org-bookmark-names-plist' already.
>> ...(Note, moreover, that currently
>> the :last-capture-marker bookmark is created even in case
>> `org-capture-bookmark' is set to nil, see `org-refile'.)
>
> May you elaborate? Are you sure that it is still the case on the latest main?
I double checked in newest version of defun `org-refile' in main branch:
The bookmark for :last-capture-marker is set independently of the value
of `org-capture-bookmark'. The corresponding code looks like this:
---[snip: org-refile.el, line 608 ff.]---
(when (bound-and-true-p org-capture-is-refiling)
(let ((bookmark-name (plist-get org-bookmark-names-plist
:last-capture-marker)))
(when bookmark-name
(condition-case err
(bookmark-set bookmark-name)
---[end snip]---
I would have expected that this bookmark is not set in case
`org-capture-bookmark' is set to nil, something like this:
---[snip]---
(when (bound-and-true-p org-capture-is-refiling)
(when org-capture-bookmark
(let ((bookmark-name (plist-get org-bookmark-names-plist
[...]
---[end snip]---
But, when obsoleting `org-capture-bookmark', this problem is solved
anyhow: Bookmark creation can be fully controlled using the plist
variable (and only there).
So, I vote for obsoleting `org-capture-bookmark'.
Thanks again for your help!
Best regards,
Tim.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Question regarding org-capture-bookmark and org-bookmark-names-plist
2024-02-08 20:58 ` Tim Wichmann
@ 2024-02-09 16:50 ` Ihor Radchenko
0 siblings, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2024-02-09 16:50 UTC (permalink / raw)
To: Tim Wichmann; +Cc: emacs-orgmode
Tim Wichmann <schwurg@arcor.de> writes:
> But, when obsoleting `org-capture-bookmark', this problem is solved
> anyhow: Bookmark creation can be fully controlled using the plist
> variable (and only there).
>
> So, I vote for obsoleting `org-capture-bookmark'.
Done.
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=aa3724dbd
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-12 15:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 20:07 Question regarding org-capture-bookmark and org-bookmark-names-plist Tim Wichmann
2024-02-08 13:29 ` Ihor Radchenko
2024-02-08 18:09 ` Tim Wichmann
2024-02-08 20:58 ` Tim Wichmann
2024-02-09 16:50 ` Ihor Radchenko
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.