Closed akirak closed 2 years ago
Hi Akira,
AFAIK this is already supported, e.g.
https://github.com/alphapapa/org-bookmark-heading/blob/f7456ddfb869c6c4c1219239ad7ae0686db9fc94/org-bookmark-heading.el#L113 https://github.com/alphapapa/org-bookmark-heading/blob/f7456ddfb869c6c4c1219239ad7ae0686db9fc94/org-bookmark-heading.el#L203
If it doesn't work, it's a bug that needs to be fixed.
Thanks, I didn't notice that.
Actually, it doesn't work. I encounter the following error:
user-error: Before first headline at position 1 in buffer emacs.org
and it is caused because you can't concat
nil:
Yes, you can:
(concat "foo" nil)
;; => "foo"
(concat nil "foo")
;; => "foo"
That error is not caused by attempting to do that.
When does the error occur? Please provide the backtrace.
Okay, you are right. The culprit was the next line:
(org-get-outline-path 'with-self)
The function correctly returns nil when WITH-SELF
is nil:
(org-get-outline-path)
But not when WITH-SELF
is non-nil.
A correct solution would be to change the code as follows:
(when heading
(org-get-outline-path 'with-self))
Aside from the error, the functionality has existed, so I will close this issue.
Hello,
Even though the initial purpose of this package is to bookmark headings in Org files, I sometimes want to bookmark an entire Org file. For example, I write (or am trying to write) documentation in Org, and I want to bookmark the documentation files of projects I am working on. In this case, the default function for making a bookmark record should be used.
Could you add support for adding a fallback for bookmarking an entire file? The implementation should be as easy as follows (tweaking
org-bookmark-heading-make-record
), but I am not sure if this is true to your intended goal of this package: