From: Xah Lee <xah@xahlee.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to get rid of *GNU Emacs* buffer on start-up?
Date: Wed, 24 Sep 2008 03:02:30 -0700 (PDT) [thread overview]
Message-ID: <095ef0c0-c7f4-494d-8bf6-8a5ee43fd934@i20g2000prf.googlegroups.com> (raw)
In-Reply-To: mailman.19802.1222242899.18990.help-gnu-emacs@gnu.org
On Sep 24, 12:54 am, Kevin Rodgers <kevin.d.rodg...@gmail.com>
> Here's my attempt at critical thinking:
>
> 1. You said that find-file and switch-to-buffer each have problems, so I
> wrote a new command that has neither problem. That is called a
> solution.
Yes.
> 2. You said that neither function is designed for creating a new
> temporary buffer. That is true of find-file, which can create a new
> buffer, but a buffer whose contents are to be persisted i.e. not
> temporary. I think switch-to-buffer _is_ designed for creating a new
> temporary buffer, just a buffer that has a user-specified name.
this i don't agree. Quote from my article:
«
* There is no easy, intuitive way to create multiple scratch
buffers. (it is done by using the switch-to-buffer command (C-x b) and
give name that is not one of existing buffers.)
* When the scratch buffer is closed, emacs does not prompt user to
save it. This easily causes data loss.
* A scratch pad can be very useful not just for temporary elisp
code but for any scratch notes or programing in other languages. (For
example, well known programer Stevey Yegg in his popular Effective
Emacs↗ blog list it as a top 10 tip in emacs productivity.) Emacs's
“*scratch*” buffer is narrowly geared for elisp editing only,
defaulting to emacs-lisp-mode.
* Emacs does not provide a user level function to create a new
buffer. It has menu “File‣Open file...” (a wrapper to the find-file
command), which immediately prompt user for a full file path. This is
annoying. Modern apps's New File command actually just create a new
untitled file without prompting, and only when user save it it prompt
a file name. If user closes it, it prompts for saving.
»
More specifically, in different wording now: the problem with switch-
to-buffer for creating new buffer is that it is simply not designed
for it. It is only a side effect. (similar to, say, the unix “touch”
command is used to create new file, and unix “mv” command is used for
renaming, and in unix the boulean operators for “and” (&&) and
“or” (||) are used for program flow... and quite a lot such quirks in
various langs.) Sure, it you can use a hammer as a weapon and various
things but not the right design for something is a problem. More
specifically:
• switch-to-buffer the name does not convey it's use as a create-new-
buffer.
• By using it for the purpose of creating new buffer and as well as
switching buffer, it has multiple purposes. Thes 2 purpsose are
semantically distinct and in practice doesn't mix.
• when user uses switch-to-buffer for creating new buffer, it again,
just like find-file, promp user to type a name. Also, user needs to
give a name not one of existing buffers. The problem with trivial
prompting is well know is UI, especiall its problems can be seen in
Microsoft Windows OS, where every minute it prompts users for this or
that which is quite annoying. A better way, to let user decided to
name something when user needs to.
> 3. You contradict yourself to some degree by complaining that
> temporary buffers can be killed without prompting the user about
> whether and under what name to save them. I think it would be clearer
> if you said "empty" buffer instead of "temporary".
I'm not sure i understood exactly what u mean.
What i meant in my article or post was that, emacs won't offer save
for buffers not associated with a file. This is so for buffers created
using the switch-to-buffer command.
> I prefer progress to modernization.
The “modernization” is just a descriptive tag. Am not sure exactly
what you mean. Modernization is simply a collective term for emacs
improvements that happens to make emacs more compatible with modern
terminologies, UI sandards. Many tech geekers will perhaps think
“modernization” means “let's make emacs like Microsoft”. No. It is not
the intention nor the goal. (Of interest to note, that it is EXACTLY
Linux's KDE's prominently published manifesto, for example, when it
starts in about 1998.)
For example, if i think modernization of emacs means making it behave
like Microsoft apps, then i would have suggest using popup dialogs and
get rid of scratch buffer, using XML instead of elisp for user prefs,
using standard menu instead of the emacs's ones, get rid of dired, use
standard Microsoft help app and format instead of C-h and info,
possibly incorporate pop langs such as VisualBasic and replace elisp.
The modernization i proposed, is intended to make emacs more
efficient, powerful, and get rid of its primary criticism of usability
problem. I believe, my propose solve the problem well, is quite
conservative, is simple to implement, having no major change to emacs
ways and consistency. ( Please give it a thought: http://xahlee.org/emacs/modernization.html
)
---------------------------------------------------
Your solution based on switch-to-buffer:
> (defun switch-to-new-buffer ()
> "Switch to a new *scratch* buffer."
> (interactive)
> (switch-to-buffer (generate-new-buffer "*scratch*"))
> (setq buffer-offer-save t))
>
> You might like (auto-save-mode 1) in there as well.
A new buffer is not a existing buffer, so the switch in the name is
unfit. Also, since the function's purpose is creating a new *scratch*,
you should have that in the name to reflect the fact.
So, given your code, one step of improvement is to change the name to
new-scratch-buffer or create-scratch-buffer.
But, as i detailed, since scratch is simply a new buffer, and since
now you can create multiple scratches, it ceases to be one special
buffer emacs called *scratch*. So, this comes back to my original
suggestion, that it might simply be better to just have create-new-
buffer. And, if you agree this far, then since you now have a
mechanism to create new buffers proper, and the few emacs developers
agree that *scratch* has problems albeit minor one, we might simply at
this point get rid of the *scratch* because create-new-buffer
completely covers its functionality.
This is exactly what is proposed in my article, alone with code.
See
http://xahlee.org/emacs/modernization_scratch_buffer.html
PS thanks for the (setq buffer-offer-save t) in your code. It is a
solution to my kludge in my create-new-buffer code about forcing emacs
to offer save.
Xah
∑ http://xahlee.org/
☄
next prev parent reply other threads:[~2008-09-24 10:02 UTC|newest]
Thread overview: 163+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-16 5:28 How to get rid of *GNU Emacs* buffer on start-up? Davin Pearson
2008-09-16 7:39 ` Giorgos Keramidas
2008-09-16 8:47 ` Davin Pearson
2008-09-16 8:14 ` Adam Rooke
2008-09-16 8:44 ` Nikolaj Schumacher
2008-09-16 8:44 ` Charles Sebold
2008-09-16 20:57 ` Xah
2008-09-17 1:22 ` Giorgos Keramidas
2008-09-18 5:35 ` Xah Lee
2008-09-18 5:41 ` Xah Lee
2008-09-19 0:39 ` tyler
[not found] ` <mailman.19510.1221784782.18990.help-gnu-emacs@gnu.org>
2008-09-19 4:16 ` David Kastrup
2008-09-19 12:42 ` tyler
2008-09-20 1:53 ` Allan Gottlieb
2008-09-29 19:20 ` tyler
2008-10-01 10:26 ` Tassilo Horn
[not found] ` <mailman.19545.1221828161.18990.help-gnu-emacs@gnu.org>
2008-09-19 21:09 ` David Kastrup
2008-09-19 4:49 ` Xah Lee
2008-09-18 23:50 ` Xah Lee
2008-09-19 8:53 ` Eli Zaretskii
[not found] ` <mailman.19536.1221814453.18990.help-gnu-emacs@gnu.org>
2008-09-19 11:34 ` Xah Lee
2008-09-19 13:04 ` Cor Gest
2008-09-19 14:21 ` Xah Lee
2008-09-19 15:32 ` Eric S Fraga
2008-09-20 0:54 ` Xah Lee
2008-09-22 8:25 ` Eric S Fraga
2008-09-22 11:40 ` Xah Lee
2008-09-22 12:16 ` Lennart Borgman (gmail)
[not found] ` <mailman.19683.1222085805.18990.help-gnu-emacs@gnu.org>
2008-09-22 13:53 ` Xah Lee
2008-09-22 14:50 ` Lennart Borgman (gmail)
[not found] ` <mailman.19689.1222095038.18990.help-gnu-emacs@gnu.org>
2008-09-23 13:49 ` Xah Lee
2008-09-23 15:47 ` Lennart Borgman (gmail)
[not found] ` <mailman.19771.1222184864.18990.help-gnu-emacs@gnu.org>
2008-09-23 16:27 ` Xah Lee
2008-09-23 16:47 ` Lennart Borgman (gmail)
[not found] ` <mailman.19774.1222188466.18990.help-gnu-emacs@gnu.org>
2008-09-23 16:59 ` Xah Lee
2008-09-23 17:43 ` Lennart Borgman (gmail)
2008-09-22 18:25 ` Eric S Fraga
2008-09-23 8:16 ` Xah Lee
2008-09-23 13:02 ` Eric S Fraga
2008-09-23 15:20 ` Xah Lee
2008-09-23 18:55 ` Michael Ekstrand
2008-09-24 1:59 ` Xah Lee
2008-09-24 8:31 ` Eric S Fraga
2008-09-24 10:12 ` Giorgos Keramidas
2008-09-24 11:46 ` Alexey Pustyntsev
[not found] ` <mailman.19815.1222259480.18990.help-gnu-emacs@gnu.org>
2008-09-24 12:52 ` Andreas Politz
2008-09-24 13:30 ` Xah Lee
2008-09-24 9:28 ` Nikolaj Schumacher
[not found] ` <mailman.19809.1222248534.18990.help-gnu-emacs@gnu.org>
2008-09-24 14:38 ` Xah Lee
2008-09-24 17:15 ` Nikolaj Schumacher
[not found] ` <mailman.19834.1222276553.18990.help-gnu-emacs@gnu.org>
2008-09-25 3:16 ` Xah
2008-09-23 20:34 ` Nikolaj Schumacher
2008-09-23 21:16 ` harven
2008-09-24 1:35 ` Xah Lee
2008-09-19 16:13 ` Nikolaj Schumacher
[not found] ` <mailman.19563.1221840835.18990.help-gnu-emacs@gnu.org>
2008-09-20 0:02 ` Xah Lee
2008-09-20 1:12 ` Chetan
2008-09-20 2:35 ` Kevin Rodgers
2008-09-24 7:35 ` Kevin Rodgers
[not found] ` <mailman.19800.1222241766.18990.help-gnu-emacs@gnu.org>
2008-09-24 9:26 ` Xah Lee
2008-09-26 4:52 ` Kevin Rodgers
[not found] ` <mailman.19977.1222404766.18990.help-gnu-emacs@gnu.org>
2008-09-26 12:39 ` Xah
[not found] ` <mailman.19592.1221878128.18990.help-gnu-emacs@gnu.org>
2008-09-20 2:58 ` Xah Lee
2008-09-24 7:54 ` Kevin Rodgers
[not found] ` <mailman.19802.1222242899.18990.help-gnu-emacs@gnu.org>
2008-09-24 10:02 ` Xah Lee [this message]
2008-09-24 11:42 ` Xah Lee
2008-09-24 12:51 ` rustom
2008-09-24 13:33 ` Bug? buffer-offer-save Xah Lee
2008-09-24 14:31 ` Juanma Barranquero
2008-09-24 14:33 ` Juanma Barranquero
2008-09-26 5:40 ` How to get rid of *GNU Emacs* buffer on start-up? Kevin Rodgers
[not found] ` <mailman.19978.1222407641.18990.help-gnu-emacs@gnu.org>
2008-09-26 13:28 ` Xah
2008-09-26 21:45 ` Alan Mackenzie
2008-09-27 2:20 ` Kevin Rodgers
[not found] ` <mailman.20040.1222465122.18990.help-gnu-emacs@gnu.org>
2008-09-27 0:15 ` Chetan
2008-09-27 7:57 ` Andreas Politz
2008-09-27 14:17 ` Xah
2008-09-27 12:42 ` Chetan
2008-09-27 16:19 ` Xah
2008-09-27 17:28 ` Sean Sieger
2008-09-27 18:12 ` B. T. Raven
2008-09-27 22:48 ` Chetan
2008-09-28 3:43 ` Xah
[not found] ` <mailman.20073.1222536552.18990.help-gnu-emacs@gnu.org>
2008-09-28 2:46 ` Xah
[not found] ` <mailman.20050.1222482050.18990.help-gnu-emacs@gnu.org>
2008-09-27 14:27 ` Xah
2008-09-28 16:18 ` stan
2008-09-28 17:11 ` Richard Riley
2008-09-29 2:34 ` stan
2008-09-29 2:58 ` Richard Riley
2008-09-29 15:39 ` Cor Gest
2008-09-29 16:03 ` Richard Riley
2008-09-29 16:37 ` Cor Gest
2008-09-29 17:50 ` Richard Riley
2008-10-15 16:01 ` buffers and files and plus ca la change and all that OtherMichael
2008-10-01 1:37 ` How to get rid of *GNU Emacs* buffer on start-up? stan
2008-10-01 11:44 ` rustom
2008-10-01 19:58 ` Sean Sieger
2008-10-01 14:19 ` Richard Riley
2008-09-29 14:06 ` rustom
2008-09-29 14:32 ` Richard Riley
2008-09-29 16:56 ` Chetan
2008-09-30 9:46 ` Paul R
2008-09-30 13:37 ` Alexey Pustyntsev
2008-10-01 7:27 ` Paul R
[not found] ` <mailman.20241.1222781309.18990.help-gnu-emacs@gnu.org>
2008-09-30 19:20 ` xraysmalevich
2008-09-20 10:51 ` Nikolaj Schumacher
2008-09-19 13:08 ` xraysmalevich
2008-09-19 14:13 ` Xah Lee
2008-09-19 15:21 ` xraysmalevich
2008-09-19 15:36 ` Xah Lee
2008-09-19 13:46 ` Eli Zaretskii
[not found] ` <mailman.19551.1221832017.18990.help-gnu-emacs@gnu.org>
2008-09-19 14:32 ` Xah Lee
2008-09-19 15:31 ` Eli Zaretskii
2008-09-19 16:39 ` Alan Mackenzie
2008-09-20 0:12 ` Xah Lee
2008-09-20 0:48 ` Cor Gest
2008-09-20 3:06 ` Xah Lee
[not found] ` <mailman.19558.1221838316.18990.help-gnu-emacs@gnu.org>
2008-09-19 18:11 ` Lowell Gilbert
2008-09-19 20:36 ` Alan Mackenzie
2008-09-20 0:50 ` Xah Lee
2008-09-20 8:17 ` Alan Mackenzie
[not found] ` <mailman.19598.1221898300.18990.help-gnu-emacs@gnu.org>
2008-09-22 13:07 ` Xah Lee
2008-09-22 16:29 ` Nikolaj Schumacher
2008-09-22 16:58 ` Sean Sieger
[not found] ` <mailman.19702.1222100964.18990.help-gnu-emacs@gnu.org>
2008-09-22 17:06 ` Xah Lee
2008-09-23 19:05 ` Nikolaj Schumacher
2008-09-24 2:08 ` Xah Lee
2008-09-24 4:32 ` Ross A. Laird
[not found] ` <mailman.19792.1222230766.18990.help-gnu-emacs@gnu.org>
2008-09-24 10:22 ` Giorgos Keramidas
2008-09-25 4:01 ` Xah
[not found] ` <mailman.19706.1222102753.18990.help-gnu-emacs@gnu.org>
2008-09-22 17:56 ` Xah Lee
2008-09-22 19:15 ` Ted Zlatanov
2008-09-23 14:47 ` Xah Lee
2008-09-22 22:13 ` Alan Mackenzie
[not found] ` <mailman.19718.1222121219.18990.help-gnu-emacs@gnu.org>
2008-09-22 22:36 ` David Kastrup
2008-09-24 11:43 ` Alan Mackenzie
[not found] ` <mailman.19814.1222256243.18990.help-gnu-emacs@gnu.org>
2008-09-27 16:35 ` Xah
2008-09-20 8:50 ` Alan Mackenzie
[not found] ` <mailman.19599.1221900241.18990.help-gnu-emacs@gnu.org>
2008-09-22 13:08 ` Xah Lee
2008-09-17 7:36 ` Kevin Rodgers
[not found] ` <mailman.19399.1221637030.18990.help-gnu-emacs@gnu.org>
2008-09-17 23:16 ` Xah
2008-09-21 12:06 ` Christian Herenz
2008-09-21 19:01 ` Joost Kremers
2008-09-24 14:39 ` William Case
[not found] ` <mailman.19824.1222267150.18990.help-gnu-emacs@gnu.org>
2008-09-25 5:06 ` Tim X
2008-09-25 6:35 ` Xah
2008-09-25 8:13 ` Jonathan Groll
[not found] ` <mailman.19898.1222330438.18990.help-gnu-emacs@gnu.org>
2008-09-25 9:09 ` Andreas Politz
2008-09-25 10:01 ` Juanma Barranquero
2008-09-25 11:17 ` Xah
[not found] ` <mailman.19906.1222336893.18990.help-gnu-emacs@gnu.org>
2008-09-25 12:07 ` Xah
2008-09-25 12:53 ` Lennart Borgman
[not found] ` <mailman.19912.1222347213.18990.help-gnu-emacs@gnu.org>
2008-09-25 13:21 ` Xah
2008-09-25 13:48 ` Lennart Borgman
[not found] ` <mailman.19917.1222350495.18990.help-gnu-emacs@gnu.org>
2008-09-25 13:57 ` Xah
2008-09-25 15:39 ` Lennart Borgman (gmail)
[not found] ` <mailman.19926.1222357204.18990.help-gnu-emacs@gnu.org>
2008-09-26 1:07 ` Xah
2008-09-25 11:00 ` Xah
2008-09-25 13:34 ` language (was: How to get rid of *GNU Emacs* buffer on start-up?) Ted Zlatanov
2008-09-25 13:49 ` Xah
2008-09-25 19:47 ` language Ted Zlatanov
2008-09-25 17:58 ` How to get rid of *GNU Emacs* buffer on start-up? Sean Sieger
[not found] ` <mailman.19940.1222365501.18990.help-gnu-emacs@gnu.org>
2008-09-26 1:04 ` Xah
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=095ef0c0-c7f4-494d-8bf6-8a5ee43fd934@i20g2000prf.googlegroups.com \
--to=xah@xahlee.org \
--cc=help-gnu-emacs@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.