[slime-cvs] CVS slime/contrib

heller heller at common-lisp.net
Fri Aug 24 13:15:46 UTC 2007


Update of /project/slime/cvsroot/slime/contrib
In directory clnet:/tmp/cvs-serv4836/contrib

Modified Files:
	ChangeLog 
Added Files:
	slime-scratch.el 
Log Message:
Move slime-scratch to contrib.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2007/08/23 17:46:31	1.3
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2007/08/24 13:15:45	1.4
@@ -1,3 +1,7 @@
+2007-08-24  Helmut Eller  <heller at common-lisp.net>
+
+	* slime-scratch.el: New file.
+
 2007-08-23  Helmut Eller  <heller at common-lisp.net>
 
 	Move Marco Baringer's inspector to contrib.

--- /project/slime/cvsroot/slime/contrib/slime-scratch.el	2007/08/24 13:15:46	NONE
+++ /project/slime/cvsroot/slime/contrib/slime-scratch.el	2007/08/24 13:15:46	1.1
;;; slime-scratch.el --- imitate Emacs' *scratch* buffer
;;
;; Author: Helmut Eller  <heller at common-lisp.net>
;; License: GNU GPL (same license as Emacs)
;;
;;; Installation:
;;
;; Add something like this your .emacs: 
;;
;;   (add-to-list 'load-path ".../slime/contrib")
;;   (add-hook 'slime-load-hook (lambda () (require 'slime-scratch)))
;;



(defvar slime-scratch-mode-map
  (let ((map (make-sparse-keymap)))
    (set-keymap-parent map lisp-mode-map)
    map))

(defun slime-scratch ()
  (interactive)
  (slime-switch-to-scratch-buffer))

(defun slime-switch-to-scratch-buffer ()
  (set-buffer (slime-scratch-buffer))
  (unless (eq (current-buffer) (window-buffer))
    (pop-to-buffer (current-buffer) t)))

(defun slime-scratch-buffer ()
  "Return the scratch buffer, create it if necessary."
  (or (get-buffer "*slime-scratch*")
      (with-current-buffer (get-buffer-create "*slime-scratch*")
	(lisp-mode)
	(use-local-map slime-scratch-mode-map)
	(slime-mode t)
        (when slime-repl-enable-presentations 
          ;; Respect the syntax text properties of presentations.
          (set (make-local-variable 'parse-sexp-lookup-properties) t))
	(current-buffer))))

(slime-define-keys slime-scratch-mode-map
  ("\C-j" 'slime-eval-print-last-expression))

(def-slime-selector-method ?s
  "*slime-scratch* buffer."
  (slime-scratch-buffer))

(provide 'slime-scratch)



More information about the slime-cvs mailing list