[Top][All Lists]

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

child guard cap against creating useless buffers with C-x b

From: Dan Jacobson
Subject: child guard cap against creating useless buffers with C-x b
Date: 07 Feb 2001 02:18:27 +0800
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

You know, I find myself 99% of the time accidentally creating buffers
with C-x b, like

 MR Buffer           Size  Mode         File
 -- ------           ----  ----         ----
    *sent news          0  Text         

because of hitting RET at an expansion bifurcation point,

    *sent news*      2307  Message      /home/jidanni/News/drafts/drafts/29
    *sent news on gnu.emacs.bug*  585 Message 

which I have complained about in an earlier message.

This got me thinking, though info mentions:
   Most buffers are created by visiting files, or by Emacs commands that
want to display some text, but you can also create a buffer explicitly
by typing `C-x b BUFNAME <RET>'.  This makes a new, empty buffer that
is not visiting any file, and selects it for editing.  Such buffers are
used for making notes to yourself.  If you try to save one, you are
asked for the file name to use.
[do also mention, in this same paragraph, that if you don't try to
save it, it will vanish when emacs does.  Yes I think it is mentioned

I however find that this 'create buffer if not exist' feature of
switch-to-buffer I only use 1% of the time, the rest of the time I'm
just creating those mistaken buffers.

Therefore I propose a _child guard cap_, a variable that would st
least cause switch-to-buffer to query if one really wanted to make one
of those 'notes to yourself' buffers.  I leave it up to the Emacs
board of directors to choose the default state of this new variable,
etc. but at least provide it.  States could be: "never ask -- just do"
[like now], "ask", and "always reject" [with message to use a
different command to explicitly create a notes-to-yourself buffer [C-u
C-x b is already taken[?]].

By the way, the current help
C-x b runs the command switch-to-buffer
   which is an interactive built-in function.

Select buffer BUFFER in the current window.
BUFFER may be a buffer or a buffer name.
Optional second arg NORECORD non-nil means
do not put this buffer at the front of the list of recently selected
needs a line "if BUFFER doesn't exist, it will be created." added
http://www.geocities.com/jidanni Tel886-4-25854780 e-mail:restore .com. 積丹尼

reply via email to

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