From: "Michał Kondraciuk" <k.michal@zoho.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Question about memory usage
Date: Sat, 7 Apr 2018 15:15:08 +0200 [thread overview]
Message-ID: <b58e335a-5f71-595a-4bd4-853df8a0e950@zoho.com> (raw)
In-Reply-To: <jwva7uhjxk2.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 216 bytes --]
On 04/05/2018 08:54 PM, Stefan Monnier wrote:
> We could/should probably arrange to scan for dead buffers every time we
> add a new buffer to it, or from kill-buffer-hook.
Can you take a look at the attached patch?
[-- Attachment #2: remove-killed-buffer-from-changed-list.patch --]
[-- Type: text/x-patch, Size: 687 bytes --]
diff --git a/lisp/simple.el b/lisp/simple.el
index aad8d3b..23f7c4f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3014,6 +3014,13 @@ undo-auto--undoably-changed-buffers
`undo-auto--boundaries' and can be affected by changes to their
default values.")
+(defun undo-auto--remove-buffer-from-changed-list ()
+ "Remove current buffer from list of recently changed ones."
+ (setq undo-auto--undoably-changed-buffers
+ (delq (current-buffer) undo-auto--undoably-changed-buffers)))
+
+(add-hook 'kill-buffer-hook #'undo-auto--remove-buffer-from-changed-list)
+
(defun undo-auto--add-boundary ()
"Add an `undo-boundary' in appropriate buffers."
(undo-auto--boundaries
next prev parent reply other threads:[~2018-04-07 13:15 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 11:57 Question about memory usage Michał Kondraciuk
2018-04-03 2:16 ` Óscar Fuentes
2018-04-03 6:28 ` Eli Zaretskii
2018-04-03 12:28 ` Stefan Monnier
2018-04-03 12:40 ` Eli Zaretskii
2018-04-03 12:51 ` Eli Zaretskii
2018-04-03 13:13 ` Stefan Monnier
2018-04-03 14:03 ` Eli Zaretskii
2018-04-03 14:27 ` Stefan Monnier
2018-04-03 15:16 ` Eli Zaretskii
2018-04-03 21:14 ` Stefan Monnier
2018-04-03 17:57 ` Michał Kondraciuk
2018-04-03 18:22 ` Eli Zaretskii
2018-04-03 19:16 ` Michał Kondraciuk
2018-04-04 6:55 ` Eli Zaretskii
2018-04-05 18:06 ` Michał Kondraciuk
2018-04-05 18:40 ` Eli Zaretskii
2018-04-05 18:54 ` Stefan Monnier
2018-04-07 13:15 ` Michał Kondraciuk [this message]
2018-04-07 13:26 ` Eli Zaretskii
2018-04-07 15:22 ` Stefan Monnier
2018-04-07 18:39 ` Michał Kondraciuk
2018-04-03 21:18 ` Stefan Monnier
2018-04-04 6:08 ` Eli Zaretskii
2018-04-04 21:45 ` Stefan Monnier
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=b58e335a-5f71-595a-4bd4-853df8a0e950@zoho.com \
--to=k.michal@zoho.com \
--cc=help-gnu-emacs@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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.
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).