unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "B. T. Raven" <nihil@nihilo.net>
To: help-gnu-emacs@gnu.org
Subject: Re: *scratch* lost
Date: Mon, 15 Jun 2009 10:31:14 -0500	[thread overview]
Message-ID: <BIedne_wDvDf9KvXnZ2dnUVZ_qOdnZ2d@sysmatrix.net> (raw)
In-Reply-To: <7cr5xlyeui.fsf@pbourguignon.anevia.com>

Pascal J. Bourguignon wrote:
> "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
> 
> 
> 
Thanks, Pascal. I made the mode for *scratch* (lisp-interaction-mode) so 
that C-j alone evaluates but if I needed your function to get a normal 
*scratch* every time I would have reinstalled Emacs instead. My .emacs 
(loaded under switch --debug-init) didn't seem to have any problems 
except for an empty *scratch* in fundamental mode but a normal *scratch* 
was produced with emacs -Q. Somehow a customization of org-agenda-file 
(maybe with extra quotes or something but whatever it was didn't hang up 
debug-init; I didn't pay close enough attention) was producing an empty 
*scratch* in fundamental mode. ??? Anyway I saved your function for 
later use if necessary.
Now,  '(org-agenda-files (quote ("c:/emacs/org"))) under 
custom-set-variables doesn't cause a problem.

Ed


  reply	other threads:[~2009-06-15 15:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-13 16:20 *scratch* lost B. T. Raven
2009-06-13 16:40 ` B. T. Raven
2009-06-15 10:24 ` Pascal J. Bourguignon
2009-06-15 15:31   ` B. T. Raven [this message]
2009-06-17 11:03   ` Stefan Kamphausen
2009-06-17 11:36     ` Pascal J. Bourguignon
2009-06-17 11:49       ` Stefan Kamphausen
2009-06-17 12:25         ` B. T. Raven
2009-06-17 14:12           ` Rancier, Jeffrey
2009-06-17 18:14         ` Johan Bockgård

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=BIedne_wDvDf9KvXnZ2dnUVZ_qOdnZ2d@sysmatrix.net \
    --to=nihil@nihilo.net \
    --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).