Si je veux tout supprimer dans un tampon avec elisp, comment faire?
Si je veux tout supprimer dans un tampon avec elisp, comment faire?
Réponses:
As-tu essayé erase-buffer?
erase-buffer is an interactive built-in function in `C source code'.
(erase-buffer)
Delete the entire contents of the current buffer.
Any narrowing restriction in effect (see `narrow-to-region') is removed,
so the buffer is truly empty after this.
Comment trouver une telle fonction? M-x apropos buffer erase
kill-bufferc'est votre ami.
Vous pouvez utiliser de la setfmagie.
(setf (buffer-string) "")
Il y a aussi cette réponse :
C-x h + del la touche efface le tampon
Remarque: Cela nécessite transient-mark-moded'être activé (ce qui est par défaut).
erase-bufferappel.