Skip to content

Commit

Permalink
[Fix #506] Makes display version command return the actual version
Browse files Browse the repository at this point in the history
`clojure-mode-display-version` displays the correct version (was displaying nil)

also added some tests
  • Loading branch information
Carlos Requena López committed Feb 25, 2019
1 parent 7943b29 commit 344e382
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Bugs fixed

* Dynamic vars whose names contain non-alphanumeric characters are now font-locked correctly.
* [#506](https://github.com/clojure-emacs/clojure-mode/issues/506): `clojure-mode-display-version` correctly displays the package's version

## 5.10.0 (2019-01-05)

Expand Down
5 changes: 4 additions & 1 deletion clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
:link '(url-link :tag "GitHub" "https://github.com/clojure-emacs/clojure-mode")
:link '(emacs-commentary-link :tag "Commentary" "clojure-mode"))

(defconst clojure-mode-version (lm-version)
(defconst clojure-mode-version
(let ((thisbuffer (or load-file-name buffer-file-name)))
(with-temp-buffer (insert-file-contents thisbuffer)
(lm-version)))
"The current version of `clojure-mode'.")

(defface clojure-keyword-face
Expand Down
4 changes: 4 additions & 0 deletions test/clojure-mode-util-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
(require 'cl-lib)
(require 'ert)


(ert-deftest clojure-mode-version-should-be-non-nil ()
(should (not (eq clojure-mode-version nil))))

(let ((project-dir "/home/user/projects/my-project/")
(clj-file-path "/home/user/projects/my-project/src/clj/my_project/my_ns/my_file.clj")
(project-relative-clj-file-path "src/clj/my_project/my_ns/my_file.clj")
Expand Down

0 comments on commit 344e382

Please sign in to comment.