Skip to content

Commit

Permalink
Add var
Browse files Browse the repository at this point in the history
  • Loading branch information
10sr committed Mar 22, 2019
1 parent 3f6f9b4 commit e72fe20
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions editorconfig.el
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,16 @@ To disable EditorConfig in some buffers, modify
(indent-region (point-min) (point-max)))


(defvar editorconfig--version
(eval-when-compile
(require 'package)
(let* ((pkg (with-temp-buffer
(insert-file-contents (symbol-file 'editorconfig-version))
(package-buffer-info)))
(version (package-version-join (package-desc-version pkg))))
version))
"EditorConfig version.")

;;;###autoload
(defun editorconfig-version (&optional show-version)
"Get EditorConfig version as string.
Expand All @@ -726,13 +736,13 @@ The returned string includes both, the version from package.el
and the library version, if both a present and different."
(interactive (list t))
(require 'package)
(let* ((pkg (with-temp-buffer
(insert-file-contents (symbol-file 'editorconfig-version))
(package-buffer-info)))
(version (package-version-join (package-desc-version pkg))))
(when show-version
(message "EditorConfig-Emacs %s" version))
version))
;; (let* ((pkg (with-temp-buffer
;; (insert-file-contents (symbol-file 'editorconfig-version))
;; (package-buffer-info)))
;; (version (package-version-join (package-desc-version pkg))))
(when show-version
(message "EditorConfig-Emacs %s" editorconfig--version))
editorconfig--version)

(provide 'editorconfig)

Expand Down

0 comments on commit e72fe20

Please sign in to comment.