-
-
Notifications
You must be signed in to change notification settings - Fork 44
Introduce inf-clojure-reload #132
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Conversation
inf-clojure.el
Outdated
|
||
- C-u M-x `inf-clojure-reload': prompts for a namespace name. | ||
- M-- M-x `inf-clojure-reload': inverts the default reload command | ||
- M-- C-u M-x `inf-clojure-reload': inverts default AND prompts for a namespace name." |
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.
There is probably better syntax for this documentation
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.
http://ergoemacs.org/emacs/inline_doc.html
Anyways, this will do for now.
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.
Btw, having 3 ways to invoke something becomes pretty confusing very fast - normally people do just single and double prefix arguments. I think the default inversion is a bit too much. I'd just drop this and the config and do two commands probably.
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.
It's just that they are so similar that you usually think of it as same. That is the reason why the same key binding is used.
The inversion of the default can be indeed dropped and we can just always default for reload
. With M--
reload-all
.
I have used this for a week now and found it good enough.
inf-clojure.el
Outdated
- M-- C-u M-x `inf-clojure-reload': inverts default AND prompts for a namespace name." | ||
(interactive "P") | ||
(let* ((proc (inf-clojure-proc)) | ||
(invert? (or (equal current-prefix-arg "-") (equal current-prefix-arg '(-4)))) |
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.
arg
is your prefix argument, so no need to use current-prefix-argument
.
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.
Will change
inf-clojure.el
Outdated
(interactive "P") | ||
(let* ((proc (inf-clojure-proc)) | ||
(invert? (or (equal current-prefix-arg "-") (equal current-prefix-arg '(-4)))) | ||
(prompt? (or (equal current-prefix-arg '(4)) (equal current-prefix-arg '(-4)))) |
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.
Remember we don't use ?
in Emacs - it's p
there.
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.
Right!
inf-clojure.el
Outdated
@@ -702,6 +746,35 @@ is present it will be used instead of the current file." | |||
(when switch-to-repl | |||
(inf-clojure-switch-to-repl t)))) | |||
|
|||
(defcustom inf-clojure-reload-default t |
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.
Why not 'reload
and 'reload-all
? Boolean predicate for this seems pretty confusing to me. It's better to use a symbol.
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.
I will probably drop this
ebbde4e
to
d8b1cc9
Compare
@bbatsov I have just noticed that there is a similar key binding in |
d8b1cc9
to
d74bab4
Compare
inf-clojure.el
Outdated
@@ -131,6 +131,7 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword | |||
(define-key map "\C-c\C-c" #'inf-clojure-eval-defun) ; SLIME/CIDER style | |||
(define-key map "\C-c\C-b" #'inf-clojure-eval-buffer) | |||
(define-key map "\C-c\C-r" #'inf-clojure-eval-region) | |||
(define-key map "\C-cM-r" #'inf-clojure-reload) |
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.
I think you missed a \
here.
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.
Yeah will fix today thanks!
It will evaluate (require 'ns :reload) or (require 'ns :reload-all) at the REPL, depending on the arguments passed in. This works only from source buffers at the moment (like all the other namespace commands).
d74bab4
to
2cccb5d
Compare
It will evaluate (require 'ns :reload) or (require 'ns :reload-all) at the
REPL, depending on the arguments passed in.
C-u M-x inf-clojure-reload
: prompts for a namespace name.M-- M-x inf-clojure-reload
: executes (require ... :reload-all).M-- C-u M-x inf-clojure-reload
: reloads all AND prompts."This works only from source buffers at the moment (like all the other namespace commands).
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
M-x checkdoc
warningsThanks!