confname
(cons handle result)))))
-;;;###autoload
(defun editorconfig-core-get-nearest-editorconfig (directory)
"Return path to .editorconfig file that is closest to DIRECTORY."
(when-let* ((handle (car (last
".editorconfig")))))
(editorconfig-core-handle-path handle)))
-;;;###autoload
(defun editorconfig-core-get-properties (&optional file confname confversion)
"Get EditorConfig properties for FILE.
If FILE is not given, use currently visiting file.
(maphash (lambda (key value) (puthash key value into)) update)
into)
-;;;###autoload
(defun editorconfig-core-get-properties-hash (&optional file confname confversion)
"Get EditorConfig properties for FILE.
If FILE is not given, use currently visiting file.
;; Author: EditorConfig Team <editorconfig@googlegroups.com>
;; Version: 0.11.0
;; URL: https://github.com/editorconfig/editorconfig-emacs#readme
-;; Package-Requires: ((emacs "26.1") (nadvice "0.3"))
+;; Package-Requires: ((emacs "26.1"))
;; Keywords: convenience editorconfig
;; See
;;; Code:
(require 'cl-lib)
-(require 'pcase)
-(require 'nadvice)
-
-(eval-when-compile
- (require 'rx)
- (require 'subr-x)
- (defvar tex-indent-basic)
- (defvar tex-indent-item)
- (defvar tex-indent-arg)
- (defvar evil-shift-width))
+(eval-when-compile (require 'subr-x))
(require 'editorconfig-core)
;; (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))
- (let* ((version (with-temp-buffer
- (require 'find-func)
- (insert-file-contents (find-library-name "editorconfig"))
- (require 'lisp-mnt)
- (lm-version)))
- (pkg (and (eval-and-compile (require 'package nil t))
- (cadr (assq 'editorconfig
- package-alist))))
- (pkg-version (and pkg
- (package-version-join (package-desc-version pkg))))
- (version-full (if (and pkg-version
- (not (string= version pkg-version)))
- (concat version "-" pkg-version)
- version)))
+ (let ((version-full
+ (if (fboundp 'package-get-version)
+ (package-get-version)
+ (let* ((version
+ (with-temp-buffer
+ (require 'find-func)
+ (declare-function find-library-name "find-func" (library))
+ (insert-file-contents (find-library-name "editorconfig"))
+ (require 'lisp-mnt)
+ (declare-function lm-version "lisp-mnt" nil)
+ (lm-version)))
+ (pkg (and (eval-and-compile (require 'package nil t))
+ (cadr (assq 'editorconfig
+ package-alist))))
+ (pkg-version (and pkg (package-version-join
+ (package-desc-version pkg)))))
+ (if (and pkg-version
+ (not (string= version pkg-version)))
+ (concat version "-" pkg-version)
+ version)))))
(when show-version
(message "EditorConfig Emacs v%s" version-full))
version-full))