unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Whats the idiomatic way to erase a buffer?
@ 2019-12-10 14:08 Mario Lang
  2019-12-10 14:17 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Mario Lang @ 2019-12-10 14:08 UTC (permalink / raw)
  To: emacs-devel

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,
  ⡍⠁⠗⠊⠕



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-10 18:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-10 14:08 Whats the idiomatic way to erase a buffer? Mario Lang
2019-12-10 14:17 ` Stefan Monnier
2019-12-10 14:48   ` T.V Raman
2019-12-10 17:47   ` Mario Lang
2019-12-10 18:15     ` Mario Lang

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).