-
-
Notifications
You must be signed in to change notification settings - Fork 45
Adds an option to disable eldoc #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
cb62306
cf9f4d3
38f42a8
a36a2f0
96655e3
6920983
134aff7
1210bc9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -384,6 +384,13 @@ mode line entirely." | |
:type 'sexp | ||
:risky t) | ||
|
||
(defvar inf-clojure-eldoc-enabledp t | ||
"Var that allows disabling `eldoc-mode` in `inf-clojure`. | ||
|
||
Set to `nil` to disable eldoc. Eldoc can be quite useful by | ||
displaying funciton signatures in the modeline, but can also | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, this disclaimer is true for every command that does some code evaluation on the side. :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's true, but all others are user driver. If you refresh a namespace or call doc, you understand that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also - there's a typo in |
||
cause multiple prompts to appear and mess with `*1`, `*2`, etc.") | ||
|
||
;;;###autoload | ||
(define-minor-mode inf-clojure-minor-mode | ||
"Minor mode for interacting with the inferior Clojure process buffer. | ||
|
@@ -394,7 +401,8 @@ The following commands are available: | |
:lighter inf-clojure-mode-line | ||
:keymap inf-clojure-minor-mode-map | ||
(setq-local comint-input-sender 'inf-clojure--send-string) | ||
(inf-clojure-eldoc-setup) | ||
(when inf-clojure-eldoc-enabledp | ||
(inf-clojure-eldoc-setup)) | ||
(make-local-variable 'completion-at-point-functions) | ||
(add-to-list 'completion-at-point-functions | ||
#'inf-clojure-completion-at-point)) | ||
|
@@ -631,7 +639,8 @@ to continue it." | |
(setq mode-line-process '(":%s")) | ||
(clojure-mode-variables) | ||
(clojure-font-lock-setup) | ||
(inf-clojure-eldoc-setup) | ||
(when inf-clojure-eldoc-enabledp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm ok with this, but it might be better to make the eldoc integration a no-op instead, so that people won't have to disable/enable inf-clojure-mode for the new config to be taken into account. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was originally my solution, but that still leads to some problems. Eldoc is initialized as follows: (defun inf-clojure-eldoc-setup ()
"Turn on eldoc mode in the current buffer."
(setq-local eldoc-documentation-function #'inf-clojure-eldoc)
(apply #'eldoc-add-command inf-clojure-extra-eldoc-commands)) Since it clobbers any existing |
||
(inf-clojure-eldoc-setup)) | ||
(setq comint-get-old-input #'inf-clojure-get-old-input) | ||
(setq comint-input-filter #'inf-clojure-input-filter) | ||
(setq-local comint-prompt-read-only inf-clojure-prompt-read-only) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this a defcustom and name it
inf-clojure-enable-eldoc
.