diff --git a/lisp/editorconfig-core.el b/lisp/editorconfig-core.el index 46fdcf04385..bf7f0ef3def 100644 --- a/lisp/editorconfig-core.el +++ b/lisp/editorconfig-core.el @@ -39,18 +39,16 @@ ;; and fallback to this library if not found. ;; If you always want to use this library, add following lines to your init.el: -;; (setq editorconfig-get-properties-function -;; 'editorconfig-core-get-properties-hash) - - ;; Functions -;; editorconfig-core-get-properties-hash (&optional file confname confversion) +;; editorconfig-core-get-properties-hash (&optional file confname) ;; Get EditorConfig properties for FILE. -;; This function is almost same as `editorconfig-core-get-properties', but -;; returns hash object instead. +;; If FILE is not given, use currently visiting file. +;; Give CONFNAME for basename of config file other than .editorconfig. + +;; This functions returns hash table of properties' values. ;;; Code: @@ -95,11 +93,10 @@ When the same key exists in both two hashes, values of UPDATE takes precedence." (maphash (lambda (key value) (puthash key value into)) update) into) -(defun editorconfig-core-get-properties-hash (&optional file confname confversion) +(defun editorconfig-core-get-properties-hash (&optional file confname) "Get EditorConfig properties for FILE. If FILE is not given, use currently visiting file. Give CONFNAME for basename of config file other than .editorconfig. -If need to specify config format version, give CONFVERSION. This function is almost same as `editorconfig-core-get-properties', but returns hash object instead." @@ -108,7 +105,6 @@ hash object instead." buffer-file-name (error "FILE is not given and `buffer-file-name' is nil")))) (setq confname (or confname ".editorconfig")) - (setq confversion (or confversion "0.12.0")) (let ((result (make-hash-table))) (dolist (handle (editorconfig-core--get-handles (file-name-directory file) confname)) @@ -123,35 +119,6 @@ hash object instead." (when-let* ((val (gethash key result))) (puthash key (downcase val) result))) - ;; Add indent_size property - ;; FIXME: Why? Which part of the spec requires that? - ;;(let ((v-indent-size (gethash 'indent_size result)) - ;; (v-indent-style (gethash 'indent_style result))) - ;; (when (and (not v-indent-size) - ;; (string= v-indent-style "tab") - ;; ;; If VERSION < 0.9.0, indent_size should have no default value - ;; (version<= "0.9.0" - ;; confversion)) - ;; (puthash 'indent_size - ;; "tab" - ;; result))) - ;; Add tab_width property - ;; FIXME: Why? Which part of the spec requires that? - ;;(let ((v-indent-size (gethash 'indent_size result)) - ;; (v-tab-width (gethash 'tab_width result))) - ;; (when (and v-indent-size - ;; (not v-tab-width) - ;; (not (string= v-indent-size "tab"))) - ;; (puthash 'tab_width v-indent-size result))) - ;; Update indent-size property - ;; FIXME: Why? Which part of the spec requires that? - ;;(let ((v-indent-size (gethash 'indent_size result)) - ;; (v-tab-width (gethash 'tab_width result))) - ;; (when (and v-indent-size - ;; v-tab-width - ;; (string= v-indent-size "tab")) - ;; (puthash 'indent_size v-tab-width result))) - result)) (provide 'editorconfig-core) diff --git a/lisp/editorconfig-fnmatch.el b/lisp/editorconfig-fnmatch.el index 2e6ae466f43..7664ce23d17 100644 --- a/lisp/editorconfig-fnmatch.el +++ b/lisp/editorconfig-fnmatch.el @@ -1,6 +1,6 @@ ;;; editorconfig-fnmatch.el --- Glob pattern matching -*- lexical-binding: t -*- -;; Copyright (C) 2011-2025 Free Software Foundation, Inc. +;; Copyright (C) 2011-2025 Free Software Foundation, Inc. ;; Author: EditorConfig Team ;; Package: editorconfig @@ -55,13 +55,9 @@ (require 'cl-lib) -(defvar editorconfig-fnmatch--cache-hashtable - nil +(defconst editorconfig-fnmatch--cache-hashtable ;; Clear cache on file reload. + (make-hash-table :test 'equal) "Cache of shell pattern and its translation.") -;; Clear cache on file reload -(setq editorconfig-fnmatch--cache-hashtable - (make-hash-table :test 'equal)) - (defconst editorconfig-fnmatch--left-brace-regexp "\\(^\\|[^\\]\\){" @@ -147,7 +143,7 @@ translation is found for PATTERN." (while (< index length) (if (and (not is-escaped) - (string-match "[^]\\*?[{},/-]+" + (string-match "[^]\\*?[{},/]+" ;;(string-match "[^]\\*?[{},/\\-]+" "?.a") pattern index) @@ -203,8 +199,6 @@ translation is found for PATTERN." "[^") "["))))) - (?- (if in-brackets "-" "\\-")) - (?\] (setq in-brackets nil) "]") (?\{ @@ -249,7 +243,7 @@ translation is found for PATTERN." (?, (if (and (> brace-level 0) (not is-escaped)) - "\\|" "\\,")) + "\\|" ",")) (?\} (if (and (> brace-level 0) diff --git a/lisp/editorconfig.el b/lisp/editorconfig.el index 42ff3038b92..8978e6da96b 100644 --- a/lisp/editorconfig.el +++ b/lisp/editorconfig.el @@ -146,7 +146,6 @@ This hook will be run even when there are no matching sections in (d-mode c-basic-offset) (elixir-ts-mode elixir-ts-indent-offset) (emacs-lisp-mode . editorconfig--get-indentation-lisp-mode) - (ess-mode ess-indent-offset) (f90-mode f90-associate-indent f90-continuation-indent f90-critical-indent @@ -211,7 +210,6 @@ This hook will be run even when there are no matching sections in (scala-mode scala-indent:step) (scss-mode css-indent-offset) (swift-mode swift-mode:basic-offset) - (terra-mode terra-indent-level) (tcl-mode tcl-indent-level tcl-continued-indent-level) (toml-ts-mode toml-ts-mode-indent-offset)