Skip to content

Commit 344e382

Browse files
author
Carlos Requena López
committed
[Fix clojure-emacs#506] Makes display version command return the actual version
`clojure-mode-display-version` displays the correct version (was displaying nil) also added some tests
1 parent 7943b29 commit 344e382

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Bugs fixed
66

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

910
## 5.10.0 (2019-01-05)
1011

clojure-mode.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@
8181
:link '(url-link :tag "GitHub" "https://github.com/clojure-emacs/clojure-mode")
8282
:link '(emacs-commentary-link :tag "Commentary" "clojure-mode"))
8383

84-
(defconst clojure-mode-version (lm-version)
84+
(defconst clojure-mode-version
85+
(let ((thisbuffer (or load-file-name buffer-file-name)))
86+
(with-temp-buffer (insert-file-contents thisbuffer)
87+
(lm-version)))
8588
"The current version of `clojure-mode'.")
8689

8790
(defface clojure-keyword-face

test/clojure-mode-util-test.el

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
(require 'cl-lib)
2727
(require 'ert)
2828

29+
30+
(ert-deftest clojure-mode-version-should-be-non-nil ()
31+
(should (not (eq clojure-mode-version nil))))
32+
2933
(let ((project-dir "/home/user/projects/my-project/")
3034
(clj-file-path "/home/user/projects/my-project/src/clj/my_project/my_ns/my_file.clj")
3135
(project-relative-clj-file-path "src/clj/my_project/my_ns/my_file.clj")

0 commit comments

Comments
 (0)