From: "Drew Adams" <drew.adams@oracle.com>
To: "'Kevin Rodgers'" <kevin.d.rodgers@gmail.com>, <help-gnu-emacs@gnu.org>
Subject: RE: Emacs ignores modified state of "untitled" buffer
Date: Fri, 21 May 2010 07:20:11 -0700 [thread overview]
Message-ID: <8E1EF5747B7A4183A0873F02FDBBF398@us.oracle.com> (raw)
In-Reply-To: <ht4p8p$gm4$1@dough.gmane.org>
> > What am I missing? What is wrong with just using (find-file
> > "untitled")?
> >
> > If a buffer is associated with a file name (which is what
> > `find-file' does) then Emacs asks you about saving it.
> > What else is the OP asking for?
>
> C-x C-s won't ask.
>
> I can think of a couple nuisances:
>
> * If the buffer gets saved to file "untitled", a subsequent
> invocation of emacs will visit that file, not an empty buffer.
>
> * Changes to the buffer will be auto-saved to the #untitled#
> file, and a subsequent invocation of emacs will ask to recover
> the file (if the 2 invocations are concurrent, or if the first
> invocation exited uncleanly).
I see. It's clear now; thanks.
C-x C-s saves quietly (to the `buffer-file-name') without asking for a target
file (since it already has an associated file name).
The behavior of most programs is different: If no _previously saved_ file is
associated with the buffer, then trying to save makes the program ask for a file
name. For the first save, users are typically required to use `Save As' (or else
`Save' acts as `Save As' before the first save).
Your code implements, I think, just what is needed for the OP (and others). It
provides autosaving, saving without asking if already saved once, and saving
with asking if not yet saved.
You've offered this as command `switch-to-new-buffer' and put it on the
`Buffers' menu as `Select New Buffer'.
I would prefer that it be considered an improved behavior for `Visit New File',
which is currently just `find-file'. The use of your command is, I think, for
new file buffers only, so that intention should be reflected in both the command
name and menu-item name. The `Buffers' menu is the wrong place for this, IMO.
So I would suggest changing the command name to something like `new-file' or
`visit-new-file' and (more importantly) replacing the `File' > `Visit New File'
menu item with it.
Those who are most likely to use such a menu item are newbies who expect that
behavior. Any Emacs veteran who prefers `find-file' will not be likely to use
the menu and choose `Visit New File'. And it is clear what a `new-file' command
is for.
I agree with Lennart that you should think about proposing this to emacs-devel.
I would support it, especially with the changes I just mentioned.
next prev parent reply other threads:[~2010-05-21 14:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 14:52 Emacs ignores modified state of "untitled" buffer Stefan Vollmar
2010-05-19 15:04 ` Drew Adams
2010-05-19 20:34 ` Stephen Berman
2010-05-20 12:45 ` Kevin Rodgers
2010-05-20 13:29 ` Drew Adams
2010-05-20 14:00 ` Stefan Vollmar
2010-05-21 2:00 ` Kevin Rodgers
2010-05-21 2:06 ` Lennart Borgman
2010-05-21 1:56 ` Kevin Rodgers
2010-05-21 8:03 ` Stefan Vollmar
2010-05-21 13:17 ` Kevin Rodgers
2010-05-21 13:59 ` Stefan Vollmar
2010-05-21 14:11 ` Kevin Rodgers
2010-05-21 14:30 ` Stefan Vollmar
2010-05-21 17:15 ` Lennart Borgman
2010-05-21 20:49 ` Stefan Vollmar
2010-05-21 20:56 ` Lennart Borgman
2010-05-21 14:20 ` Drew Adams [this message]
2010-05-28 14:32 ` Kevin Rodgers
2010-05-28 17:18 ` Drew Adams
2010-05-28 21:21 ` Stefan Vollmar
[not found] ` <mailman.2.1275067137.32597.help-gnu-emacs@gnu.org>
2010-05-29 1:04 ` Tim X
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=8E1EF5747B7A4183A0873F02FDBBF398@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=kevin.d.rodgers@gmail.com \
/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.