From: Mario Lang <mlang@delysid.org>
To: emacs-devel@gnu.org
Subject: Whats the idiomatic way to erase a buffer?
Date: Tue, 10 Dec 2019 15:08:30 +0100 [thread overview]
Message-ID: <87wob4jmsh.fsf@blind.guru> (raw)
Hi.
I am using:
(defun my-func (name)
(with-current-buffer (get-buffer-create name)
(let ((inhibit-read-only t))
(erase-buffer))
(my-special-mode)
...
(switch-to-buffer (current-buffer)))
my-special-mode uses widget-browse-mode as parent.
When I bury the buffer with 'q' and create the same
buffer, 'q' now complains:
Text is read-only: "Attempt to change text outside editable field"
So something else must be missing.
my-special-mode is supposed to run kill-all-local-variables, AFAICT.
Is there anything else I should do to ensure that the buffer
content is really forgotten about.
Or should I be using kill-buffer? Likely not, because it
would tinker with my window-configuration...
Help would be appreciated
--
CYa,
⡍⠁⠗⠊⠕
next reply other threads:[~2019-12-10 14:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 14:08 Mario Lang [this message]
2019-12-10 14:17 ` Whats the idiomatic way to erase a buffer? Stefan Monnier
2019-12-10 14:48 ` T.V Raman
2019-12-10 17:47 ` Mario Lang
2019-12-10 18:15 ` Mario Lang
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wob4jmsh.fsf@blind.guru \
--to=mlang@delysid.org \
--cc=emacs-devel@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.