On Thu, Sep 27, 2018 at 1:47 AM Eric S Fraga <esfli...@gmail.com> wrote:

> On Wednesday, 26 Sep 2018 at 13:11, Kaushal Modi wrote:
> > I had been wondering for quite some time (about since 5 months :P) why
> > my Org captures have stopped auto-saving.
>
> This has been really annoying me for some time.  Thanks for the code
> you've posted which I will try out.  I use at least 2 instances of Emacs, 1
> for gnus which often leads to capturing notes and tasks and the others for
> writing etc.  Not having an automatic save can lead to problems.
>

I'd suggest reverting that commit.

Removing save-buffer from org-capture-finalize, makes the whole concept of
Org Capture very unsafe (i.e. no guarantee that the captured date will be
saved - unless the finalize hooks workaround is used). It feels like a bit
more extra work is needed to make org capture do the "right thing". If the
hooks are not configured, then there's a mental overhead of having to save
all the capture target buffers manually.

@tumashu <tuma...@163.com> You can easily avoid saving of the capture
target buffers on your phone by adding this to the emacs config just on
your phone:

(defun advice/dont-save-during-org-capture (orig-fun &rest args)
  "Make `save-buffer' do nothing during `org-capture-finalize'."
  (cl-letf (((symbol-function #'save-buffer)
             (lambda ()
               (message "Skipping `save-buffer' in `org-capture-finalize'")
               nil)))
    (apply orig-fun args)))
(advice-add 'org-capture-finalize :around
#'advice/dont-save-during-org-capture)

Above just makes save-buffer to do nothing, but *only* in
org-capture-finalize.

Summary:

- Proposal to revert
https://code.orgmode.org/bzg/org-mode/commit/b4422add3745c26ec3b2e11b8da425844b2e9d3d
- Use the above advice if you don't want to save buffer during org-capture.

Reply via email to