From 7c7fb17da22346d5ed294080020a8a9572a070ba Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 15:01:59 +0100 Subject: [PATCH] update editorconfig --- .../dir | 0 .../editorconfig-autoloads.el | 40 +++----- .../editorconfig-conf-mode.el | 3 - .../editorconfig-core-handle.el | 3 - .../editorconfig-core.el | 7 -- .../editorconfig-fnmatch.el | 5 +- .../editorconfig-pkg.el | 2 +- .../editorconfig.el | 94 ++++++++++++++++++- .../editorconfig.info | 0 9 files changed, 108 insertions(+), 46 deletions(-) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/dir (100%) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/editorconfig-autoloads.el (77%) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/editorconfig-conf-mode.el (96%) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/editorconfig-core-handle.el (98%) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/editorconfig-core.el (97%) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/editorconfig-fnmatch.el (98%) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/editorconfig-pkg.el (82%) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/editorconfig.el (89%) rename elpa/{editorconfig-20190118.401 => editorconfig-20191025.806}/editorconfig.info (100%) diff --git a/elpa/editorconfig-20190118.401/dir b/elpa/editorconfig-20191025.806/dir similarity index 100% rename from elpa/editorconfig-20190118.401/dir rename to elpa/editorconfig-20191025.806/dir diff --git a/elpa/editorconfig-20190118.401/editorconfig-autoloads.el b/elpa/editorconfig-20191025.806/editorconfig-autoloads.el similarity index 77% rename from elpa/editorconfig-20190118.401/editorconfig-autoloads.el rename to elpa/editorconfig-20191025.806/editorconfig-autoloads.el index 3409b855..b22db0bc 100644 --- a/elpa/editorconfig-20190118.401/editorconfig-autoloads.el +++ b/elpa/editorconfig-20191025.806/editorconfig-autoloads.el @@ -1,12 +1,10 @@ ;;; editorconfig-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "editorconfig" "editorconfig.el" (0 0 0 0)) +;;;### (autoloads nil "editorconfig" "editorconfig.el" (23994 46775 +;;;;;; 385859 186000)) ;;; Generated autoloads from editorconfig.el (autoload 'editorconfig-apply "editorconfig" "\ @@ -51,12 +49,18 @@ Format buffer according to .editorconfig indent_style and indent_width. \(fn)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "editorconfig" '("editorconfig-"))) +(autoload 'editorconfig-version "editorconfig" "\ +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. + +\(fn &optional SHOW-VERSION)" t nil) ;;;*** ;;;### (autoloads nil "editorconfig-conf-mode" "editorconfig-conf-mode.el" -;;;;;; (0 0 0 0)) +;;;;;; (23994 46775 387237 773000)) ;;; Generated autoloads from editorconfig-conf-mode.el (autoload 'editorconfig-conf-mode "editorconfig-conf-mode" "\ @@ -66,12 +70,10 @@ Major mode for editing .editorconfig files. (add-to-list 'auto-mode-alist '("\\.editorconfig\\'" . editorconfig-conf-mode)) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "editorconfig-conf-mode" '("editorconfig-conf-mode-syntax-table"))) - ;;;*** ;;;### (autoloads nil "editorconfig-core" "editorconfig-core.el" -;;;;;; (0 0 0 0)) +;;;;;; (23994 46775 389628 618000)) ;;; Generated autoloads from editorconfig-core.el (autoload 'editorconfig-core-get-nearest-editorconfig "editorconfig-core" "\ @@ -101,20 +103,10 @@ hash object instead. \(fn &optional FILE CONFNAME CONFVERSION)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "editorconfig-core" '("editorconfig-core-"))) - -;;;*** - -;;;### (autoloads nil "editorconfig-core-handle" "editorconfig-core-handle.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from editorconfig-core-handle.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "editorconfig-core-handle" '("editorconfig-core-handle"))) - ;;;*** ;;;### (autoloads nil "editorconfig-fnmatch" "editorconfig-fnmatch.el" -;;;;;; (0 0 0 0)) +;;;;;; (23994 46775 382026 449000)) ;;; Generated autoloads from editorconfig-fnmatch.el (autoload 'editorconfig-fnmatch-p "editorconfig-fnmatch" "\ @@ -135,11 +127,10 @@ be used: \(fn STRING PATTERN)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "editorconfig-fnmatch" '("editorconfig-fnmatch-"))) - ;;;*** -;;;### (autoloads nil nil ("editorconfig-pkg.el") (0 0 0 0)) +;;;### (autoloads nil nil ("editorconfig-core-handle.el" "editorconfig-pkg.el") +;;;;;; (23994 46775 391699 251000)) ;;;*** @@ -147,6 +138,5 @@ be used: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; editorconfig-autoloads.el ends here diff --git a/elpa/editorconfig-20190118.401/editorconfig-conf-mode.el b/elpa/editorconfig-20191025.806/editorconfig-conf-mode.el similarity index 96% rename from elpa/editorconfig-20190118.401/editorconfig-conf-mode.el rename to elpa/editorconfig-20191025.806/editorconfig-conf-mode.el index 57d2a80f..07d0a88e 100644 --- a/elpa/editorconfig-20190118.401/editorconfig-conf-mode.el +++ b/elpa/editorconfig-20191025.806/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/elpa/editorconfig-20190118.401/editorconfig-core-handle.el b/elpa/editorconfig-20191025.806/editorconfig-core-handle.el similarity index 98% rename from elpa/editorconfig-20190118.401/editorconfig-core-handle.el rename to elpa/editorconfig-20191025.806/editorconfig-core-handle.el index 9685cc00..bb152364 100644 --- a/elpa/editorconfig-20190118.401/editorconfig-core-handle.el +++ b/elpa/editorconfig-20191025.806/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/elpa/editorconfig-20190118.401/editorconfig-core.el b/elpa/editorconfig-20191025.806/editorconfig-core.el similarity index 97% rename from elpa/editorconfig-20190118.401/editorconfig-core.el rename to elpa/editorconfig-20191025.806/editorconfig-core.el index ca19226f..1f061305 100644 --- a/elpa/editorconfig-20190118.401/editorconfig-core.el +++ b/elpa/editorconfig-20191025.806/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/elpa/editorconfig-20190118.401/editorconfig-fnmatch.el b/elpa/editorconfig-20191025.806/editorconfig-fnmatch.el similarity index 98% rename from elpa/editorconfig-20190118.401/editorconfig-fnmatch.el rename to elpa/editorconfig-20191025.806/editorconfig-fnmatch.el index 42dbd474..da8df0a0 100644 --- a/elpa/editorconfig-20190118.401/editorconfig-fnmatch.el +++ b/elpa/editorconfig-20191025.806/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 @@ -170,7 +167,7 @@ translation is found for PATTERN." (setq result `(,@result "[^/]*")))) (?? - (setq result `(,@result "."))) + (setq result `(,@result "[^/]"))) (?\[ (if in-brackets diff --git a/elpa/editorconfig-20190118.401/editorconfig-pkg.el b/elpa/editorconfig-20191025.806/editorconfig-pkg.el similarity index 82% rename from elpa/editorconfig-20190118.401/editorconfig-pkg.el rename to elpa/editorconfig-20191025.806/editorconfig-pkg.el index 254a548e..28748edf 100644 --- a/elpa/editorconfig-20190118.401/editorconfig-pkg.el +++ b/elpa/editorconfig-20191025.806/editorconfig-pkg.el @@ -1,4 +1,4 @@ -(define-package "editorconfig" "20190118.401" "EditorConfig Emacs Plugin" +(define-package "editorconfig" "20191025.806" "EditorConfig Emacs Plugin" '((cl-lib "0.5") (emacs "24")) :authors diff --git a/elpa/editorconfig-20190118.401/editorconfig.el b/elpa/editorconfig-20191025.806/editorconfig.el similarity index 89% rename from elpa/editorconfig-20190118.401/editorconfig.el rename to elpa/editorconfig-20191025.806/editorconfig.el index 67d4578d..4d382d2f 100644 --- a/elpa/editorconfig-20190118.401/editorconfig.el +++ b/elpa/editorconfig-20191025.806/editorconfig.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2011-2019 EditorConfig Team ;; Author: EditorConfig Team -;; Version: 0.7.14 +;; Version: 0.8.1 ;; URL: https://github.com/editorconfig/editorconfig-emacs#readme ;; Package-Requires: ((cl-lib "0.5") (emacs "24")) @@ -160,6 +160,7 @@ overwrite \"indent_style\" property when current `major-mode' is a ;; For contributors: Sort modes in alphabetical order '((apache-mode apache-indent-level) (awk-mode c-basic-offset) + (bpftrace-mode c-basic-offset) (c++-mode c-basic-offset) (c-mode c-basic-offset) (cmake-mode cmake-tab-width) @@ -169,8 +170,16 @@ overwrite \"indent_style\" property when current `major-mode' is a (csharp-mode c-basic-offset) (css-mode css-indent-offset) (emacs-lisp-mode lisp-indent-offset) + (enh-ruby-mode enh-ruby-indent-level) (erlang-mode erlang-indent-level) (ess-mode ess-indent-offset) + (f90-mode f90-associate-indent + f90-continuation-indent + f90-critical-indent + f90-do-indent + f90-if-indent + f90-program-indent + f90-type-indent) (feature-mode feature-indent-offset feature-indent-level) (fsharp-mode fsharp-continuation-offset @@ -185,6 +194,7 @@ overwrite \"indent_style\" property when current `major-mode' is a haskell-indentation-where-post-offset haskell-indentation-where-pre-offset shm-indent-spaces) + (haxor-mode haxor-tab-width) (idl-mode c-basic-offset) (jade-mode jade-tab-width) (java-mode c-basic-offset) @@ -195,12 +205,15 @@ overwrite \"indent_style\" property when current `major-mode' is a (js3-mode js3-indent-level) (json-mode js-indent-level) (julia-mode julia-indent-offset) + (kotlin-mode kotlin-tab-width) (latex-mode . editorconfig-set-indentation-latex-mode) (lisp-mode lisp-indent-offset) (livescript-mode livescript-tab-width) (lua-mode lua-indent-level) (matlab-mode matlab-indent-level) + (mips-mode mips-tab-width) (mustache-mode mustache-basic-offset) + (nasm-mode nasm-basic-offset) (nginx-mode nginx-indent-level) (nxml-mode nxml-child-indent (nxml-attribute-indent . 2)) (objc-mode c-basic-offset) @@ -218,6 +231,7 @@ overwrite \"indent_style\" property when current `major-mode' is a (python-mode . editorconfig-set-indentation-python-mode) (ruby-mode ruby-indent-level) (rust-mode rust-indent-offset) + (rustic-mode rustic-indent-offset) (scala-mode scala-indent:step) (scss-mode css-indent-offset) (sgml-mode sgml-basic-offset) @@ -225,6 +239,7 @@ overwrite \"indent_style\" property when current `major-mode' is a (slim-mode slim-indent-offset) (tcl-mode tcl-indent-level tcl-continued-indent-level) + (terra-mode terra-indent-level) (typescript-mode typescript-indent-level) (verilog-mode verilog-indent-level verilog-indent-level-behavioral @@ -305,6 +320,9 @@ Otherwise, use `delete-trailing-whitespace'." Set by `editorconfig-apply' and nil if that is not invoked in current buffer yet.") (make-variable-buffer-local 'editorconfig-properties-hash) +(put 'editorconfig-properties-hash + 'permanent-local + t) (defvar editorconfig-lisp-use-default-indent nil "Selectively ignore the value of indent_sizefor Lisp files. @@ -471,6 +489,24 @@ to non-nil when FINAL-NEWLINE is true." (> (string-to-number length) 0)) (setq fill-column (string-to-number length)))) +(defvar editorconfig-file-type-emacs-whitelist + (append (mapcar 'car + editorconfig-indentation-alist) + '(conf-mode)) + "List of known `major-mode' that can be used for file_type_emacs value.") + +;; Emacs<26 does not have provided-mode-derived-p +(defun editorconfig--provided-mode-derived-p (mode &rest modes) + "Non-nil if MODE is derived from one of MODES. +Uses the `derived-mode-parent' property of the symbol to trace backwards. +If you just want to check `major-mode', use `derived-mode-p'." + (if (fboundp 'provided-mode-derived-p) + (apply 'provided-mode-derived-p mode modes) + (while (and (not (memq mode modes)) + (setq mode (get mode 'derived-mode-parent)))) + mode)) + + (defun editorconfig-set-major-mode-from-name (filetype) "Set buffer `major-mode' by FILETYPE. @@ -482,7 +518,12 @@ FILETYPE should be s string like `\"ini\"`, if not nil or empty string." "-mode"))))) (when mode (if (fboundp mode) - (editorconfig-apply-major-mode-safely mode) + (if (apply 'editorconfig--provided-mode-derived-p mode + editorconfig-file-type-emacs-whitelist) + (editorconfig-apply-major-mode-safely mode) + (display-warning :error (format "Major-mode `%S' is not listed in `%S'" + mode + 'editorconfig-file-type-emacs-whitelist))) (display-warning :error (format "Major-mode `%S' not found" mode)) nil)))) @@ -663,7 +704,13 @@ To disable EditorConfig in some buffers, modify ;; See https://github.com/editorconfig/editorconfig-emacs/issues/141 for why ;; not `after-change-major-mode-hook' (dolist (hook '(change-major-mode-after-body-hook - read-only-mode-hook)) + read-only-mode-hook + ;; Some modes call `kill-all-local-variables' in their init + ;; code, which clears some values set by editorconfig. + ;; For those modes, editorconfig-apply need to be called + ;; explicitly through their hooks. + rpm-spec-mode-hook + )) (if editorconfig-mode (add-hook hook 'editorconfig-mode-apply) (remove-hook hook 'editorconfig-mode-apply)))) @@ -715,6 +762,47 @@ 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)) + (let* ((version + (with-temp-buffer + (require 'find-func) + (insert-file-contents (find-library-name "editorconfig")) + (require 'lisp-mnt) + (lm-version))) + (pkg + (and (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))) + (when show-version + (message "EditorConfig Emacs v%s" + version-full)) + version-full)) + (provide 'editorconfig) ;;; editorconfig.el ends here diff --git a/elpa/editorconfig-20190118.401/editorconfig.info b/elpa/editorconfig-20191025.806/editorconfig.info similarity index 100% rename from elpa/editorconfig-20190118.401/editorconfig.info rename to elpa/editorconfig-20191025.806/editorconfig.info -- 2.47.3