Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “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? Sign in to your account

clojure-mode-display-version not working #506

Closed
carlosgeos opened this issue Jan 21, 2019 · 2 comments
Closed

clojure-mode-display-version not working #506

carlosgeos opened this issue Jan 21, 2019 · 2 comments

Comments

@carlosgeos
Copy link
Contributor

carlosgeos commented Jan 21, 2019

Expected behavior

Running clojure-mode-display-version should return:

clojure-mode (version 5.10.0)

Actual behavior

Returns

clojure-mode (version nil)

Steps to reproduce the problem

Start Emacs. Open a .clj buffer. Run clojure-mode-display-version

Environment & Version information

clojure-mode version information

wish I could

Emacs version

26.1

Operating system

Biebian

PR submitted

carlosgeos pushed a commit to carlosgeos/clojure-mode that referenced this issue Jan 21, 2019
lower case v for version in file headers
@carlosgeos
Copy link
Contributor Author

carlosgeos commented Jan 21, 2019

The problem seems to be (lm-version) doesn't have the buffer available when clojure-mode.el is being executed (loaded).

The following code works for me

(defconst clojure-mode-version
  (with-current-buffer (find-file-noselect "~/.emacs.d/elpa/clojure-mode-20190105.1043/clojure-mode.el")
    (lm-version))
  "The current version of `clojure-mode'.")

So this works too:

(defconst clojure-mode-version
  (with-current-buffer (find-file-noselect load-file-name)
    (lm-version))
  "The current version of `clojure-mode'.")

And using something like (or load-file-name buffer-file-name) it can work also when visiting the buffer.

If loading, the buffer would have to be closed afterwards. Otherwise Emacs starts with a clojure-mode.el buffer open !

Should I submit a PR with these changes, or with a simple constant (dropping (lm-version)) ?

@carlosgeos carlosgeos reopened this Jan 21, 2019
carlosgeos pushed a commit to carlosgeos/clojure-mode that referenced this issue Jan 21, 2019
the the content should be (at least) the headers up to Version, so
that (lm-version) can fetch it.
carlosgeos pushed a commit to carlosgeos/clojure-mode that referenced this issue Feb 21, 2019
lower case v for version in file headers
carlosgeos pushed a commit to carlosgeos/clojure-mode that referenced this issue Feb 21, 2019
the the content should be (at least) the headers up to Version, so
that (lm-version) can fetch it.
cichli added a commit to cichli/clojure-mode that referenced this issue Feb 27, 2019
@cichli cichli closed this as completed in 344e382 Feb 27, 2019
@carlosgeos
Copy link
Contributor Author

This issue still persists, the problem occurs when emacs loads the byte compiled file clojure-mode.elc. If it is deleted and emacs loads clojure-mode.el, it works.

carlosgeos pushed a commit to carlosgeos/clojure-mode that referenced this issue Feb 28, 2019
…al version

`clojure-mode-display-version` displays the correct version (was displaying nil)

also added some tests
carlosgeos pushed a commit to carlosgeos/clojure-mode that referenced this issue Feb 28, 2019
…al version

`clojure-mode-display-version` displays the correct version (was displaying nil)

also added some tests
carlosgeos pushed a commit to carlosgeos/clojure-mode that referenced this issue Feb 28, 2019
`clojure-mode-display-version` was displaying nil when clojure-mode.elc was
loaded, since (lm-version) had no access to the file headers.
bbatsov pushed a commit that referenced this issue Mar 2, 2019
`clojure-mode-display-version` was displaying nil when clojure-mode.elc was
loaded, since (lm-version) had no access to the file headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant