unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "A.Politz" <politza@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Is it possible not to quit emacs when buffer is modified?
Date: Wed, 19 Aug 2009 21:49:14 -0700 (PDT)	[thread overview]
Message-ID: <cf369987-42f9-4af5-8eae-970fc41a9cd3@g23g2000vbr.googlegroups.com> (raw)
In-Reply-To: c9847846-6787-4018-be87-eef8b209278c@m7g2000prd.googlegroups.com

On Aug 20, 2:22 am, YOUNG <breadn...@gmail.com> wrote:
> Hi,
>
> If a buffer does not connect to a file but it is modified, if you type
> c-x c, emacs just quits and losts the data.
>
> Is there a way to protect of it?
>
> Regards,
> Youngwhan

One way to avoid this is the `buffer-offer-save' variable, e.g like
this.

(add-hook 'first-change-hook
          #'(lambda nil
              ;; set for all 'regular' buffers
              (unless (string-match "\\`[ *].*[*]\\'"
                                    (buffer-name))
                (setq buffer-offer-save t))))

-ap


  parent reply	other threads:[~2009-08-20  4:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  0:22 Is it possible not to quit emacs when buffer is modified? YOUNG
2009-08-20  2:09 ` Xah Lee
2009-08-20  2:23   ` Xah Lee
2009-08-20  4:49 ` A.Politz [this message]
2009-08-20 18:44   ` young
2009-08-20 15:08 ` Michael Heerdegen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf369987-42f9-4af5-8eae-970fc41a9cd3@g23g2000vbr.googlegroups.com \
    --to=politza@googlemail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).