From: Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>
To: 45811@debbugs.gnu.org
Subject: bug#45811: 28.0.50; [PATCH] Respect remember-save-after-remembering on remember-diary-extract-entries
Date: Tue, 12 Jan 2021 01:21:50 -0300 [thread overview]
Message-ID: <CH2PR01MB5879940A5C828AD61D4AA65A8BAA0@CH2PR01MB5879.prod.exchangelabs.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 666 bytes --]
On remember.el, when option 'remember-handler-functions' contains
handler 'remember-diary-extract-entries', entries will be appended to
Diary file. However, the Diary file will not be saved automatically. I
could not find any documentation describing if this behavior is
expected, and the docstring for 'remember-save-after-remembering' does
not mention how the Diary file should be handled in this case. Given
that, there is a patch attached to automatically save the Diary file
when option 'remember-save-after-remembering' is 't'. If this is the
wrong behavior, we could improve the improve the docstring or show the
Diary buffer to user after data is appended.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Respect-remember-save-after-remembering-on-remember-.patch --]
[-- Type: text/x-diff, Size: 1058 bytes --]
From aa305cc45029387cba0de9ee00a4b58e1b022104 Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel.nascimento@nubank.com.br>
Date: Tue, 12 Jan 2021 01:11:26 -0300
Subject: [PATCH] Respect remember-save-after-remembering on
remember-diary-extract-entries
---
lisp/textmodes/remember.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index 98d3a3856e..911523fb47 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -542,7 +542,10 @@ remember-diary-extract-entries
(push (remember-diary-convert-entry (match-string 1)) list))
(when list
(diary-make-entry (mapconcat 'identity list "\n")
- nil remember-diary-file))
+ nil remember-diary-file)
+ (when remember-save-after-remembering
+ (with-current-buffer (find-buffer-visiting diary-file)
+ (save-buffer))))
nil))) ;; Continue processing
;;; Internal Functions:
--
2.27.0
next reply other threads:[~2021-01-12 4:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 4:21 Gabriel do Nascimento Ribeiro [this message]
2021-01-12 14:26 ` bug#45811: 28.0.50; [PATCH] Respect remember-save-after-remembering on remember-diary-extract-entries Lars Ingebrigtsen
2021-01-12 19:05 ` Gabriel do Nascimento Ribeiro
2021-01-12 19:26 ` Lars Ingebrigtsen
2021-01-20 0:12 ` Gabriel do Nascimento Ribeiro
2021-01-20 16:54 ` Lars Ingebrigtsen
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CH2PR01MB5879940A5C828AD61D4AA65A8BAA0@CH2PR01MB5879.prod.exchangelabs.com \
--to=gabriel376@hotmail.com \
--cc=45811@debbugs.gnu.org \
/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.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).