unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: where is the scratch buffer
  2006-04-01  0:45 where is the scratch buffer Gary Weselle
@ 2006-03-31  6:58 ` Wolfram Kraus
  2006-04-01  4:12   ` Gary Weselle
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Kraus @ 2006-03-31  6:58 UTC (permalink / raw)


Gary Weselle wrote:
> Hi
> 
> a problem which I have not found a solution for.
> when I write something in the scratch buffer and save it as a file, then
> kill this "file" I lose the scratch buffer, how do I get it back.
> 
> thanks
> 
> 
Just switch to the *scratch* buffer. Emacs will (re)create every 
non-exiting buffer:
C-x b *scratch* [RET]

HTH,
Wolfram

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: where is the scratch buffer
  2006-04-01  4:12   ` Gary Weselle
@ 2006-03-31  9:26     ` Malte Spiess
  2006-03-31 14:44       ` Thien-Thi Nguyen
  2006-03-31 16:22     ` Kevin Rodgers
  1 sibling, 1 reply; 6+ messages in thread
From: Malte Spiess @ 2006-03-31  9:26 UTC (permalink / raw)


"Gary Weselle" <weselle_g@hotmain.com> writes:

> "Wolfram Kraus" <kraus@hagen-partner.de> wrote in message
> news:e0ijsp$qvk$1@ork-un.noris.net...
>> Gary Weselle wrote:
>> > Hi
>> >
>> > a problem which I have not found a solution for.
>> > when I write something in the scratch buffer and save it as a file, then
>> > kill this "file" I lose the scratch buffer, how do I get it back.
>> >
>> > thanks
>> >
>> >
>> Just switch to the *scratch* buffer. Emacs will (re)create every
>> non-exiting buffer:
>> C-x b *scratch* [RET]
>>
>> HTH,
>> Wolfram
>
> well, that is the point, there is not *scratch* in the buffer Menu when C-x
> b is hit.

But if you type in *scratch* there will be a new one. Makes no
difference to the one you deleted.

Greetings
Malte

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: where is the scratch buffer
  2006-03-31  9:26     ` Malte Spiess
@ 2006-03-31 14:44       ` Thien-Thi Nguyen
  0 siblings, 0 replies; 6+ messages in thread
From: Thien-Thi Nguyen @ 2006-03-31 14:44 UTC (permalink / raw)


Malte Spiess <mail@malte-spiess.de> writes:

> But if you type in *scratch* there will be a new one.
> Makes no difference to the one you deleted.

below is source for a command you can bind to a key.

thi

___________________________________________
;;; give-me-a-scratch-buffer-now.el
;;;
;;; Rel:v-1-55
;;;
;;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998,2004 Thien-Thi Nguyen
;;; This file is part of ttn's personal elisp library, released under GNU
;;; GPL with ABSOLUTELY NO WARRANTY.  See the file COPYING for details.

;;; Description: Find *scratch* buffer; put it in lisp-interaction-mode.
;;; Prefix arg guarantees new buffer.

;;;###autoload
(defun give-me-a-scratch-buffer-now (want-new)
  "Bring up *scratch* or younger siblings if prefixed."
  (interactive "P")

  (switch-to-buffer
   (if want-new
       (generate-new-buffer "*scratch*")
     "*scratch*"))
  (lisp-interaction-mode))

(provide 'give-me-a-scratch-buffer-now)

;;; give-me-a-scratch-buffer-now.el ends here

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: where is the scratch buffer
  2006-04-01  4:12   ` Gary Weselle
  2006-03-31  9:26     ` Malte Spiess
@ 2006-03-31 16:22     ` Kevin Rodgers
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2006-03-31 16:22 UTC (permalink / raw)


Gary Weselle wrote:
> "Wolfram Kraus" <kraus@hagen-partner.de> wrote in message
> news:e0ijsp$qvk$1@ork-un.noris.net...
> 
>>Gary Weselle wrote:
>>
>>>a problem which I have not found a solution for.
>>>when I write something in the scratch buffer and save it as a file, then
>>>kill this "file" I lose the scratch buffer, how do I get it back.
>>
>>Just switch to the *scratch* buffer. Emacs will (re)create every
>>non-exiting buffer:
>>C-x b *scratch* [RET]
> 
> well, that is the point, there is not *scratch* in the buffer Menu when C-x
> b is hit.

*scratch* is not there because you implicitly renamed it, by making it
visit the file:

,----[ C-h k C-x C-w ]
| C-x C-w runs the command write-file
|    which is an interactive compiled Lisp function in `files'.
| (write-file FILENAME &optional CONFIRM)
|
| Write current buffer into file FILENAME.
| This makes the buffer visit that file, and marks it as not modified.
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| If you specify just a directory name as FILENAME, that means to use
| the default file name but in that directory.  You can also yank
| the default file name into the minibuffer to edit it, using M-n.
|
| If the buffer is not already visiting a file, the default file name
| for the output file is the buffer name.
|
| If optional second arg CONFIRM is non-nil, this function
| asks for confirmation before overwriting an existing file.
| Interactively, confirmation is required unless you supply a prefix 
argument.
`----

(`C-x C-s' does the same thing.)

BTW, using the *scratch* buffer for new files is not a good idea, since
it is not autosaved (you could lose your work if Emacs crashes -- or
more likely, your computer).

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* where is the scratch buffer
@ 2006-04-01  0:45 Gary Weselle
  2006-03-31  6:58 ` Wolfram Kraus
  0 siblings, 1 reply; 6+ messages in thread
From: Gary Weselle @ 2006-04-01  0:45 UTC (permalink / raw)


Hi

a problem which I have not found a solution for.
when I write something in the scratch buffer and save it as a file, then
kill this "file" I lose the scratch buffer, how do I get it back.

thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: where is the scratch buffer
  2006-03-31  6:58 ` Wolfram Kraus
@ 2006-04-01  4:12   ` Gary Weselle
  2006-03-31  9:26     ` Malte Spiess
  2006-03-31 16:22     ` Kevin Rodgers
  0 siblings, 2 replies; 6+ messages in thread
From: Gary Weselle @ 2006-04-01  4:12 UTC (permalink / raw)



"Wolfram Kraus" <kraus@hagen-partner.de> wrote in message
news:e0ijsp$qvk$1@ork-un.noris.net...
> Gary Weselle wrote:
> > Hi
> >
> > a problem which I have not found a solution for.
> > when I write something in the scratch buffer and save it as a file, then
> > kill this "file" I lose the scratch buffer, how do I get it back.
> >
> > thanks
> >
> >
> Just switch to the *scratch* buffer. Emacs will (re)create every
> non-exiting buffer:
> C-x b *scratch* [RET]
>
> HTH,
> Wolfram

well, that is the point, there is not *scratch* in the buffer Menu when C-x
b is hit.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-04-01  4:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-01  0:45 where is the scratch buffer Gary Weselle
2006-03-31  6:58 ` Wolfram Kraus
2006-04-01  4:12   ` Gary Weselle
2006-03-31  9:26     ` Malte Spiess
2006-03-31 14:44       ` Thien-Thi Nguyen
2006-03-31 16:22     ` Kevin Rodgers

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).