Closed bbuccianti closed 5 years ago
Thanks for the patch! Small proposal: (monroe-eval-namespace)
can be refactored to use (monroe-get-clojure-ns)
. Idea:
(defun monroe-get-clojure-ns ()
"If available, get the correct clojure namespace."
(and (eq major-mode 'clojure-mode)
(fboundp 'clojure-find-ns)
(funcall 'clojure-find-ns)))
(defun monroe-eval-namespace ()
"Tries to evaluate Clojure ns form. It does this by matching first
expression at the beginning of the file and evaluating it. Not something
that is 100% accurate, but Clojure practice is to keep ns forms always
at the top of the file."
(interactive)
(when (monroe-get-clojure-ns)
(save-excursion
(goto-char (match-beginning 0))
(monroe-eval-defun))))
I'm learning this workflow of making a fork in order to pull request. Hope this last commit was correct.
Thank you very much!
All good. I'll fix in case of any issue. Thanks and good work!
Hi, Sanel!
Hope this makes sense, I was having the trouble to eval-buffer because eval-defun complains about not finding aliases included on the ns :require.
Let me know if anything can be improved, I'm only a student but I think that with a little help can be able to understand.
Thanks!