help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Is it possible not to quit emacs when buffer is modified?


From: young
Subject: Re: Is it possible not to quit emacs when buffer is modified?
Date: Thu, 20 Aug 2009 11:44:54 -0700 (PDT)
User-agent: G2/1.0

On Aug 19, 9:49 pm, "A.Politz" <poli...@googlemail.com> wrote:
> 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

Thank you!

It works!

Regards,
Youngwhan


reply via email to

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