[slime-devel] Fwd: Showing argument lists on return

Svein Ove Aas sveina at gmail.com
Tue Nov 23 13:51:31 UTC 2004


Ok, let's try that again, with me subscribed...


---------- Forwarded message ----------
From: Svein Ove Aas <sveina at gmail.com>
Date: Tue, 23 Nov 2004 13:42:19 +0000
Subject: Showing argument lists on return
To: slime-devel at common-lisp.net
Cc: sveina at gmail.com


Recently I've noticed I often press return-backspace-space in quick
succession to keep the argument list display around. I put the
following snippet in .emacs to fix it; I don't have time to make a
proper patch of it now due to exams, but maybe some of you will find
it handy.

There are a number of obvious problems with it, and probably a few
less obvious ones. Have fun!

Also, I'm not subscribed to slime-devel, so please keep me CCed in any replies.

-----
(define-key slime-mode-map (kbd "RET") 'slime-return)

(defun slime-return ()
  (interactive)
  (unwind-protect
       (if (slime-connected-p)
           (when (and slime-space-information-p
                      (or (not (slime-busy-p))
                          ;; XXX should we enable this?
                          ;; (not slime-use-sigint-for-interrupt))
                          ))
             (let ((names (slime-enclosing-operator-names)))
               (when names
                 (slime-eval-async
                  `(swank:arglist-for-echo-area (quote ,names))
                  (lambda (message)
                    (if message
                        (slime-message "%s" message)))))))
           (slime-message "Connect to a Lisp to see the argument list."))
    (newline-and-indent)))

(defun slime-repl-return ()
  (interactive)
  (slime-check-connected)
  (assert (<= (point) slime-repl-input-end-mark))
  (cond ((get-text-property (point) 'slime-repl-old-input)
         (slime-repl-grab-old-input))
        (current-prefix-arg
         (slime-repl-send-input))
        (slime-repl-read-mode ; bad style?
         (slime-repl-send-input t))
        ((slime-input-complete-p slime-repl-input-start-mark
                                 slime-repl-input-end-mark)
         (slime-repl-send-input t))
        (t
           (unwind-protect
                (when (and slime-space-information-p
                           (slime-connected-p)
                           (or (not (slime-busy-p))
                               ;; XXX should we enable this?
                               ;; (not slime-use-sigint-for-interrupt))
                               ))
                  (let ((names (slime-enclosing-operator-names)))
                    (when names
                      (slime-eval-async
                       `(swank:arglist-for-echo-area (quote ,names))
                       (lambda (message)
                         (if message
                             (slime-message "%s" message)))))))
             (newline-and-indent)))))




More information about the slime-devel mailing list