Skip to content

Commit 2d6ccab

Browse files
committed
Merge pull request #507 from carlosgeos/fix-506
[Fix #506] fix clojure-mode-display-version
2 parents 22f5395 + 344e382 commit 2d6ccab

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
@@ -7,6 +7,7 @@
77
* Dynamic vars whose names contain non-alphanumeric characters are now font-locked correctly.
88
* [#445 (comment)](https://github.com/clojure-emacs/clojure-mode/issues/445#issuecomment-340460753): Proper font lock for namespaced keywords like for example `(s/def ::keyword)`
99
* [#508](https://github.com/clojure-emacs/clojure-mode/issues/508): Fix font lock for namespaces with metadata
10+
* [#506](https://github.com/clojure-emacs/clojure-mode/issues/506): `clojure-mode-display-version` correctly displays the package's version
1011

1112
## 5.10.0 (2019-01-05)
1213

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)