[slime-cvs] CVS slime
mkoeppe
mkoeppe at common-lisp.net
Thu Mar 23 05:01:41 UTC 2006
Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv29704
Modified Files:
slime.el
Log Message:
* slime.el (slime-qualify-cl-symbol-name): Strip leading colon
from package names for qualifying symbols.
(slime-call-defun): New command.
(slime-keys): Bind it to C-c C-y.
(slime-easy-menu): Show it in the menu.
* slime.el (slime-autodoc-use-multiline-p): New defcustom.
(slime-autodoc-message): Use it here. Fix bug that autodoc
messages exceeding one line could not be overwritten by later
autodoc messages.
(slime-autodoc-pre-command-refresh-echo-area): Use message
rather than slime-background-message.
--- /project/slime/cvsroot/slime/slime.el 2006/03/22 02:48:26 1.601
+++ /project/slime/cvsroot/slime/slime.el 2006/03/23 05:01:40 1.602
@@ -657,6 +657,7 @@
("\C-\M-x" slime-eval-defun)
(":" slime-interactive-eval :prefixed t :sldb t)
("\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-b" slime-interrupt :prefixed t :inferior t :sldb t)
@@ -793,7 +794,8 @@
[ "Eval Region" slime-eval-region ,C ]
[ "Scratch Buffer" slime-scratch ,C ]
[ "Interactive Eval..." slime-interactive-eval ,C ]
- [ "Edit Lisp Value..." slime-edit-value ,C ])
+ [ "Edit Lisp Value..." slime-edit-value ,C ]
+ [ "Call Defun" slime-call-defun ,C ])
("Debugging"
[ "Macroexpand Once..." slime-macroexpand-1 ,C ]
[ "Macroexpand All..." slime-macroexpand-all ,C ]
@@ -5388,14 +5390,26 @@
(slime-update-autodoc-cache cache-key doc)
(slime-autodoc-message doc)))))))
+(defcustom slime-autodoc-use-multiline-p nil
+ "If non-nil, allow long autodoc messages to resize echo area display."
+ :group 'slime-ui)
+
(defun slime-autodoc-message (doc)
- (setq slime-autodoc-last-message doc)
- (slime-background-message "%s" doc))
+ "Display the autodoc documentation string DOC."
+ (cond
+ ((slime-typeout-active-p)
+ (setq slime-autodoc-last-message "") ; no need for refreshing
+ (slime-typeout-message doc))
+ (t
+ (unless slime-autodoc-use-multiline-p
+ (setq doc (slime-oneliner doc)))
+ (setq slime-autodoc-last-message doc)
+ (message "%s" doc))))
(defun slime-autodoc-pre-command-refresh-echo-area ()
(unless (string= slime-autodoc-last-message "")
(if (slime-autodoc-message-ok-p)
- (slime-background-message "%s" slime-autodoc-last-message)
+ (message "%s" slime-autodoc-last-message)
(setq slime-autodoc-last-message ""))))
(defun slime-autodoc-thing-at-point ()
@@ -6577,6 +6591,21 @@
(insert "\n")
(slime-eval-print string))
+(defun slime-call-defun ()
+ (interactive)
+ "Insert a call to the function defined around point into the REPL."
+ (let ((toplevel (slime-parse-toplevel-form)))
+ (unless (and (consp toplevel)
+ (member (car toplevel) '(:defun :defmethod :defgeneric))
+ (symbolp (cadr toplevel)))
+ (error "Not in a function definition"))
+ (let* ((symbol (cadr toplevel))
+ (function-call
+ (format "(%s " (slime-qualify-cl-symbol-name symbol))))
+ (slime-switch-to-output-buffer)
+ (goto-char slime-repl-input-start-mark)
+ (insert function-call))))
+
;;;; Edit Lisp value
;;;
(defun slime-edit-value (form-string)
@@ -9877,7 +9906,11 @@
(if (slime-cl-symbol-package s)
s
(format "%s::%s"
- (slime-current-package)
+ (let* ((package (slime-current-package)))
+ ;; package is a string like ":cl-user" or "CL-USER".
+ (if (and package (string-match "^:" package))
+ (substring package 1)
+ package))
(slime-cl-symbol-name s)))))
More information about the slime-cvs
mailing list