emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Whats the idiomatic way to erase a buffer?


From: Mario Lang
Subject: Whats the idiomatic way to erase a buffer?
Date: Tue, 10 Dec 2019 15:08:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]