Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Org Capture duplicating %? string at the end of buffer #545

Open
rytswd opened this issue Feb 11, 2025 · 2 comments
Open

Org Capture duplicating %? string at the end of buffer #545

rytswd opened this issue Feb 11, 2025 · 2 comments

Comments

@rytswd
Copy link

rytswd commented Feb 11, 2025

First of all, thanks for the great work with Denote, I have been finding it intuitive and fun to make use of my notes!

I just wanted to report how I am seeing an odd behaviour where the %? cursor position identifier in Org Capture gets duplicated.

When using denote-use-template with %? as a part of the setup, like below:

(setq org-capture-templates
      '(("n" "New note" plain
        (file denote-last-path)
        #'(lambda ()
            (let ((denote-use-title (format-time-string "%b, %Y - Week %V"))
                  (denote-use-keywords '("goal"))
                  (denote-use-template "* Goals\n%?\n\n* Notes"))
              (denote-org-capture)))
        :no-save t
        :immediate-finish nil
        :kill-buffer t
        :jump-to-captured t)))

I get the cursor correctly positioned at where %? is. But I also get an extra %? at the bottom of the capture buffer.

Image

It is possible that I have some other Org Mode setup interfering with this, but could not find anything obvious from my end. Is this potentially an issue with the Org Capture support?

@protesilaos
Copy link
Owner

First of all, thanks for the great work with Denote, I have been finding it intuitive and fun to make use of my notes!

You are welcome!

It is possible that I have some other Org Mode setup interfering with this, but could not find anything obvious from my end.

I think what is happening here is that you wrote your own function to set up the captured contents, but left denote-org-capture-specifiers intact. Try to let bind this variable to nil or an empty string. Then it will not be appended to your note.

@rytswd
Copy link
Author

rytswd commented Feb 11, 2025

Ah great, thank you that did the trick! I think the documentation could do a bit more clarification when using denote-use-template with let binding, how we should have denote-org-capture-specifiers set to nil in that case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants