emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: tumashu <tumashu@163.com>, emacs-org list <emacs-orgmode@gnu.org>,
	Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: [PATCH] org-capture: Add a custom to control save target file or not.
Date: Thu, 27 Sep 2018 09:33:13 -0400	[thread overview]
Message-ID: <CAFyQvY2TKQWGVExB0o50CgcissD3Y3HOsO5L=MS=gYdZPbeY6w@mail.gmail.com> (raw)
In-Reply-To: <875zyro5jz.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

On Thu, Sep 27, 2018 at 1:47 AM Eric S Fraga <esflists@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 <tumashu@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.

[-- Attachment #2: Type: text/html, Size: 2667 bytes --]

  reply	other threads:[~2018-09-27 13:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12  1:20 [PATCH] org-capture: Add a custom to control save target file or not tumashu
2018-04-12 13:22 ` Nicolas Goaziou
2018-04-13  2:10   ` tumashu
2018-04-14  7:44     ` Nicolas Goaziou
2018-04-14  9:42       ` tumashu
2018-04-16  1:06         ` tumashu
2018-04-16 10:11           ` Nicolas Goaziou
2018-09-26 17:11         ` Kaushal Modi
2018-09-26 17:29           ` Kaushal Modi
2018-09-26 18:11             ` Kaushal Modi
2018-09-27  5:47           ` Eric S Fraga
2018-09-27 13:33             ` Kaushal Modi [this message]
2018-09-28 12:28               ` Kaushal Modi
2018-09-28 20:50                 ` Nicolas Goaziou
2018-09-28 21:17                   ` Kaushal Modi
2018-09-29  6:31                     ` Nicolas Goaziou
2018-09-29 10:27                       ` Eric S Fraga
2018-09-29 10:35                         ` Van L
2018-12-13 15:08                           ` Kaushal Modi
2018-12-13 15:24                             ` Kaushal Modi
2018-12-13 15:33                               ` Kaushal Modi
2018-12-13 16:25                               ` Nicolas Goaziou
2018-12-13 19:12                                 ` Kaushal Modi
2018-04-26 23:34   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFyQvY2TKQWGVExB0o50CgcissD3Y3HOsO5L=MS=gYdZPbeY6w@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    --cc=tumashu@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).