[slime-cvs] CVS slime
CVS User heller
heller at common-lisp.net
Wed Dec 24 08:06:30 UTC 2008
Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv20387
Modified Files:
ChangeLog slime.el
Log Message:
Move most of the REPL mode to contrib.
Disable some commands that depend on the
existence of a REPL buffer.
--- /project/slime/cvsroot/slime/ChangeLog 2008/12/24 07:56:20 1.1601
+++ /project/slime/cvsroot/slime/ChangeLog 2008/12/24 08:06:25 1.1602
@@ -1,5 +1,11 @@
2008-12-23 Helmut Eller <heller at common-lisp.net>
+ Move most of the REPL mode to contrib.
+ Disable some commands that depend on the
+ existence of a REPL buffer.
+
+2008-12-23 Helmut Eller <heller at common-lisp.net>
+
* slime.el (slime-set-connection-info): Don't create a repl
buffer.
(slime-start-lisp): Bind process-connection-type to nil to avoid
--- /project/slime/cvsroot/slime/slime.el 2008/12/24 07:56:20 1.1078
+++ /project/slime/cvsroot/slime/slime.el 2008/12/24 08:06:25 1.1079
@@ -339,63 +339,6 @@
(local-value "local variable values")
(catch-tag "catch tags"))
-;;;;; slime-repl
-
-(defgroup slime-repl nil
- "The Read-Eval-Print Loop (*slime-repl* buffer)."
- :prefix "slime-repl-"
- :group 'slime)
-
-(defcustom slime-repl-shortcut-dispatch-char ?\,
- "Character used to distinguish repl commands from lisp forms."
- :type '(character)
- :group 'slime-repl)
-
-(defcustom slime-repl-only-save-lisp-buffers t
- "When T we only attempt to save lisp-mode file buffers. When
- NIL slime will attempt to save all buffers (as per
- save-some-buffers). This applies to all ASDF related repl
- shortcuts."
- :type '(boolean)
- :group 'slime-repl)
-
-(defface slime-repl-prompt-face
- (if (slime-face-inheritance-possible-p)
- '((t (:inherit font-lock-keyword-face)))
- '((((class color) (background light)) (:foreground "Purple"))
- (((class color) (background dark)) (:foreground "Cyan"))
- (t (:weight bold))))
- "Face for the prompt in the SLIME REPL."
- :group 'slime-repl)
-
-(defface slime-repl-output-face
- (if (slime-face-inheritance-possible-p)
- '((t (:inherit font-lock-string-face)))
- '((((class color) (background light)) (:foreground "RosyBrown"))
- (((class color) (background dark)) (:foreground "LightSalmon"))
- (t (:slant italic))))
- "Face for Lisp output in the SLIME REPL."
- :group 'slime-repl)
-
-(defface slime-repl-input-face
- '((t (:bold t)))
- "Face for previous input in the SLIME REPL."
- :group 'slime-repl)
-
-(defface slime-repl-result-face
- '((t ()))
- "Face for the result of an evaluation in the SLIME REPL."
- :group 'slime-repl)
-
-(defcustom slime-repl-history-file "~/.slime-history.eld"
- "File to save the persistent REPL history to."
- :type 'string
- :group 'slime-repl)
-
-(defcustom slime-repl-history-size 200
- "*Maximum number of lines for persistent REPL history."
- :type 'integer
- :group 'slime-repl)
;;;; Minor modes
@@ -589,7 +532,7 @@
("\C-e" slime-interactive-eval :prefixed t :sldb t :inferior t)
("\C-y" slime-call-defun :prefixed t)
("E" slime-edit-value :prefixed t :sldb t :inferior t)
- ("\C-z" slime-switch-to-output-buffer :prefixed t :sldb t)
+ ;;("\C-z" slime-switch-to-output-buffer :prefixed t :sldb t)
("\C-b" slime-interrupt :prefixed t :inferior t :sldb t)
("\M-g" slime-quit :prefixed t :inferior t :sldb t)
;; Documentation
@@ -603,13 +546,12 @@
("\M-0" slime-restore-window-configuration :prefixed t :inferior t)
([(control meta ?\.)] slime-next-location :inferior t)
("~" slime-sync-package-and-default-directory :prefixed t :inferior t)
- ("\M-p" slime-repl-set-package :prefixed t :inferior t)
+ ;;("\M-p" slime-repl-set-package :prefixed t :inferior t)
;; Cross reference
("<" slime-list-callers :prefixed t :inferior t :sldb t)
(">" slime-list-callees :prefixed t :inferior t :sldb t)
;; "Other"
("\I" slime-inspect :prefixed t :inferior t :sldb t)
- ("\C-]" slime-close-all-parens-in-sexp :prefixed t :inferior t :sldb t)
("\C-xt" slime-list-threads :prefixed t :inferior t :sldb t)
("\C-xc" slime-list-connections :prefixed t :inferior t :sldb t)
;; ;; Shadow unwanted bindings from inf-lisp
@@ -919,6 +861,13 @@
(slime-with-rigid-indentation nil
(apply #'insert strings)))
+(defun slime-property-bounds (prop)
+ "Return two the positions of the previous and next changes to PROP.
+PROP is the name of a text property."
+ (assert (get-text-property (point) prop))
+ (let ((end (next-single-char-property-change (point) prop)))
+ (list (previous-single-char-property-change end prop) end)))
+
(defun slime-curry (fun &rest args)
`(lambda (&rest more) (apply ',fun (append ',args more))))
@@ -1075,7 +1024,7 @@
nil
(" Slime-Tmp" slime-modeline-string)
'(("q" . slime-popup-buffer-quit-function)
- ("\C-c\C-z" . slime-switch-to-output-buffer)
+ ;;("\C-c\C-z" . slime-switch-to-output-buffer)
("\M-." . slime-edit-definition)))
(make-variable-buffer-local
@@ -1277,16 +1226,16 @@
(slime-dispatching-connection process))
(slime-setup-connection process))))
-(defun slime-start-and-load (filename &optional package)
- "Start Slime, if needed, load the current file and set the package."
- (interactive (list (expand-file-name (buffer-file-name))
- (slime-find-buffer-package)))
- (cond ((slime-connected-p)
- (slime-load-file-set-package filename package))
- (t
- (slime-start-and-init (slime-lisp-options)
- (slime-curry #'slime-start-and-load
- filename package)))))
+;;(defun slime-start-and-load (filename &optional package)
+;; "Start Slime, if needed, load the current file and set the package."
+;; (interactive (list (expand-file-name (buffer-file-name))
+;; (slime-find-buffer-package)))
+;; (cond ((slime-connected-p)
+;; (slime-load-file-set-package filename package))
+;; (t
+;; (slime-start-and-init (slime-lisp-options)
+;; (slime-curry #'slime-start-and-load
+;; filename package)))))
(defun slime-start-and-init (options fun)
(let* ((rest (plist-get options :init-function))
@@ -1294,12 +1243,12 @@
(t fun))))
(slime-start* (plist-put (copy-list options) :init-function init))))
-(defun slime-load-file-set-package (filename package)
- (let ((filename (slime-to-lisp-filename filename)))
- (slime-eval-async `(swank:load-file ,filename)
- (lexical-let ((package package))
- (lambda (ignored)
- (slime-repl-set-package package))))))
+;;(defun slime-load-file-set-package (filename package)
+;; (let ((filename (slime-to-lisp-filename filename)))
+;; (slime-eval-async `(swank:load-file ,filename)
+;; (lexical-let ((package package))
+;; (lambda (ignored)
+;; (slime-repl-set-package package))))))
;;;;; Start inferior lisp
;;;
@@ -1380,6 +1329,9 @@
(equal (plist-get args :env) env)
(not (y-or-n-p "Create an additional *inferior-lisp*? ")))))
+(defvar slime-inferior-process-start-hook nil
+ "Hook called whenever a new process gets started.")
+
(defun slime-start-lisp (program program-args env directory buffer)
"Does the same as `inferior-lisp' but less ugly.
Return the created process."
@@ -1393,6 +1345,7 @@
(lisp-mode-variables t)
(let ((proc (get-buffer-process (current-buffer))))
(slime-set-query-on-exit-flag proc)
+ (run-hooks 'slime-inferior-process-start-hook)
proc)))
(defun slime-inferior-connect (process args)
@@ -1515,24 +1468,6 @@
(assert (integerp port))
port))))
-(defun slime-hide-inferior-lisp-buffer ()
- "Display the REPL buffer instead of the *inferior-lisp* buffer."
- (let* ((buffer (if (slime-process)
- (process-buffer (slime-process))))
- (window (if buffer (get-buffer-window buffer t)))
- (repl-buffer (slime-output-buffer t))
- (repl-window (get-buffer-window repl-buffer)))
- (when buffer
- (bury-buffer buffer))
- (cond (repl-window
- (when window
- (delete-window window)))
- (window
- (set-window-buffer window repl-buffer))
- (t
- (pop-to-buffer repl-buffer)
- (goto-char (point-max))))))
-
;;; Words of encouragement
(defun slime-user-first-name ()
@@ -1665,13 +1600,6 @@
(assert default-enable-multibyte-characters))
t))
-(defcustom slime-repl-history-file-coding-system
- (cond ((slime-find-coding-system 'utf-8-unix) 'utf-8-unix)
- (t slime-net-coding-system))
- "*The coding system for the history file."
- :type 'symbol
- :group 'slime-repl)
-
(defun slime-coding-system-mulibyte-p (coding-system)
(second (slime-find-coding-system coding-system)))
@@ -1918,8 +1846,8 @@
slime-net-processes))
(p (car tail)))
(slime-select-connection p)
- (unless (eq major-mode 'slime-repl-mode)
- (setq slime-buffer-connection p))
+;; (unless (eq major-mode 'slime-repl-mode)
+;; (setq slime-buffer-connection p))
(message "Lisp: %s %s" (slime-connection-name p) (process-contact p))))
(defmacro* slime-with-connection-buffer ((&optional process) &rest body)
@@ -2087,8 +2015,6 @@
(unless (string= (slime-lisp-implementation-name) name)
(setf (slime-connection-name)
(slime-generate-connection-name (symbol-name name)))))
- ;;(slime-hide-inferior-lisp-buffer)
- ;;(slime-init-output-buffer connection)
(slime-load-contribs)
(run-hooks 'slime-connected-hook)
(when-let (fun (plist-get args ':init-function))
@@ -2158,7 +2084,8 @@
(defun slime-background-activities-enabled-p ()
(and (or slime-mode
(eq major-mode 'sldb-mode)
- (eq major-mode 'slime-repl-mode))
+ ;;(eq major-mode 'slime-repl-mode)
+ )
(let ((con (slime-current-connection)))
(and con
(eq (process-status con) 'open)))
@@ -2264,8 +2191,8 @@
search for and read an `in-package' form.
The REPL buffer is a special case: its package is `slime-lisp-package'."
- (cond ((eq major-mode 'slime-repl-mode)
- (slime-lisp-package))
+ (cond ;;((eq major-mode 'slime-repl-mode)
+ ;; (slime-lisp-package))
(slime-buffer-package)
(t (save-restriction
(widen)
@@ -2374,15 +2301,6 @@
(slime-rex-continuations)
:key #'car)))
-
-;; dummy defvar for compiler
-(defvar slime-repl-read-mode)
-
-(defun slime-reading-p ()
- "True if Lisp is currently reading input from the REPL."
- (with-current-buffer (slime-output-buffer)
- slime-repl-read-mode))
-
(defun slime-sync ()
"Block until the most recent request has finished."
(when (slime-rex-continuations)
@@ -2418,8 +2336,8 @@
(let ((slime-dispatching-connection (or process (slime-connection))))
(or (run-hook-with-args-until-success 'slime-event-hooks event)
(destructure-case event
- ((:write-string output &optional target)
- (slime-write-string output target))
+ ;;((:write-string output &optional target)
+ ;; (slime-write-string output target))
((:emacs-rex form package thread continuation)
(when (and (slime-use-sigint-for-interrupt) (slime-busy-p))
(slime-display-oneliner "; pipelined request... %S" form))
@@ -2446,14 +2364,14 @@
(sldb-exit thread level stepping))
((:emacs-interrupt thread)
(slime-send `(:emacs-interrupt ,thread)))
- ((:read-string thread tag)
- (assert thread)
- (slime-repl-read-string thread tag))
+;; ((:read-string thread tag)
+;; (assert thread)
+;; (slime-repl-read-string thread tag))
((:y-or-n-p thread tag question)
(slime-y-or-n-p thread tag question))
- ((:read-aborted thread tag)
- (assert thread)
- (slime-repl-abort-read thread tag))
+;; ((:read-aborted thread tag)
+;; (assert thread)
+;; (slime-repl-abort-read thread tag))
((:emacs-return-string thread tag string)
(slime-send `(:emacs-return-string ,thread ,tag ,string)))
;;
@@ -2464,8 +2382,8 @@
(setf (slime-lisp-features) features))
((:indentation-update info)
(slime-handle-indentation-update info))
- ((:open-dedicated-output-stream port)
- (slime-open-stream-to-lisp port))
+ ;;((:open-dedicated-output-stream port)
+ ;; (slime-open-stream-to-lisp port))
((:eval-no-wait fun args)
(apply (intern fun) args))
((:eval thread tag form-string)
@@ -2556,1288 +2474,9 @@
(outline-minor-mode)))
buffer)))
-
-;;;; Stream output
-
-(slime-def-connection-var slime-connection-output-buffer nil
- "The buffer for the REPL. May be nil or a dead buffer.")
-
-(make-variable-buffer-local
- (defvar slime-output-start nil
- "Marker for the start of the output for the evaluation."))
-
-(make-variable-buffer-local
- (defvar slime-output-end nil
- "Marker for end of output. New output is inserted at this mark."))
-
-;; dummy definitions for the compiler
-(defvar slime-repl-package-stack)
-(defvar slime-repl-directory-stack)
-(defvar slime-repl-input-start-mark)
-(defvar slime-repl-prompt-start-mark)
-
-(defun slime-output-buffer (&optional noprompt)
- "Return the output buffer, create it if necessary."
- (let ((buffer (slime-connection-output-buffer)))
- (or (if (buffer-live-p buffer) buffer)
- (setf (slime-connection-output-buffer)
- (let ((connection (slime-connection)))
- (with-current-buffer (slime-repl-buffer t connection)
- (unless (eq major-mode 'slime-repl-mode)
- (slime-repl-mode))
- (setq slime-buffer-connection connection)
- (slime-reset-repl-markers)
- (unless noprompt
- (slime-repl-insert-prompt))
- (current-buffer)))))))
-
-(defvar slime-repl-banner-function 'slime-repl-insert-banner)
-
-(defun slime-repl-update-banner ()
- (funcall slime-repl-banner-function)
- (goto-char (point-max))
- (slime-mark-output-start)
- (slime-mark-input-start)
- (slime-repl-insert-prompt))
-
-(defun slime-repl-insert-banner ()
- (when (zerop (buffer-size))
- (let ((welcome (concat "; SLIME " (or (slime-changelog-date)
- "- ChangeLog file not found"))))
- (insert welcome))))
-
-(defun slime-init-output-buffer (connection)
- (with-current-buffer (slime-output-buffer t)
- (setq slime-buffer-connection connection
- slime-repl-directory-stack '()
- slime-repl-package-stack '())
- (slime-repl-update-banner)))
-
-(defun slime-display-output-buffer ()
- "Display the output buffer and scroll to bottom."
- (with-current-buffer (slime-output-buffer)
- (goto-char (point-max))
- (unless (get-buffer-window (current-buffer) t)
- (display-buffer (current-buffer) t))
- (slime-repl-show-maximum-output)))
-
-(defmacro slime-with-output-end-mark (&rest body)
- "Execute BODY at `slime-output-end'.
-
-If point is initially at `slime-output-end' and the buffer is visible
-update window-point afterwards. If point is initially not at
-`slime-output-end, execute body inside a `save-excursion' block."
- `(let ((body.. (lambda () , at body))
- (updatep.. (and (eobp) (pos-visible-in-window-p))))
- (cond ((= (point) slime-output-end)
- (let ((start.. (point)))
- (funcall body..)
- (set-marker slime-output-end (point))
- (when (= start.. slime-repl-input-start-mark)
- (set-marker slime-repl-input-start-mark (point)))))
- (t
[2097 lines skipped]
More information about the slime-cvs
mailing list