all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Vollmar <vollmar@nf.mpg.de>
To: Drew Adams <drew.adams@oracle.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Emacs ignores modified state of "untitled" buffer
Date: Thu, 20 May 2010 16:00:02 +0200	[thread overview]
Message-ID: <E52BFA79-57A3-4DD2-9314-13545CEC3EE8@nf.mpg.de> (raw)
In-Reply-To: <D305F2C97F6347FB82EBEFDE6B3A2353@us.oracle.com>

[-- Attachment #1: Type: text/plain, Size: 2014 bytes --]

Dear Drew,

On 20.05.2010, at 15:29, Drew Adams wrote:

>>> we have a user who wants to always open Emacs with a new "untitled"
>>> buffer so he can start writing right away without having 
>>> to think of a file name first (similar to a "New Document" feature
>>> in Mac and Windows programs). If we try this in site-start.el:
>>> 
>>> (generate-new-buffer "untitled")
>>> (switch-to-buffer "untitled")
>>> 
>>> we are almost there - Emacs starts with the new "untitled"
>>> buffer. However, if he then exits Emacs, Emacs does not 
>>> warn about a modified buffer and potential data loss, although the 
>>> buffer is marked dirty. How can we get the usual behaviour for
>>> this new buffer?

[...]

> 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?
> 
> Everyone seems to be jumping through hoops here, and my mail with this simple
> suggestion was ignored, so I must not be getting it. I really would like to know
> what I'm missing.


Sorry for being late with our reply (your first answer was almost within seconds of the intial question - superb!), but I was only now able to test it.

(find-file "untitled")

does indeed solve our specific problem quite neatly. Maybe one thing could still be improved: if the "untitled" buffer is dirty and Emacs asks where to save it, the directory now defaults to Emacs' bin directory - so

(find-file "~/untitled")

is an even better choice for us. switch-to-new-untitled-buffer does not seem to be part of Emacs 23.2.

Thanks!

Warm regards,
 Stefan
-- 
Dr. Stefan Vollmar, Dipl.-Phys.
Head of IT group
Max-Planck-Institut für neurologische Forschung
Gleuelerstr. 50, 50931 Köln, Germany
Tel.: +49-221-4726-213  FAX +49-221-4726-298
Tel.: +49-221-478-5713  Mobile: 0160-93874279
Email: vollmar@nf.mpg.de   http://www.nf.mpg.de







[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 4409 bytes --]

  reply	other threads:[~2010-05-20 14:00 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 [this message]
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
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=E52BFA79-57A3-4DD2-9314-13545CEC3EE8@nf.mpg.de \
    --to=vollmar@nf.mpg.de \
    --cc=drew.adams@oracle.com \
    --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.