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

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

Re: beginner el form


From: Thien-Thi Nguyen
Subject: Re: beginner el form
Date: Sat, 30 Apr 2005 08:22:52 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Alan Wehmann <wehmann@fnal.gov> writes:

> You should have a *scratch* buffer automatically present.
> That is in the proper mode.

another way is to explictly create one:

C-x b hack RET
M-x lisp-interaction-mode RET

for example, below is some code that bundles this approach
in a convenient (and sometimes cathartic ;-) command.

thi

______________________________________
;;; give-me-a-scratch-buffer-now.el
;;;
;;; Rel:v-1-51
;;;
;;; 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


reply via email to

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