Hello slime-devels,
I'd like to propose the following changes/additions to `slime-space' around `slime-echo-arglist'. As best I can gather these provide the quickest path to toggling the verbosity of `slime-space's invocation of `slime-echo-arglist' (which I find too distracting at times).
I'd also like to suggest that various of slime-autodoc's variables be made permanent-local. AFAICT the emacs-devels (esp. their fearless leader) are increasingly less adverse to judicious use of and apportioning of permanent buffer-locals and as such Slime could be making better use of permanent-locals as well :)
-- /s_P\
;;; ============================== ;;; :CREATED <Timestamp: #{2010-10-31T16:15:03-04:00Z}#{10437} - by MON> (defvar *slime-echo-arglist-STFU* nil "When non-nil `slime-space' won't invoke `slime-echo-arglist' verbosely.\n `slime-echo-arglist-behave-or-back-to-your-cage' toggles `slime-echo-arglist' back on, and `slime-echo-arglist-STFU' shuts it up again.\n Evaluate `slime-show-arglist' explicitly if an arglist is needed.\n :SEE-ALSO `slime-echo-arglist-function'.\n►►►") ;; (make-variable-buffer-local '*slime-echo-arglist-STFU*) (put '*slime-echo-arglist-STFU* 'permanent-local t) (set-default '*slime-echo-arglist-STFU* nil)
(defun slime-echo-arglist-behave-or-back-to-your-cage () "De-gimpify `slime-space's and allow `slime-echo-arglist' in current-buffer.\n Evaluate `slime-echo-arglist-STFU' to tone down the minibuffer noise.\n :SEE ALSO `*slime-echo-arglist-STFU*', `slime-echo-arglist-function'.\n►►►" (interactive) (with-current-buffer (current-buffer) (set (make-local-variable 'slime-echo-arglist-STFU) nil)))
(defun slime-echo-arglist-STFU () "Silence `slime-space's invocation of `slime-echo-arglist' in current-buffer.\n Evaluate `slime-echo-arglist-behave-or-back-to-your-cage' to turn it back on.\n Evaluate `slime-show-arglist' explicitly if an arglist is needed. :SEE-ALSO `*slime-echo-arglist-STFU*', `slime-echo-arglist-function'.\n►►►" (interactive) (with-current-buffer (current-buffer) (set (make-local-variable 'slime-echo-arglist-STFU) t)))
(defun slime-space (n) (interactive "p") (self-insert-command n) (when (and (not *slime-echo-arglist-STFU*) ;; <- redefined here. (slime-background-activities-enabled-p)) (slime-echo-arglist)))
(defun slime-space (n) "Insert a space and print some relevant information (function arglist). Designed to be bound to the SPC key. Prefix argument can be used to insert more than one space." (interactive "p") (self-insert-command n) (when (and (not *slime-echo-arglist-STFU*) ;; <- redefined here. (slime-background-activities-enabled-p)) (slime-echo-arglist)))
* MON KEY [2010-11-09 16:41] writes:
Hello slime-devels,
I'd like to propose the following changes/additions to `slime-space' around `slime-echo-arglist'. As best I can gather these provide the quickest path to toggling the verbosity of `slime-space's invocation of `slime-echo-arglist' (which I find too distracting at times).
I'd also like to suggest that various of slime-autodoc's variables be made permanent-local. AFAICT the emacs-devels (esp. their fearless leader) are increasingly less adverse to judicious use of and apportioning of permanent buffer-locals and as such Slime could be making better use of permanent-locals as well :)
You could also give slime-echo-arglist-function a buffer local value, right?
Helmut
apportioning of permanent buffer-locals and as such Slime could be making better use of permanent-locals as well :)
You could also give slime-echo-arglist-function a buffer local value, right?
Currently there is this:
slime-space `-> slime-echo-arglist `--> slime-echo-arglist-function `---> slime-show-arglist
The proposed solution short circuits the nesting and `slime-echo-arglist' is never seen which (I hope) may help avoid slime-autodoc/eldoc loading/unloading/enabling/disabling issues...
My thinking was that making `slime-echo-arglist-function' the buffer-local permanent-local was too coarse but maybe there is other stuff happening swank side that i am missing?
But yeah, AFAICT making `slime-echo-arglist-function' buffer-local would accomplish the same thing as long as it was _also_ permanent-local, e.g.:
(defvar slime-echo-arglist-function 'slime-show-arglist "Symbol naming a function. Used by `slime-echo-arglist' and `slime-space'.")
(make-variable-buffer-local 'slime-echo-arglist-function) (put 'slime-echo-arglist-function 'permanent-local t) (set-default 'slime-echo-arglist-function 'slime-show-arglist)
Assuming the corresponding getter/setter exist:
(defcustom *slime-echo-arglist-ignore-function* 'ignore "Symbol naming a function to use when `slime-echo-arglist' shouldn't. The function will become the default buffer-local-value when `slime-echo-arglist-toggle' is invoked to override default-value of `slime-echo-arglist-function'. The default value is `ignore', which effectively prevents `slime-space' from verbosely echoing arglists to minibuffer." :type 'function :group 'slime-ui)
(defun slime-echo-arglist-toggle () (interactive) (with-current-buffer (current-buffer) (apply slime-message-function (concat ;; :NOTE byte-compiler will optimize away this concat. "Toggled buffer-local-value `slime-echo-arglist-function'" "in buffer: %s, new value is `%S'") (list (buffer-name) (if (eq (buffer-local-value 'slime-echo-arglist-function (current-buffer)) (default-value 'slime-echo-arglist-function)) (set (make-local-variable 'slime-echo-arglist-function) *slime-echo-arglist-ignore-function*) (set (make-local-variable 'slime-echo-arglist-function) (default-value 'slime-echo-arglist-function)))))))
Helmut
-- /s_P\