|
8 | 8 | ;; URL: https://github.com/elixir-lang/emacs-elixir |
9 | 9 | ;; Created: Mon Nov 7 2011 |
10 | 10 | ;; Keywords: languages elixir |
11 | | -;; Version: 1.3.0 |
| 11 | +;; Version: 2.0.1 |
12 | 12 |
|
13 | 13 | ;; This file is not a part of GNU Emacs. |
14 | 14 |
|
|
136 | 136 |
|
137 | 137 | (require 'elixir-smie) ; syntax and indentation support |
138 | 138 |
|
139 | | -(defvar elixir-mode--version "1.4.10") |
140 | | - |
141 | 139 | (defvar elixir-mode--website-url |
142 | 140 | "http://elixir-lang.org") |
143 | 141 |
|
@@ -541,10 +539,23 @@ Optional argument ARGS-P ." |
541 | 539 | (browse-url (concat elixir-mode--website-url "/docs/stable/elixir"))) |
542 | 540 |
|
543 | 541 | ;;;###autoload |
544 | | -(defun elixir-mode-show-version () |
545 | | - "Elixir mode print version." |
546 | | - (interactive) |
547 | | - (message (format "elixir-mode v%s" elixir-mode--version))) |
| 542 | +(defun elixir-mode-version (&optional show-version) |
| 543 | + "Get the Elixir-Mode version as string. |
| 544 | +
|
| 545 | +If called interactively or if SHOW-VERSION is non-nil, show the |
| 546 | +version in the echo area and the messages buffer. |
| 547 | +
|
| 548 | +The returned string includes both, the version from package.el |
| 549 | +and the library version, if both a present and different. |
| 550 | +
|
| 551 | +If the version number could not be determined, signal an error, |
| 552 | +if called interactively, or if SHOW-VERSION is non-nil, otherwise |
| 553 | +just return nil." |
| 554 | + (interactive (list t)) |
| 555 | + (let ((version (pkg-info-version-info 'elixir-mode))) |
| 556 | + (when show-version |
| 557 | + (message "Elixir-Mode version: %s" version)) |
| 558 | + version)) |
548 | 559 |
|
549 | 560 | (defun elixir-mode--code-eval-string-command (file) |
550 | 561 | (format "%s -e 'IO.puts inspect(elem(Code.eval_string(File.read!(\"%s\")), 0))'" |
@@ -625,7 +636,7 @@ Argument END End of the region." |
625 | 636 | "---" |
626 | 637 | ["elixir-mode on GitHub" elixir-mode-open-modegithub] |
627 | 638 | ["Elixir homepage" elixir-mode-open-elixirhome] |
628 | | - ["About" elixir-mode-show-version] |
| 639 | + ["About" elixir-mode-version] |
629 | 640 | )) |
630 | 641 |
|
631 | 642 | ;;;###autoload |
|
0 commit comments