emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request: kill-buffer for org-capture-finalize


From: Ihor Radchenko
Subject: Re: Feature request: kill-buffer for org-capture-finalize
Date: Sun, 10 Sep 2023 08:19:25 +0000

Eduardo Suarez <esuarez@itccanarias.org> writes:

> I have tried something simple like
>
>  (defun my-org-capture-kill-buffer ()
>    (when (equal current-prefix-arg '(16))
>      (kill-buffer)))
>
> as an after-finalize hook. It seems to recognize the 'current-prefix-arg'
> variable.
>
> However,
>
> 1. it looks to me that org-capture-finalize jumps to the captured item if 
> there
> are any number greater than zero of preffix arguments,
>
> 2. the code above tries to kill the buffer I was working before invoking the
> capture process.
>
> Any hint?

  (defun my-org-capture-kill-buffer ()
    (when (equal current-prefix-arg '(16))
      (save-excursion
        (org-capture-goto-last-stored)
        (kill-buffer))))

-- 
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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]