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

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

Re: *scratch* lost


From: Pascal J. Bourguignon
Subject: Re: *scratch* lost
Date: Mon, 15 Jun 2009 12:24:21 +0200
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/22.2 (gnu/linux)

"B. T. Raven" <nihil@nihilo.net> writes:

> I was doing some key mapping in .emacs and instead of saving the file,
> restarting Emacs, and testing the new assignment I was doing M-x eval
> region on changed areas of .emacs Somehow all (or many) keychords
> started acting strangely, e.g. C-x 1 would open subr.el in a new
> buffer instead of showing current buffer alone in frame, even cursor
> movement keys did something else. I killed .emacs buffer without
> saving (losing changes) and then exited Emacs. On restarting
> everything looks and works normally exept that *scratch* is empty
> (three commented lines are missing) and it is in Fundamental mode
> instead of Lisp Interaction. Can I get the old *scratch* buffer back?
> How?

(defun make-scratch ()
  (interactive)
  (if (get-buffer "*scratch*")
     (switch-to-buffer (get-buffer "*scratch*"))
     (progn
        (switch-to-buffer (get-buffer-create "*scratch*"))
        (insert ";; This buffer is for notes you don't want to save, and for 
Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.

")
    (emacs-lisp-mode))))


M-x make-scratch RET



-- 
__Pascal Bourguignon__


reply via email to

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