unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Cor Gest <cor@clsnet.nl>
To: help-gnu-emacs@gnu.org
Subject: Re: buffer-offer-save variable bug?
Date: Wed, 24 Sep 2008 17:57:42 +0000	[thread overview]
Message-ID: <87ljxhl949.fsf@atthis.clsnet.nl> (raw)
In-Reply-To: 4587f148-cf4d-43c9-81e6-c25bc711d5b9@s9g2000prg.googlegroups.com


Some entity, AKA Xah Lee <xah@xahlee.org>,
wrote this mindboggling stuff:
(selectively-snipped-or-not-p)


> eval this code:
>
> (defun new-empty-buffer ()
>   "Opens a new empty buffer."
>   (interactive)
>   (let ((buf (generate-new-buffer "untitled")))
>     (switch-to-buffer buf)
>     (funcall (and initial-major-mode))
>     (setq buffer-offer-save t)))
>
> then call it. You'll have a new buffer. Now type something in it. Now,
> go to the menu “File‣Close”.
>
> You'll see that emacs closes the buffer immediately without offering
> save.

That is the corect behaviour of buffers.

Close means merely 'close'.
 AKA get this buffer-namespace outta-my-face;
 =OR=
 Icanhaz some fun answering basic questions in the article-buffer
 called 'gnu.emacs.help'.

list-all-buffers wil show you that "untiteled" still exists
in the namespace 'buffers' where all buffer-names exist.

If you do a 'kill-current-buffer' (C-x k) it will politely inform you with : 
"buffer has changed , kill it anyway ?   yes or no ?"

IF you DID_NOT change it by typing any drivel in it after creation 
then it will remove the buffer-name-space from the memory, but if you
activated auto-save and waited long enough (1 ... xxx seconds) you still 
can get it back from the auto-save-list with minimal (or even non) loss of data.

If you want to SAVE the buffer_content, you must ASK to write
the buffer to disk, and it will ask for a name when a file allready
exists with that buffer-name called 'untitled' or replace it, if asked.

In short, 'Close' is a non-destructive call in the buffer realm.

Some study of the emacs-lisp-buffer-behaviour should be a more 
usefull timewaster for you.



Cor

-- 
	Mijn Tools zijn zo modern dat ze allemaal eindigen op 'saurus'
        (defvar My-Computer '((OS . "GNU/Emacs") (IPL . "GNU/Linux")))
	     SPAM DELENDA EST       http://www.clsnet.nl/mail.php
                 1st Law of surviving a gunfight : Have a gun 


  parent reply	other threads:[~2008-09-24 17:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24 14:06 buffer-offer-save variable bug? Xah Lee
2008-09-24 16:01 ` Andreas Politz
2008-09-24 17:57 ` Cor Gest [this message]
2008-09-25 11:37   ` Nikolaj Schumacher
     [not found]   ` <mailman.19909.1222342654.18990.help-gnu-emacs@gnu.org>
2008-09-25 13:42     ` Cor Gest
2008-09-25 16:57       ` Nikolaj Schumacher

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=87ljxhl949.fsf@atthis.clsnet.nl \
    --to=cor@clsnet.nl \
    --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).