diff --git a/bin/editorconfig-el b/bin/editorconfig-el index fb3d4d41..7a559eef 100755 --- a/bin/editorconfig-el +++ b/bin/editorconfig-el @@ -43,6 +43,7 @@ load-path))) (require 'cl-lib) +(require 'editorconfig) ; For `editorconfig-version' (require 'editorconfig-core) (defconst editorconfig-bin-help-message @@ -80,8 +81,8 @@ with required output." (message editorconfig-bin-help-message) (kill-emacs 0)) ((-v --version) - (princ (format "EditorConfig-Core-EmacsLisp Version %s\n" - editorconfig-core-version)) + (princ (format "EditorConfig-EmacsLisp Version %s\n" + (editorconfig-version))) (kill-emacs 0)) (otherwise diff --git a/editorconfig-conf-mode.el b/editorconfig-conf-mode.el index 57d2a80f..07d0a88e 100644 --- a/editorconfig-conf-mode.el +++ b/editorconfig-conf-mode.el @@ -3,9 +3,6 @@ ;; Copyright (C) 2011-2019 EditorConfig Team ;; Author: EditorConfig Team -;; URL: https://github.com/editorconfig/editorconfig-emacs#readme -;; Version: 0.7.14 -;; Package-Requires: ((emacs "24")) ;; See ;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors diff --git a/editorconfig-core-handle.el b/editorconfig-core-handle.el index 9685cc00..bb152364 100644 --- a/editorconfig-core-handle.el +++ b/editorconfig-core-handle.el @@ -3,9 +3,6 @@ ;; Copyright (C) 2011-2019 EditorConfig Team ;; Author: EditorConfig Team -;; URL: https://github.com/editorconfig/editorconfig-emacs#readme -;; Version: 0.7.14 -;; Package-Requires: ((emacs "24")) ;; See ;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors diff --git a/editorconfig-core.el b/editorconfig-core.el index ca19226f..1f061305 100644 --- a/editorconfig-core.el +++ b/editorconfig-core.el @@ -3,9 +3,6 @@ ;; Copyright (C) 2011-2019 EditorConfig Team ;; Author: EditorConfig Team -;; URL: https://github.com/editorconfig/editorconfig-emacs#readme -;; Version: 0.7.14 -;; Package-Requires: ((emacs "24")) ;; See ;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors @@ -72,10 +69,6 @@ (require 'editorconfig-core-handle) -(defconst editorconfig-core-version - "0.7.14" - "EditorConfig core version.") - (defun editorconfig-core--get-handles (dir confname &optional result) "Get list of EditorConfig handlers for DIR from CONFNAME. diff --git a/editorconfig-fnmatch.el b/editorconfig-fnmatch.el index 42dbd474..68727e5e 100644 --- a/editorconfig-fnmatch.el +++ b/editorconfig-fnmatch.el @@ -3,9 +3,6 @@ ;; Copyright (C) 2011-2019 EditorConfig Team ;; Author: EditorConfig Team -;; URL: https://github.com/editorconfig/editorconfig-emacs#readme -;; Version: 0.7.14 -;; Package-Requires: ((emacs "24")) ;; See ;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors diff --git a/editorconfig.el b/editorconfig.el index 67d4578d..d7760009 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -715,6 +715,34 @@ To disable EditorConfig in some buffers, modify (indent-region (point-min) (point-max))) + +;; (defconst editorconfig--version +;; (eval-when-compile +;; (require 'lisp-mnt) +;; (declare-function lm-version "lisp-mnt" nil) +;; (lm-version)) +;; "EditorConfig version.") + +(declare-function find-library-name "find-func" (library)) +(declare-function lm-version "lisp-mnt" nil) + +;;;###autoload +(defun editorconfig-version (&optional show-version) + "Get EditorConfig version as string. + +If called interactively or if SHOW-VERSION is non-nil, show the +version in the echo area and the messages buffer." + (interactive (list t)) + (with-temp-buffer + (require 'find-func) + (insert-file-contents (find-library-name "editorconfig")) + (require 'lisp-mnt) + (let ((version (lm-version))) + (when show-version + (message "EditorConfig Emacs v%s" + version)) + version))) + (provide 'editorconfig) ;;; editorconfig.el ends here