From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 09:44:50 2024 Received: (at submit) by debbugs.gnu.org; 31 Mar 2024 13:44:50 +0000 Received: from localhost ([127.0.0.1]:46806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqvUO-0007yj-D1 for submit@debbugs.gnu.org; Sun, 31 Mar 2024 09:44:50 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqvUI-0007xr-08 for submit@debbugs.gnu.org; Sun, 31 Mar 2024 09:44:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqvU9-0006nG-5z for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 09:44:33 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqvU4-0007g2-R7 for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 09:44:32 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 96DD0440991 for ; Sun, 31 Mar 2024 09:44:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1711892655; bh=V6orYS6Oe0oEkZVv1FZH1Y2idQcxQcryy+ooQEM5LtU=; h=From:To:Subject:Date:From; b=MxRkooy+DFKb0JGtCGZfWhCqSBVuLLb5y9p/7lHSXBuz8tgVPJWW50qBOjgfjsVkS Qnucrb6BjHl2LT0ro45RVV1XBhnvTWbcDHUB0qcjvHTiwhnIoNRDXCvAIIvF5rR2BH ackfVrEvR8mvggEZOp9WH9+eQQrOVTRwrQihfpaoKSpU4JN3F7eYXmNbYUW4cBjTTf pFsaa2kiiWQWW1JrMTp/ghYXuzDom+GCCi+YDBkwl6N0moJ5YwIGljLZzZ3VOey2pI nDTOIu00LIPs8AKT5o6QUQ/dX+nIqjKFSX+5sL0HLJwKoG4vqr4mbomXTD+P3OIpVC nSg3KqCGVwF1g== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 799934401F4 for ; Sun, 31 Mar 2024 09:44:15 -0400 (EDT) Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 524BF1201E7 for ; Sun, 31 Mar 2024 09:44:15 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Emacs should support EditorConfig out of the box X-Debbugs-Cc: monnier@iro.umontreal.ca Date: Sun, 31 Mar 2024 09:44:00 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.158 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [185.199.110.153, 185.199.111.153, 185.199.109.153, 185.199.108.153] X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) Package: Emacs Version: 30.0.50 https://editorconfig.org/ seems to be a popular standard to specify settings such as the size of an indentation step in an editor-agnostic way. There's an `editorconfig` package for it up on NonGNU ELPA, but I think we should support it out of the box. Stefan In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2024-03-28 built on pastel Repository revision: 751b97741c49abf50558e526ee4a8315a412a0e7 Repository branch: work Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Debian GNU/Linux 12 (bookworm) Configured using: 'configure -C --enable-checking --enable-check-lisp-object-type --with-modules --with-cairo --with-tiff=ifavailable 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign' --without-native-compilation PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: fr_CH.UTF-8 locale-coding-system: utf-8-unix Major mode: InactiveMinibuffer Minor modes in effect: server-mode: t electric-pair-mode: t global-reveal-mode: t reveal-mode: t auto-insert-mode: t savehist-mode: t minibuffer-electric-default-mode: t type-break-mode: t global-compact-docstrings-mode: t global-corfu-mode: t url-handler-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t minibuffer-regexp-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/monnier/src/emacs/nongnu/packages/jade-mode/jade-mode hides /home/monnier/src/emacs/nongnu/packages/stylus-mode/jade-mode /home/monnier/src/emacs/nongnu/packages/jade-mode/sws-mode hides /home/monnier/src/emacs/nongnu/packages/stylus-mode/sws-mode /home/monnier/src/emacs/nongnu/packages/jade-mode/stylus-mode hides /home/monnier/src/emacs/nongnu/packages/stylus-mode/stylus-mode /home/monnier/src/emacs/nongnu/packages/paredit/test hides /home/monnier/src/emacs/elpa/packages/easy-kill/test /home/monnier/src/emacs/elpa/packages/embark-consult/embark-consult hides /home/monnier/src/emacs/elpa/packages/embark/embark-consult /home/monnier/src/emacs/elpa/packages/embark-consult/embark-org hides /home/monnier/src/emacs/elpa/packages/embark/embark-org /home/monnier/src/emacs/elpa/packages/embark-consult/embark hides /home/monnier/src/emacs/elpa/packages/embark/embark /home/monnier/src/emacs/elpa/packages/embark-consult/avy-embark-collect hides /home/monnier/src/emacs/elpa/packages/embark/avy-embark-collect /home/monnier/src/emacs/elpa/packages/ada-mode/prj hides /home/monnier/src/emacs/elpa/packages/gpr-query/prj /home/monnier/src/emacs/elpa/packages/idlwave/lpath hides /home/monnier/src/emacs/elpa/packages/auctex/lpath /home/monnier/src/emacs/nongnu/packages/forth-mode/build hides /home/monnier/src/emacs/elpa/packages/lentic/build /home/monnier/src/emacs/elpa/packages/ef-themes/theme-loaddefs hides /home/monnier/src/emacs/elpa/packages/modus-themes/theme-loaddefs /home/monnier/src/emacs/nongnu/packages/paredit/test hides /home/monnier/src/emacs/elpa/packages/num3-mode/test /home/monnier/src/emacs/nongnu/packages/org-contrib/lisp/ob-asymptote hides /home/monnier/src/emacs/elpa/packages/ob-asymptote/ob-asymptote /home/monnier/src/emacs/elpa/packages/realgud-lldb/cask-install hides /home/monnier/src/emacs/elpa/packages/realgud-trepan-ni/cask-install /home/monnier/src/emacs/elpa/packages/realgud-lldb/cask-install hides /home/monnier/src/emacs/elpa/packages/realgud/cask-install /home/monnier/src/emacs/elpa/packages/realgud-lldb/cask-install hides /home/monnier/src/emacs/elpa/packages/loc-changes/cask-install /home/monnier/src/emacs/elpa/packages/ef-themes/theme-loaddefs hides /home/monnier/src/emacs/elpa/packages/standard-themes/theme-loaddefs /home/monnier/src/emacs/elpa/packages/elsa/Elsafile hides /home/monnier/src/emacs/elpa/packages/trinary/Elsafile /home/monnier/src/emacs/elpa/packages/url-http-oauth-demo/url-http-oauth-demo hides /home/monnier/src/emacs/elpa/packages/url-http-oauth/url-http-oauth-demo /home/monnier/src/emacs/nongnu/packages/vm/lisp/vcard hides /home/monnier/src/emacs/elpa/packages/vcard/vcard /home/monnier/src/emacs/elpa/packages/hydra/hydra-test hides /home/monnier/src/emacs/elpa/packages/lv/hydra-test /home/monnier/src/emacs/elpa/packages/hydra/hydra hides /home/monnier/src/emacs/elpa/packages/lv/hydra /home/monnier/src/emacs/elpa/packages/hydra/lv hides /home/monnier/src/emacs/elpa/packages/lv/lv /home/monnier/src/emacs/elpa/packages/hydra/hydra-ox hides /home/monnier/src/emacs/elpa/packages/lv/hydra-ox /home/monnier/src/emacs/elpa/packages/hydra/hydra-examples hides /home/monnier/src/emacs/elpa/packages/lv/hydra-examples /home/monnier/src/emacs/elpa/packages/ef-themes/theme-loaddefs hides /home/monnier/src/emacs/work/lisp/theme-loaddefs /home/monnier/src/emacs/elpa/packages/idlwave/idlw-help hides /home/monnier/src/emacs/work/lisp/progmodes/idlw-help /home/monnier/src/emacs/elpa/packages/idlwave/idlw-complete-structtag hides /home/monnier/src/emacs/work/lisp/progmodes/idlw-complete-structtag /home/monnier/src/emacs/elpa/packages/idlwave/idlw-toolbar hides /home/monnier/src/emacs/work/lisp/progmodes/idlw-toolbar /home/monnier/src/emacs/elpa/packages/idlwave/idlwave hides /home/monnier/src/emacs/work/lisp/progmodes/idlwave /home/monnier/src/emacs/elpa/packages/csharp-mode/csharp-mode hides /home/monnier/src/emacs/work/lisp/progmodes/csharp-mode /home/monnier/src/emacs/nongnu/packages/lua-mode/lua-mode hides /home/monnier/src/emacs/work/lisp/progmodes/lua-mode /home/monnier/src/emacs/elpa/packages/idlwave/idlw-shell hides /home/monnier/src/emacs/work/lisp/progmodes/idlw-shell /home/monnier/src/emacs/elpa/packages/org/lisp/org-src hides /home/monnier/src/emacs/work/lisp/org/org-src /home/monnier/src/emacs/elpa/packages/org/lisp/oc hides /home/monnier/src/emacs/work/lisp/org/oc /home/monnier/src/emacs/elpa/packages/org/lisp/ob-screen hides /home/monnier/src/emacs/work/lisp/org/ob-screen /home/monnier/src/emacs/elpa/packages/org/lisp/org-loaddefs hides /home/monnier/src/emacs/work/lisp/org/org-loaddefs /home/monnier/src/emacs/elpa/packages/org/lisp/org-agenda hides /home/monnier/src/emacs/work/lisp/org/org-agenda /home/monnier/src/emacs/elpa/packages/org/lisp/ob-dot hides /home/monnier/src/emacs/work/lisp/org/ob-dot /home/monnier/src/emacs/elpa/packages/org/lisp/ob-plantuml hides /home/monnier/src/emacs/work/lisp/org/ob-plantuml /home/monnier/src/emacs/elpa/packages/org/lisp/org-inlinetask hides /home/monnier/src/emacs/work/lisp/org/org-inlinetask /home/monnier/src/emacs/elpa/packages/org/lisp/oc-natbib hides /home/monnier/src/emacs/work/lisp/org/oc-natbib /home/monnier/src/emacs/elpa/packages/org/lisp/org-attach-git hides /home/monnier/src/emacs/work/lisp/org/org-attach-git /home/monnier/src/emacs/elpa/packages/org/lisp/ol-docview hides /home/monnier/src/emacs/work/lisp/org/ol-docview /home/monnier/src/emacs/elpa/packages/org/lisp/ob-exp hides /home/monnier/src/emacs/work/lisp/org/ob-exp /home/monnier/src/emacs/elpa/packages/org/lisp/ol-mhe hides /home/monnier/src/emacs/work/lisp/org/ol-mhe /home/monnier/src/emacs/elpa/packages/org/lisp/ob-awk hides /home/monnier/src/emacs/work/lisp/org/ob-awk /home/monnier/src/emacs/elpa/packages/org/lisp/org-fold-core hides /home/monnier/src/emacs/work/lisp/org/org-fold-core /home/monnier/src/emacs/elpa/packages/org/lisp/ol-doi hides /home/monnier/src/emacs/work/lisp/org/ol-doi /home/monnier/src/emacs/elpa/packages/org/lisp/ob-ref hides /home/monnier/src/emacs/work/lisp/org/ob-ref /home/monnier/src/emacs/elpa/packages/org/lisp/ob-calc hides /home/monnier/src/emacs/work/lisp/org/ob-calc /home/monnier/src/emacs/elpa/packages/org/lisp/ob-js hides /home/monnier/src/emacs/work/lisp/org/ob-js /home/monnier/src/emacs/elpa/packages/org/lisp/org-colview hides /home/monnier/src/emacs/work/lisp/org/org-colview /home/monnier/src/emacs/elpa/packages/org/lisp/ob-julia hides /home/monnier/src/emacs/work/lisp/org/ob-julia /home/monnier/src/emacs/elpa/packages/org/lisp/ob-ruby hides /home/monnier/src/emacs/work/lisp/org/ob-ruby /home/monnier/src/emacs/elpa/packages/org/lisp/ob-forth hides /home/monnier/src/emacs/work/lisp/org/ob-forth /home/monnier/src/emacs/elpa/packages/org/lisp/ob-lua hides /home/monnier/src/emacs/work/lisp/org/ob-lua /home/monnier/src/emacs/elpa/packages/org/lisp/ob-lob hides /home/monnier/src/emacs/work/lisp/org/ob-lob /home/monnier/src/emacs/elpa/packages/org/lisp/org-compat hides /home/monnier/src/emacs/work/lisp/org/org-compat /home/monnier/src/emacs/elpa/packages/org/lisp/ob-matlab hides /home/monnier/src/emacs/work/lisp/org/ob-matlab /home/monnier/src/emacs/elpa/packages/org/lisp/ob-scheme hides /home/monnier/src/emacs/work/lisp/org/ob-scheme /home/monnier/src/emacs/elpa/packages/org/lisp/org-table hides /home/monnier/src/emacs/work/lisp/org/org-table /home/monnier/src/emacs/elpa/packages/org/lisp/ob-haskell hides /home/monnier/src/emacs/work/lisp/org/ob-haskell /home/monnier/src/emacs/elpa/packages/org/lisp/ob-octave hides /home/monnier/src/emacs/work/lisp/org/ob-octave /home/monnier/src/emacs/elpa/packages/org/lisp/ob-processing hides /home/monnier/src/emacs/work/lisp/org/ob-processing /home/monnier/src/emacs/elpa/packages/org/lisp/ol-bibtex hides /home/monnier/src/emacs/work/lisp/org/ol-bibtex /home/monnier/src/emacs/elpa/packages/org/lisp/ob-ocaml hides /home/monnier/src/emacs/work/lisp/org/ob-ocaml /home/monnier/src/emacs/elpa/packages/org/lisp/ol-bbdb hides /home/monnier/src/emacs/work/lisp/org/ol-bbdb /home/monnier/src/emacs/elpa/packages/org/lisp/org-plot hides /home/monnier/src/emacs/work/lisp/org/org-plot /home/monnier/src/emacs/elpa/packages/org/lisp/ob-core hides /home/monnier/src/emacs/work/lisp/org/ob-core /home/monnier/src/emacs/elpa/packages/org/lisp/org-refile hides /home/monnier/src/emacs/work/lisp/org/org-refile /home/monnier/src/emacs/elpa/packages/org/lisp/org-lint hides /home/monnier/src/emacs/work/lisp/org/org-lint /home/monnier/src/emacs/elpa/packages/org/lisp/org-footnote hides /home/monnier/src/emacs/work/lisp/org/org-footnote /home/monnier/src/emacs/elpa/packages/org/lisp/org hides /home/monnier/src/emacs/work/lisp/org/org /home/monnier/src/emacs/elpa/packages/org/lisp/ol-w3m hides /home/monnier/src/emacs/work/lisp/org/ol-w3m /home/monnier/src/emacs/elpa/packages/org/lisp/ol-info hides /home/monnier/src/emacs/work/lisp/org/ol-info /home/monnier/src/emacs/elpa/packages/org/lisp/org-num hides /home/monnier/src/emacs/work/lisp/org/org-num /home/monnier/src/emacs/elpa/packages/org/lisp/org-cycle hides /home/monnier/src/emacs/work/lisp/org/org-cycle /home/monnier/src/emacs/elpa/packages/org/lisp/ob-tangle hides /home/monnier/src/emacs/work/lisp/org/ob-tangle /home/monnier/src/emacs/elpa/packages/org/lisp/ob-clojure hides /home/monnier/src/emacs/work/lisp/org/ob-clojure /home/monnier/src/emacs/elpa/packages/org/lisp/org-attach hides /home/monnier/src/emacs/work/lisp/org/org-attach /home/monnier/src/emacs/elpa/packages/org/lisp/org-element hides /home/monnier/src/emacs/work/lisp/org/org-element /home/monnier/src/emacs/elpa/packages/org/lisp/ob-comint hides /home/monnier/src/emacs/work/lisp/org/ob-comint /home/monnier/src/emacs/elpa/packages/org/lisp/ox-latex hides /home/monnier/src/emacs/work/lisp/org/ox-latex /home/monnier/src/emacs/elpa/packages/org/lisp/org-faces hides /home/monnier/src/emacs/work/lisp/org/org-faces /home/monnier/src/emacs/elpa/packages/org/lisp/ox-html hides /home/monnier/src/emacs/work/lisp/org/ox-html /home/monnier/src/emacs/elpa/packages/org/lisp/ob-lisp hides /home/monnier/src/emacs/work/lisp/org/ob-lisp /home/monnier/src/emacs/elpa/packages/org/lisp/org-persist hides /home/monnier/src/emacs/work/lisp/org/org-persist /home/monnier/src/emacs/elpa/packages/org/lisp/oc-basic hides /home/monnier/src/emacs/work/lisp/org/oc-basic /home/monnier/src/emacs/elpa/packages/org/lisp/ob-maxima hides /home/monnier/src/emacs/work/lisp/org/ob-maxima /home/monnier/src/emacs/elpa/packages/org/lisp/ob-gnuplot hides /home/monnier/src/emacs/work/lisp/org/ob-gnuplot /home/monnier/src/emacs/elpa/packages/org/lisp/org-archive hides /home/monnier/src/emacs/work/lisp/org/org-archive /home/monnier/src/emacs/elpa/packages/org/lisp/org-protocol hides /home/monnier/src/emacs/work/lisp/org/org-protocol /home/monnier/src/emacs/elpa/packages/org/lisp/ol-gnus hides /home/monnier/src/emacs/work/lisp/org/ol-gnus /home/monnier/src/emacs/elpa/packages/org/lisp/org-indent hides /home/monnier/src/emacs/work/lisp/org/org-indent /home/monnier/src/emacs/elpa/packages/org/lisp/ob-java hides /home/monnier/src/emacs/work/lisp/org/ob-java /home/monnier/src/emacs/elpa/packages/org/lisp/ob-shell hides /home/monnier/src/emacs/work/lisp/org/ob-shell /home/monnier/src/emacs/elpa/packages/org/lisp/org-tempo hides /home/monnier/src/emacs/work/lisp/org/org-tempo /home/monnier/src/emacs/elpa/packages/org/lisp/oc-bibtex hides /home/monnier/src/emacs/work/lisp/org/oc-bibtex /home/monnier/src/emacs/elpa/packages/org/lisp/ob hides /home/monnier/src/emacs/work/lisp/org/ob /home/monnier/src/emacs/elpa/packages/org/lisp/ox-texinfo hides /home/monnier/src/emacs/work/lisp/org/ox-texinfo /home/monnier/src/emacs/elpa/packages/org/lisp/org-ctags hides /home/monnier/src/emacs/work/lisp/org/org-ctags /home/monnier/src/emacs/elpa/packages/org/lisp/ox-beamer hides /home/monnier/src/emacs/work/lisp/org/ox-beamer /home/monnier/src/emacs/elpa/packages/org/lisp/ob-perl hides /home/monnier/src/emacs/work/lisp/org/ob-perl /home/monnier/src/emacs/elpa/packages/org/lisp/ox-man hides /home/monnier/src/emacs/work/lisp/org/ox-man /home/monnier/src/emacs/elpa/packages/org/lisp/org-version hides /home/monnier/src/emacs/work/lisp/org/org-version /home/monnier/src/emacs/elpa/packages/org/lisp/ob-R hides /home/monnier/src/emacs/work/lisp/org/ob-R /home/monnier/src/emacs/elpa/packages/org/lisp/ox-icalendar hides /home/monnier/src/emacs/work/lisp/org/ox-icalendar /home/monnier/src/emacs/elpa/packages/org/lisp/ob-python hides /home/monnier/src/emacs/work/lisp/org/ob-python /home/monnier/src/emacs/elpa/packages/org/lisp/ob-sass hides /home/monnier/src/emacs/work/lisp/org/ob-sass /home/monnier/src/emacs/elpa/packages/org/lisp/oc-csl hides /home/monnier/src/emacs/work/lisp/org/oc-csl /home/monnier/src/emacs/elpa/packages/org/lisp/org-feed hides /home/monnier/src/emacs/work/lisp/org/org-feed /home/monnier/src/emacs/elpa/packages/org/lisp/ox-ascii hides /home/monnier/src/emacs/work/lisp/org/ox-ascii /home/monnier/src/emacs/elpa/packages/org/lisp/ob-eshell hides /home/monnier/src/emacs/work/lisp/org/ob-eshell /home/monnier/src/emacs/elpa/packages/org/lisp/org-id hides /home/monnier/src/emacs/work/lisp/org/org-id /home/monnier/src/emacs/elpa/packages/org/lisp/ol-man hides /home/monnier/src/emacs/work/lisp/org/ol-man /home/monnier/src/emacs/elpa/packages/org/lisp/ox-org hides /home/monnier/src/emacs/work/lisp/org/ox-org /home/monnier/src/emacs/elpa/packages/org/lisp/ob-ditaa hides /home/monnier/src/emacs/work/lisp/org/ob-ditaa /home/monnier/src/emacs/elpa/packages/org/lisp/ol-rmail hides /home/monnier/src/emacs/work/lisp/org/ol-rmail /home/monnier/src/emacs/elpa/packages/org/lisp/ob-C hides /home/monnier/src/emacs/work/lisp/org/ob-C /home/monnier/src/emacs/elpa/packages/org/lisp/ob-emacs-lisp hides /home/monnier/src/emacs/work/lisp/org/ob-emacs-lisp /home/monnier/src/emacs/elpa/packages/org/lisp/ob-makefile hides /home/monnier/src/emacs/work/lisp/org/ob-makefile /home/monnier/src/emacs/elpa/packages/org/lisp/org-keys hides /home/monnier/src/emacs/work/lisp/org/org-keys /home/monnier/src/emacs/elpa/packages/org/lisp/org-duration hides /home/monnier/src/emacs/work/lisp/org/org-duration /home/monnier/src/emacs/elpa/packages/org/lisp/org-macro hides /home/monnier/src/emacs/work/lisp/org/org-macro /home/monnier/src/emacs/elpa/packages/org/lisp/org-timer hides /home/monnier/src/emacs/work/lisp/org/org-timer /home/monnier/src/emacs/elpa/packages/org/lisp/org-datetree hides /home/monnier/src/emacs/work/lisp/org/org-datetree /home/monnier/src/emacs/elpa/packages/org/lisp/ob-sed hides /home/monnier/src/emacs/work/lisp/org/ob-sed /home/monnier/src/emacs/elpa/packages/org/lisp/ol hides /home/monnier/src/emacs/work/lisp/org/ol /home/monnier/src/emacs/elpa/packages/org/lisp/org-list hides /home/monnier/src/emacs/work/lisp/org/org-list /home/monnier/src/emacs/elpa/packages/org/lisp/ol-eshell hides /home/monnier/src/emacs/work/lisp/org/ol-eshell /home/monnier/src/emacs/elpa/packages/org/lisp/ob-eval hides /home/monnier/src/emacs/work/lisp/org/ob-eval /home/monnier/src/emacs/elpa/packages/org/lisp/ob-css hides /home/monnier/src/emacs/work/lisp/org/ob-css /home/monnier/src/emacs/elpa/packages/org/lisp/ob-table hides /home/monnier/src/emacs/work/lisp/org/ob-table /home/monnier/src/emacs/elpa/packages/org/lisp/ol-eww hides /home/monnier/src/emacs/work/lisp/org/ol-eww /home/monnier/src/emacs/elpa/packages/org/lisp/ox hides /home/monnier/src/emacs/work/lisp/org/ox /home/monnier/src/emacs/elpa/packages/org/lisp/oc-biblatex hides /home/monnier/src/emacs/work/lisp/org/oc-biblatex /home/monnier/src/emacs/elpa/packages/org/lisp/ob-fortran hides /home/monnier/src/emacs/work/lisp/org/ob-fortran /home/monnier/src/emacs/elpa/packages/org/lisp/org-habit hides /home/monnier/src/emacs/work/lisp/org/org-habit /home/monnier/src/emacs/elpa/packages/org/lisp/ol-irc hides /home/monnier/src/emacs/work/lisp/org/ol-irc /home/monnier/src/emacs/elpa/packages/org/lisp/org-mouse hides /home/monnier/src/emacs/work/lisp/org/org-mouse /home/monnier/src/emacs/elpa/packages/org/lisp/ox-koma-letter hides /home/monnier/src/emacs/work/lisp/org/ox-koma-letter /home/monnier/src/emacs/elpa/packages/org/lisp/org-mobile hides /home/monnier/src/emacs/work/lisp/org/org-mobile /home/monnier/src/emacs/elpa/packages/org/lisp/ox-publish hides /home/monnier/src/emacs/work/lisp/org/ox-publish /home/monnier/src/emacs/elpa/packages/org/lisp/org-clock hides /home/monnier/src/emacs/work/lisp/org/org-clock /home/monnier/src/emacs/elpa/packages/org/lisp/ob-lilypond hides /home/monnier/src/emacs/work/lisp/org/ob-lilypond /home/monnier/src/emacs/elpa/packages/org/lisp/ob-sqlite hides /home/monnier/src/emacs/work/lisp/org/ob-sqlite /home/monnier/src/emacs/elpa/packages/org/lisp/org-macs hides /home/monnier/src/emacs/work/lisp/org/org-macs /home/monnier/src/emacs/elpa/packages/org/lisp/ox-odt hides /home/monnier/src/emacs/work/lisp/org/ox-odt /home/monnier/src/emacs/elpa/packages/org/lisp/org-fold hides /home/monnier/src/emacs/work/lisp/org/org-fold /home/monnier/src/emacs/elpa/packages/org/lisp/org-crypt hides /home/monnier/src/emacs/work/lisp/org/org-crypt /home/monnier/src/emacs/elpa/packages/org/lisp/ob-org hides /home/monnier/src/emacs/work/lisp/org/ob-org /home/monnier/src/emacs/elpa/packages/org/lisp/ob-latex hides /home/monnier/src/emacs/work/lisp/org/ob-latex /home/monnier/src/emacs/elpa/packages/org/lisp/ob-groovy hides /home/monnier/src/emacs/work/lisp/org/ob-groovy /home/monnier/src/emacs/elpa/packages/org/lisp/ob-sql hides /home/monnier/src/emacs/work/lisp/org/ob-sql /home/monnier/src/emacs/elpa/packages/org/lisp/org-pcomplete hides /home/monnier/src/emacs/work/lisp/org/org-pcomplete /home/monnier/src/emacs/elpa/packages/org/lisp/ox-md hides /home/monnier/src/emacs/work/lisp/org/ox-md /home/monnier/src/emacs/elpa/packages/org/lisp/org-capture hides /home/monnier/src/emacs/work/lisp/org/org-capture /home/monnier/src/emacs/elpa/packages/org/lisp/org-entities hides /home/monnier/src/emacs/work/lisp/org/org-entities /home/monnier/src/emacs/elpa/packages/org/lisp/org-goto hides /home/monnier/src/emacs/work/lisp/org/org-goto /home/monnier/src/emacs/work/lisp/keymap hides /home/monnier/src/emacs/work/lisp/emacs-lisp/keymap /home/monnier/src/emacs/elpa/packages/landmark/landmark hides /home/monnier/src/emacs/work/lisp/obsolete/landmark /home/monnier/src/emacs/elpa/packages/crisp/crisp hides /home/monnier/src/emacs/work/lisp/obsolete/crisp Features: (shadow sort mail-extr emacsbug markdown-mode edit-indirect pulse etags fileloop generator xref sm-c-mode smie crdt gnutls forms forms-mode color xdg epa-file log-edit message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader add-log smerge-mode whitespace dabbrev vc-backup log-view pcvs-util vc diff shortdoc comp-common prefixed-core misearch multi-isearch mule-util executable copyright edebug help-fns radix-tree debug backtrace find-func cl-print track-changes ielm vc-git diff-mode easy-mmode vc-dispatcher filecache bug-reference raku-detect server time-date flymake project compile text-property-search comint ansi-osc ansi-color ring warnings noutline outline flyspell ispell checkdoc lisp-mnt thingatpt elec-pair reveal autoinsert savehist minibuf-eldef disp-table type-break compact-docstrings corfu compat adoc-mode-autoloads afternoon-theme-autoloads alect-themes-autoloads ample-theme-autoloads annotate-autoloads anti-zenburn-theme-autoloads apache-mode-autoloads apropospriate-theme-autoloads arduino-mode-autoloads ede/auto eieio-base auto-dim-other-buffers-autoloads bash-completion-autoloads better-jumper-autoloads bison-mode-autoloads blow-autoloads blueprint-ts-mode-autoloads boxquote-autoloads buttercup-autoloads camera-autoloads cdlatex-autoloads cider-autoloads clojure-ts-mode-autoloads coffee-mode-autoloads consult-flycheck-autoloads corfu-terminal-autoloads crux-autoloads cyberpunk-theme-autoloads cycle-at-point-autoloads d-mode-autoloads dart-mode-autoloads dcs-mode-autoloads denote-refs-autoloads devhelp-autoloads devil-autoloads diff-ansi-autoloads dirvish-autoloads doc-show-inline-autoloads dracula-theme-autoloads drupal-mode-autoloads eat-autoloads edit-indirect-autoloads editorconfig-autoloads el-mock-autoloads elixir-mode-autoloads elpher-autoloads emacsql-autoloads engine-mode-autoloads evil-anzu-autoloads anzu-autoloads evil-args-autoloads evil-escape-autoloads evil-exchange-autoloads evil-goggles-autoloads evil-iedit-state-autoloads evil-indent-plus-autoloads evil-lisp-state-autoloads bind-map-autoloads evil-matchit-autoloads evil-nerd-commenter-autoloads evil-numbers-autoloads evil-surround-autoloads evil-visual-mark-mode-autoloads evil-visualstar-autoloads evil-autoloads exec-path-from-shell-autoloads flx-ido-autoloads flx-autoloads flycheck-autoloads flymake-guile-autoloads flymake-kondor-autoloads flymake-popon-autoloads focus-autoloads forth-mode-autoloads free-keys-autoloads gc-buffers-autoloads geiser-chez-autoloads geiser-chibi-autoloads geiser-chicken-autoloads geiser-gambit-autoloads geiser-gauche-autoloads geiser-guile-autoloads geiser-kawa-autoloads geiser-mit-autoloads geiser-racket-autoloads geiser-stklos-autoloads geiser-autoloads git-modes-autoloads gnu-apl-mode-autoloads gnu-indent-autoloads gnuplot-autoloads go-mode-autoloads golden-ratio-autoloads gotham-theme-autoloads goto-chg-autoloads graphql-mode-autoloads gruber-darker-theme-autoloads gruvbox-theme-autoloads autothemer-autoloads guru-mode-autoloads haskell-tng-mode-autoloads helm-autoloads helm-core-autoloads highlight-parentheses-autoloads hl-block-mode-autoloads hl-column-autoloads htmlize-autoloads hyperdrive-autoloads idle-highlight-mode-autoloads idris-mode-autoloads iedit-autoloads inf-clojure-autoloads clojure-mode-autoloads inf-ruby-autoloads inkpot-theme-autoloads iwindow-autoloads j-mode-autoloads jabber-autoloads jade-mode-autoloads jinja2-mode-autoloads julia-mode-autoloads keycast-autoloads kotlin-mode-autoloads lorem-ipsum-autoloads lua-mode-autoloads markdown-mode-autoloads mastodon-autoloads material-theme-autoloads mentor-autoloads meow-autoloads minibar-autoloads moe-theme-autoloads monokai-theme-autoloads mpv-autoloads multiple-cursors-autoloads nasm-mode-autoloads nginx-mode-autoloads nix-mode-autoloads oblivion-theme-autoloads opam-switch-mode-autoloads org-auto-tangle-autoloads org-drill-autoloads org-journal-autoloads org-mime-autoloads org-present-autoloads org-superstar-autoloads org-tree-slide-autoloads orgit-autoloads package-lint-autoloads pacmacs-autoloads page-break-lines-autoloads paredit-autoloads parseedn-autoloads parseclj-autoloads pcmpl-args-autoloads pcre2el-autoloads popon-autoloads popup-autoloads prescient-autoloads projectile-autoloads proof-general-autoloads proof-site proof-autoloads prop-menu-autoloads racket-mode-autoloads rainbow-delimiters-autoloads raku-mode-autoloads recomplete-autoloads rfc-mode-autoloads rubocop-autoloads rust-mode-autoloads sass-mode-autoloads haml-mode-autoloads scad-mode-autoloads scala-mode-autoloads scroll-on-drag-autoloads scroll-on-jump-autoloads sesman-autoloads shellcop-autoloads slime-autoloads macrostep-autoloads sly-autoloads smartparens-autoloads solarized-theme-autoloads spacemacs-theme-autoloads spell-fu-autoloads sqlite3-autoloads stylus-mode-autoloads subatomic-theme-autoloads subed-autoloads sweeprolog-autoloads swift-mode-autoloads swsw-autoloads symbol-overlay-autoloads systemd-autoloads tablist-autoloads tangotango-theme-autoloads telephone-line-autoloads testcover-mark-line-autoloads textile-mode-autoloads toc-org-autoloads totp-auth-autoloads base32-autoloads tuareg-autoloads rx caml-autoloads typescript-mode-autoloads ujelly-theme-autoloads undo-fu-autoloads undo-fu-session-autoloads vc-fossil-autoloads vcomplete-autoloads visual-fill-column-autoloads vm-autoloads web-mode-autoloads webpaste-autoloads wfnames-autoloads wgrep-autoloads why-this-autoloads with-simulated-input-autoloads workroom-autoloads writegood-mode-autoloads ws-butler-autoloads xah-fly-keys-autoloads xkcd-autoloads xml-rpc-autoloads yaml-mode-autoloads yasnippet-snippets-autoloads zenburn-theme-autoloads zig-mode-autoloads reformatter-autoloads ace-window-autoloads ack-autoloads activities-autoloads ada-mode-autoloads ada-ref-man-autoloads adaptive-wrap-autoloads adjust-parens-autoloads advice-patch-autoloads aggressive-completion-autoloads aggressive-indent-autoloads agitate-autoloads ahungry-theme-autoloads aircon-theme-autoloads all-autoloads altcaps-autoloads ampc-autoloads arbitools-autoloads assess-autoloads aumix-mode-autoloads auto-correct-autoloads auto-header-autoloads auto-overlays-autoloads autocrypt-autoloads bbdb-autoloads beacon-autoloads beardbolt-autoloads beframe-autoloads bicep-ts-mode-autoloads blist-autoloads bluetooth-autoloads bnf-mode-autoloads boxy-headings-autoloads boxy-headlines-autoloads breadcrumb-autoloads brief-autoloads buffer-env-autoloads buffer-expose-autoloads bufferlo-autoloads bug-hunter-autoloads buildbot-autoloads calibre-autoloads cape-autoloads capf-autosuggest-autoloads caps-lock-autoloads captain-autoloads chess-autoloads clipboard-collector-autoloads cobol-mode-autoloads code-cells-autoloads compact-docstrings-autoloads company-ebdb-autoloads company-math-autoloads company-statistics-autoloads company-autoloads consult-hoogle-autoloads haskell-mode-autoloads consult-recoll-autoloads context-coloring-autoloads corfu-autoloads coterm-autoloads counsel-autoloads cpio-mode-autoloads cpupower-autoloads crdt-autoloads crisp-autoloads csharp-mode-autoloads csv-mode-autoloads cursory-autoloads cycle-quotes-autoloads dape-autoloads darkroom-autoloads dbus-codegen-autoloads debbugs-autoloads delight-autoloads denote-menu-autoloads denote-autoloads detached-autoloads devdocs-autoloads devicetree-ts-mode-autoloads dict-tree-autoloads diff-hl-autoloads diffview-autoloads diminish-autoloads dired-du-autoloads dired-duplicates-autoloads dired-git-info-autoloads dired-preview-autoloads disk-usage-autoloads dismal-autoloads djvu-autoloads do-at-point-autoloads doc-toc-autoloads docbook-autoloads drepl-autoloads comint-mime-autoloads dts-mode-autoloads easy-escape-autoloads easy-kill-autoloads ebdb-gnorb-autoloads cl-seq inline ebdb-i18n-chn-autoloads ebdb-autoloads cl-extra help-mode ediprolog-autoloads eev-autoloads ef-themes-autoloads el-search-autoloads electric-spacing-autoloads elisp-benchmarks-autoloads ellama-autoloads elsa-autoloads emacs-gc-stats-autoloads emacspeak-autoloads embark-consult-autoloads consult-autoloads embark-autoloads ement-autoloads emms-autoloads engrave-faces-autoloads enwc-autoloads epoch-view-autoloads ergoemacs-mode-autoloads ess-autoloads excorporate-autoloads expand-region-autoloads expreg-autoloads exwm-autoloads f90-interface-browser-autoloads face-shift-autoloads filechooser-autoloads filladapt-autoloads firefox-javascript-repl-autoloads flylisp-autoloads flymake-codespell-autoloads flymake-proselint-autoloads fontaine-autoloads frame-tabs-autoloads frog-menu-autoloads fsm-autoloads ftable-autoloads gcmh-autoloads ggtags-autoloads gited-autoloads gle-mode-autoloads gnome-c-style-autoloads gnorb-autoloads gnu-elpa-autoloads gnu-elpa-features gnu-elpa-keyring-update-autoloads gnugo-autoloads ascii-art-to-unicode-autoloads gnus-mock-autoloads gpastel-autoloads gpr-mode-autoloads gpr-query-autoloads gnat-compiler-autoloads graphql-autoloads greader-autoloads greenbar-autoloads gtags-mode-autoloads guess-language-autoloads hcel-autoloads hiddenquote-autoloads highlight-escape-sequences-autoloads hook-helpers-autoloads html5-schema-autoloads idlwave-autoloads ilist-autoloads inspector-autoloads ioccur-autoloads isearch-mb-autoloads iterators-autoloads ivy-avy-autoloads avy-autoloads ivy-explorer-autoloads ivy-hydra-autoloads ivy-posframe-autoloads jarchive-autoloads javaimp-autoloads jgraph-mode-autoloads jinx-autoloads jit-spell-autoloads js2-mode-autoloads json-mode-autoloads jumpc-autoloads kind-icon-autoloads kiwix-autoloads request-autoloads kmb-autoloads landmark-autoloads latex-table-wizard-autoloads auctex-autoloads tex-site leaf-autoloads lentic-server-autoloads lentic-autoloads lex-autoloads lin-autoloads listen-autoloads llm-autoloads lmc-autoloads load-dir-autoloads loccur-autoloads logos-autoloads luwak-autoloads m-buffer-autoloads marginalia-autoloads markchars-autoloads math-symbol-lists-autoloads mct-autoloads memory-usage-autoloads metar-autoloads midi-kbd-autoloads mines-autoloads minibuffer-header-autoloads minibuffer-line-autoloads minimap-autoloads modus-themes-autoloads mpdired-autoloads multi-mode-autoloads multishell-autoloads muse-autoloads myers-autoloads nameless-autoloads names-autoloads nano-agenda-autoloads nano-modeline-autoloads nano-theme-autoloads nftables-mode-autoloads nhexl-mode-autoloads nlinum-autoloads notes-mode-autoloads notmuch-indicator-autoloads num3-mode-autoloads oauth2-autoloads ob-asymptote-autoloads ob-haxe-autoloads objed-autoloads omn-mode-autoloads on-screen-autoloads openpgp-autoloads orderless-autoloads org-contacts-autoloads org-edna-autoloads org-jami-bot-autoloads jami-bot-autoloads org-modern-autoloads org-notify-autoloads org-real-autoloads boxy-autoloads org-remark-autoloads org-transclusion-autoloads org-translate-autoloads org-autoloads orgalist-autoloads osc-autoloads osm-autoloads other-frame-window-autoloads pabbrev-autoloads paced-autoloads parsec-autoloads parser-generator-autoloads path-iterator-autoloads peg-autoloads perl-doc-autoloads persist-autoloads phpinspect-autoloads phps-mode-autoloads pinentry-autoloads plz-see-autoloads poke-autoloads poke-mode-autoloads poker-autoloads polymode-autoloads popper-autoloads pq-autoloads prefixed-core-autoloads psgml-autoloads pspp-mode-autoloads pulsar-autoloads pyim-autoloads async-autoloads pyim-basedict-autoloads quarter-plane-autoloads rainbow-mode-autoloads rbit-autoloads rcirc-color-autoloads rcirc-menu-autoloads rcirc-sqlite-autoloads realgud-ipdb-autoloads realgud-jdb-autoloads realgud-lldb-autoloads realgud-node-debug-autoloads realgud-node-inspect-autoloads realgud-pdbpp-autoloads realgud-trepan-ni-autoloads realgud-trepan-xpy-autoloads realgud-autoloads loc-changes-autoloads load-relative-autoloads rec-mode-autoloads register-list-autoloads relint-autoloads repology-autoloads rich-minority-autoloads rmsbolt-autoloads rnc-mode-autoloads info rt-liberation-autoloads ruby-end-autoloads rudel-autoloads satchel-autoloads scanner-autoloads scroll-restore-autoloads sed-mode-autoloads setup-autoloads shelisp-autoloads shell-command+-autoloads shell-quasiquote-autoloads shen-mode-autoloads sisu-mode-autoloads site-lisp-autoloads sketch-mode-autoloads slime-volleyball-autoloads sm-c-mode-autoloads smalltalk-mode-autoloads smart-yank-autoloads sml-mode-autoloads sokoban-autoloads sotlisp-autoloads spacious-padding-autoloads spinner-autoloads sql-beeline-autoloads sql-cassandra-autoloads sql-indent-autoloads sql-smie-autoloads finder-inf plz-autoloads ssh-deploy-autoloads standard-themes-autoloads stream-autoloads substitute-autoloads svg-clock-autoloads svg-tag-mode-autoloads svg-lib-autoloads swiper-autoloads ivy-autoloads switchy-window-autoloads sxhkdrc-mode-autoloads system-packages-autoloads tam-autoloads taxy-magit-section-autoloads taxy-autoloads dash-autoloads temp-buffer-browse-autoloads tempel-autoloads test-simple-autoloads theme-buffet-autoloads timerfunctions-autoloads tiny-autoloads tmr-autoloads tomelr-autoloads topspace-autoloads tramp-nspawn-autoloads tramp-theme-autoloads transcribe-autoloads transient-cycles-autoloads tree-inspector-autoloads treeview-autoloads trie-autoloads heap-autoloads tNFA-autoloads trinary-autoloads triples-autoloads typo-autoloads ulisp-repl-autoloads undo-tree-autoloads uni-confusables-autoloads uniquify-files-autoloads urgrep-autoloads url-http-ntlm-autoloads url-http-oauth-demo-autoloads url-http-oauth-autoloads url-auth url-scgi-autoloads validate-autoloads valign-autoloads vc-backup-autoloads vc-got-autoloads vc-hgcmd-autoloads vcard-autoloads vcl-mode-autoloads vdiff-autoloads hydra-autoloads lv-autoloads vertico-posframe-autoloads vertico-autoloads posframe-autoloads vigenere-autoloads visual-filename-abbrev-autoloads visual-fill-autoloads vlf-autoloads vundo-autoloads wcheck-mode-autoloads wconf-autoloads web-server-autoloads webfeeder-autoloads websocket-autoloads which-key-autoloads window-commander-autoloads windower-autoloads windresize-autoloads wisitoken-grammar-mode-autoloads mmm-mode-autoloads wisi-autoloads wpuzzle-autoloads wrap-search-autoloads xclip-autoloads xeft-autoloads xelb-autoloads xpm-autoloads queue-autoloads xr-autoloads xref-union-autoloads yasnippet-classic-snippets-autoloads yasnippet-autoloads zones-autoloads ztree-autoloads zuul-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source eieio eieio-core cl-macs pcase password-cache json subr-x map byte-opt bytecomp byte-compile url-vars cus-edit pp cus-load icons wid-edit cl-loaddefs cl-lib gv rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray button loaddefs theme-loaddefs oclosure cl-preloaded faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process emacs) Memory information: ((conses 16 475806 534790) (symbols 48 25990 390) (strings 32 107129 24187) (string-bytes 1 3914363) (vectors 16 54298) (vector-slots 8 1480489 381084) (floats 8 404 821) (intervals 56 31797 859) (buffers 992 57)) From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 10:26:12 2024 Received: (at 70105) by debbugs.gnu.org; 31 Mar 2024 14:26:12 +0000 Received: from localhost ([127.0.0.1]:48197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqw8R-00028R-PM for submit@debbugs.gnu.org; Sun, 31 Mar 2024 10:26:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqw8O-00027i-Os for 70105@debbugs.gnu.org; Sun, 31 Mar 2024 10:26:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqw8G-0006yc-95; Sun, 31 Mar 2024 10:26:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ejIYY6dl+zJ1ir3ZS3rMHyn1tEOXdzahzBg9sqkSu/0=; b=U1eShpW8f69M 5luP5oh8kvFLlCKCNN/mrwuIVloOLc+LYQKEoeubiFaFTnTfhe5vB/wSXVDHf9m8Vv2sPP6ryu1rF KqfR8I9TtWDABippNsrct5TmEidMewg2DWq4PluWRRdk2TFX14cgRvxyScr2HOxcIwCbrbH3EZGhC JlIvwcOfioHSZHGFf68R+N1xfRjo4V0ia/rGMbdkK/ztzphcpOnuDs/Be3r/2vYo7bINXUIe6h2MY 3gh2rT4fJsJenbytIKrQaWc53N2W1CwLHcn1eXF5L2pb8L3uc9P7l1a9zkSO/XHqSHPNBH/YV3OjJ dzs3xo0XKT2hAmV+ziyVzg==; Date: Sun, 31 Mar 2024 17:25:57 +0300 Message-Id: <867chibhqi.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box References: X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: 70105 Cc: 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > Cc: monnier@iro.umontreal.ca > Date: Sun, 31 Mar 2024 09:44:00 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > https://editorconfig.org/ seems to be a popular standard to specify > settings such as the size of an indentation step in an > editor-agnostic way. > > There's an `editorconfig` package for it up on NonGNU ELPA, but I think > we should support it out of the box. I agree, but what is the plan? import the package on NonGNU ELPA (probably hard) or develop our own (in which case "patches welcome")? From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 16:40:42 2024 Received: (at 70105) by debbugs.gnu.org; 31 Mar 2024 20:40:42 +0000 Received: from localhost ([127.0.0.1]:48564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rr1yr-0000DF-QG for submit@debbugs.gnu.org; Sun, 31 Mar 2024 16:40:42 -0400 Received: from thaodan.de ([185.216.177.71]:49424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rr1yp-0000CL-LB for 70105@debbugs.gnu.org; Sun, 31 Mar 2024 16:40:40 -0400 Received: from odin (dsl-trebng12-50dc75-154.dhcp.inet.fi [80.220.117.154]) by thaodan.de (Postfix) with ESMTPSA id B055BD03997; Sun, 31 Mar 2024 23:40:30 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1711917630; bh=bvQR/66nwGUZ3/YwbpMU9WOHYNctUt9RMxReNBH+YFI=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ccRMTf3Vwe3xUzle1QafZIi03qtZv7IPqk8OMX8oaJ8QJpqT7giOddc3HERf4Q0Xa GXluqtiE2W7kv3xwm7CDktxpMS4N/ZDU72g1jHt14peGCr6I7yUZMaJhz5pMhAkMX7 Ujbf5eiWk8inNeAciRYzUEhAdbBLjfCS7HdUO7WLzWVKaiDUQOH/rkaj+xkRMx4NrR Gu/6GiKZ7rDq2G8nIOThwOWGWMP/K1w0xuKRzWpF1vaQ3ArWJ1jP/at58GiZ+Z3cJX dNn3/gmLc/TN34sgWBA4aIwQlp+rzJJoTSM194urEhm/7j6ah1eMzmHLsey9ByfyQI ttqDI2nbl7VA1MNT6pvBy+ytKJrJiQikJdWeBYTbwVIm4kMoPpDVOWtA/CFWIb8SSN q+7T4Yz+Z2//U87vdTxTuZhtOEuIO2CblSBWFRIm443G7eIijqSudWLTVNSD403ec4 jrWa6dG72aE9l799CsMxufrW3llPYMzYr0cZ9MF83cMfjLeSBmCDkj56Msnc+Ah7Sq H3vZdWApV02LtBXppJxABEJKfJw90ICZSuSX7ZkfaV5lvXg/ZMvCsyHeRMozYPpHHL neh8Leu87SiX4PSMUoT9UUTGAWfOVygB5b0tGM/vxwP5TuEDnqbU37dDTUcFjXpAKv 2HMHkfTWaJN5vUOBGJ7vwFNw= From: =?utf-8?Q?Bj=C3=B6rn?= Bidar To: Eli Zaretskii Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <867chibhqi.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 31 Mar 2024 17:25:57 +0300") References: <867chibhqi.fsf@gnu.org> Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1+ntAhsDBQsJCAcCAiICBhUKCQgL AgQWAgMBAh4HAheAAAoJEFwbdKFlHF9oBgwA/iQHwe0VL4Df4GGTYlNjMSHFlIkBmN4UfYGLYj3E TrOUAQC51M+M3cjsL8WHdpBz6VAo6df9d+rVwhQ9vQuFHqevArg4BGTX6T4SCisGAQQBl1UBBQEB B0Cbohc3JEfn005/cm0AOGjSsW1ZxAkgaoVNjbpqk4MgNAMBCAeIeAQYFgoAIBYhBFHxdut1RzAe pymoq1wbdKFlHF9oBQJk1+k+AhsMAAoJEFwbdKFlHF9ooHABAKGmrGBic/Vys3BBrOQiRB3Z7izO HwhqTRpAqFZtXS2nAQDZhp/5aYw1TZjTzkm1KVt9QiYnjd/MvxRE9iaY6x4mDbgzBGTX6T4WCSsG AQQB2kcPAQEHQAgRJq/tMcCCB2XyA5WZpu7GvpRx0m9IPRWazeqhOq7uiO8EGBYKACAWIQRR8Xbr dUcwHqcpqKtcG3ShZRxfaAUCZNf71AIbIgCBCRBcG3ShZRxfaHYgBBkWCgAdFiEEUfF263VHMB6n KairXBt0oWUcX2gFAmTX+9QACgkQXBt0oWUcX2jeSwD6AtWn0cuo8IF35YRo4o3cDRJnUfJnbvJy GxyCDThR+zYBAKG6/jdwmZkBQZKslnDAbMMd2WfiZZT5JW3IWC4EaKMO7HkBAKYPGZ3UbfkRvfFK S+pQ9CgtNfkSJQBtT1Ob7Y6nsacgAQCpyXN7yppmhW/oBgivITPy9Lkg+V4NK9WZYZCU9Q7LBA== Date: Sun, 31 Mar 2024 23:40:29 +0300 Message-ID: <87h6gmp22q.fsf@> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Eli Zaretskii writes: >> Cc: monnier@iro.umontreal.ca >> Date: Sun, 31 Mar 2024 09:44:00 -0400 >> From: Stefan Monnier via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: editorconfig.org] 0.6 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL blocklist [URIs: editorconfig.org] 1.2 INVALID_MSGID Message-Id is not valid, according to RFC 2822 X-Debbugs-Envelope-To: 70105 Cc: 70105@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.9 (/) Eli Zaretskii writes: >> Cc: monnier@iro.umontreal.ca >> Date: Sun, 31 Mar 2024 09:44:00 -0400 >> From: Stefan Monnier via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> https://editorconfig.org/ seems to be a popular standard to specify >> settings such as the size of an indentation step in an >> editor-agnostic way. >> >> There's an `editorconfig` package for it up on NonGNU ELPA, but I think >> we should support it out of the box. > > I agree, but what is the plan? import the package on NonGNU ELPA > (probably hard) or develop our own (in which case "patches welcome")? Did anybody reach to the author of the editorconfig package? The package works quite well providing a pure-lips based implementation (probably useful for operating systems such as Microsoft Windows) or one based on the editorconfig.org C based utilities. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 18:26:55 2024 Received: (at 70105) by debbugs.gnu.org; 31 Mar 2024 22:26:55 +0000 Received: from localhost ([127.0.0.1]:48863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rr3df-0008WQ-9Y for submit@debbugs.gnu.org; Sun, 31 Mar 2024 18:26:55 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rr3dd-0008WB-QE for 70105@debbugs.gnu.org; Sun, 31 Mar 2024 18:26:54 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2CC694424F2; Sun, 31 Mar 2024 18:26:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1711924004; bh=x05vWk15DfUZav5sndUL5XH0REArP+Tb2SwsdjRWTD0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EuzZQU6ekXIXpLyBOlAFrmw55HDHO5njLhYdORAC1kF2DbXtsd8k4jq/56nNcv3Ed uoJtOebjIDPivwiPD9aWXXCaA4H+o4vqxXoaN98I859071ppzo1UHwW2ikjJ/AyTnw IaXu2/KyoDiObIsfd8mt58y5cHd5uhhSnPlHl4BEM7DjHfGh/ow1Iqp9UejJ009j71 aJcca2XcSN403JzNU3U1yTYkzQLPJRp/CDphNScRJcEgK/m84NWZulSXW4qL0b6Yjr 4pLH2eImKWjCC9/CzehknhKzhn35DjoY86MUUHkt9ZzwcBg4LfKhF0PKmqDsuM32F7 ZkXDIoDCXS1BA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F056E442484; Sun, 31 Mar 2024 18:26:43 -0400 (EDT) Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C954712016C; Sun, 31 Mar 2024 18:26:43 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <867chibhqi.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 31 Mar 2024 17:25:57 +0300") Message-ID: References: <867chibhqi.fsf@gnu.org> Date: Sun, 31 Mar 2024 18:26:43 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.093 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I agree, but what is the plan? import the package on NonGNU ELPA > (probably hard) or develop our own (in which case "patches welcome")? On the technical side, there's a fair bit of rework to be done to better integrate it. But it would be good to try and get copyright assignment for (some of) the code, so we don't have to reinvent the whole wheel. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 06 19:52:06 2024 Received: (at 70105) by debbugs.gnu.org; 6 Jun 2024 23:52:06 +0000 Received: from localhost ([127.0.0.1]:52790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFMtp-0006PE-4k for submit@debbugs.gnu.org; Thu, 06 Jun 2024 19:52:06 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFMtl-0006OZ-Sx for 70105@debbugs.gnu.org; Thu, 06 Jun 2024 19:52:03 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 06DB3100048; Thu, 6 Jun 2024 19:51:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1717717899; bh=JkCQKwex/8jGxgbqRoHaJHpTs+A/QOUAxZiDcF9x0+s=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bvtOdp5H/jWCEjXkGsA/CnJpMmQCUFIyc8bhigibhp/vjzksET3nkNsBVHtBUbEki KQbbeWW/dtbmbtbL4gq4SxOHmSvRKsDJq4jDwx6jrK4rgu0SiympXnAvqIjzWo70Gw UsQDa6RvC8TXUaBnPN8XVSQvRS74Cf35EHunaYmwiilloYFvKkdxdolRxp+jfYJ/uL 7EC1LDyf89gHjME+TacgdGuJaXWp1Ub12dG5hhdJUb03/Bj5o6hL7MxsRRXFeLCUuj 1WvY0izAy4IEkYjXs6H5n/Hdwwzu3hiK6zQEjcR+rE+bu5HRnYlaZAbYNQYPxqJFlI dD5zZ8PvyCI9g== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 34D7C100035; Thu, 6 Jun 2024 19:51:39 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E7A1612024D; Thu, 6 Jun 2024 19:51:38 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <867chibhqi.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 31 Mar 2024 17:25:57 +0300") Message-ID: References: <867chibhqi.fsf@gnu.org> Date: Thu, 06 Jun 2024 19:51:37 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.304 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: Jen-Chieh Shen , =?windows-1252?Q?Bj=F6rn?= Bidar , 10sr <8slashes+git@gmail.com>, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain I think I have a clear enough idea of how support for Editorconfig should be integrated into Emacs, in terms of "how to hook it to the right places". There are still pending questions about how to adapt the code of the `editorconfig` package, but in the mean time: here's a first step to make sure Emacs offers the right hooks. Find below two patch which do that. The first patch slightly extends `auto-coding-functions` so that it can use the file name to decide which coding system to use. This is a fairly simple change: this clearly the right place to hook ourselves into. I make the change by adding a dynamically scoped `auto-coding-file-name` variable. The resulting API would be cleaner if we instead passed the filename as an additional argument, which we could do easily (even with some amount of backward compatibility), but the change proposed has the advantage of being 100% backward compatible. The cleaner API would replace: (let ((auto-coding-file-name filename)) (funcall (pop funcs) size)) with (let ((fun (pop funcs))) (condition-case nil (funcall fun size filename) (wrong-number-of-arguments (funcall fun size)))) In the long run the cleaner API is probably preferable, but it does come with a slight risk of backward incompatibility. The second patch adds a new hook `hack-dir-local-get-variables-functions`. This one is not as "obvious": there are other places we could hook ourselves into. E.g. it's tempting to hook deeper into the dir-locals machinery so as to reuse its caching mechanism. In the end I decided not to do that because the dir-locals machinery is not prepared to accept settings coming from different levels of the directory tree, so that trying to shoehorn Editorconfig into it would be a bit messy and/or unreliable. The downside is that this hook forces its users to take care of their own caching. But since the current examples all need to do their caching a bit differently, I think this is OK. There's one other design choice I made: `hack-dir-local-get-variables-functions` returns elements of the form (DIR . ALIST) where DIR is used to obey `safe-local-variable-directories' as well as to provide a bit more info to the user when prompting for confirmation in cache of risky settings. But that does not provide any actual info about the actual source of the ALIST, so the message we emit when prompting the user can't tell the user whether the settings come from a `.dir-locals.el` or something else. This is not a new problem: the current code already can't tell the user if the settings come from a `.dir-locals.el`, or a "project class" or a `.dir-locals-2.el`. So, apparently, this is a problem we have not deemed worthwhile to fix, so I left it like unsolved. I'm hoping this can get into Emacs-30. Comments/objections? Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-find-auto-coding-Provide-filename-to-auto-coding-fun.patch >From d12c9bc2a4c8383abdf7fa32b67f1ca0379227e3 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 4 Jun 2024 10:58:29 -0400 Subject: [PATCH 1/2] (find-auto-coding): Provide filename to `auto-coding-functions` Allow `auto-coding-functions` to know the file name. Motivated by the needs of Editorconfig support. * lisp/international/mule.el (auto-coding-file-name): New var. (find-auto-coding): Let-bind it for `auto-coding-functions`. Document the expectation that the arg be an absolute file name. * doc/lispref/nonascii.texi (Default Coding Systems): Mention `auto-coding-file-name`. --- doc/lispref/nonascii.texi | 3 +++ etc/NEWS | 5 +++++ lisp/international/mule.el | 17 ++++++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index b33082e2b24..1482becb9f5 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi @@ -1654,6 +1654,9 @@ Default Coding Systems starting from point. If the function succeeds in determining a coding system for the file, it should return that coding system. Otherwise, it should return @code{nil}. +Each function can also find the name of the file to which +the buffer's content belong in the variable +@code{auto-coding-file-name}. The functions in this list could be called either when the file is visited and Emacs wants to decode its contents, and/or when the file's diff --git a/etc/NEWS b/etc/NEWS index 808cd0562db..52486b7bbe9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2163,6 +2163,11 @@ completion candidate. * Lisp Changes in Emacs 30.1 ++++ +** 'auto-coding-functions' can know the name of the file. +The functions on this hook take can now find the name of the file to +which the text belongs by consulting the variable 'auto-coding-file-name'. + +++ ** New user option 'compilation-safety' to control safety of native code. It's now possible to control how safe is the code generated by native diff --git a/lisp/international/mule.el b/lisp/international/mule.el index a17221e6d21..ed74fdae755 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1806,6 +1806,9 @@ auto-coding-regexp-alist-lookup (setq alist (cdr alist))))) coding-system))) +(defvar auto-coding-file-name nil + "Variable holding the name of the file for `auto-coding-functions'.") + ;; See the bottom of this file for built-in auto coding functions. (defcustom auto-coding-functions '(sgml-xml-auto-coding-function sgml-html-meta-auto-coding-function) @@ -1820,6 +1823,9 @@ auto-coding-functions its contents, and when the file's buffer is about to be saved and Emacs wants to determine how to encode its contents. +The name of the file is provided to the function via the variable +`auto-coding-file-name'. + If one of these functions succeeds in determining a coding system, it should return that coding system. Otherwise, it should return nil. @@ -1847,13 +1853,17 @@ auto-coding-alist-lookup coding-system)) (put 'enable-character-translation 'permanent-local t) -(put 'enable-character-translation 'safe-local-variable 'booleanp) +(put 'enable-character-translation 'safe-local-variable #'booleanp) (defun find-auto-coding (filename size) + ;; FIXME: Shouldn't we use nil rather than "" to mean that there's no file? + ;; FIXME: Clarify what the SOURCE is for in the return value? "Find a coding system for a file FILENAME of which SIZE bytes follow point. These bytes should include at least the first 1k of the file and the last 3k of the file, but the middle may be omitted. +FILENAME should be an absolute file name +or \"\" (which means that there is no associated file). The function checks FILENAME against the variable `auto-coding-alist'. If FILENAME doesn't match any entries in the variable, it checks the contents of the current buffer following point against @@ -1998,7 +2008,8 @@ find-auto-coding (setq coding-system (ignore-errors (save-excursion (goto-char (point-min)) - (funcall (pop funcs) size))))) + (let ((auto-coding-file-name filename)) + (funcall (pop funcs) size)))))) (if coding-system (cons coding-system 'auto-coding-functions))))) @@ -2013,7 +2024,7 @@ set-auto-coding (if (and found (coding-system-p (car found))) (car found)))) -(setq set-auto-coding-function 'set-auto-coding) +(setq set-auto-coding-function #'set-auto-coding) (defun after-insert-file-set-coding (inserted &optional visit) "Set `buffer-file-coding-system' of current buffer after text is inserted. -- 2.39.2 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-hack-dir-local-get-variables-functions-New-hook.patch >From 71ac0af5d0191cdf8ebc56066c7ca58dd93487cf Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 4 Jun 2024 11:00:32 -0400 Subject: [PATCH 2/2] (hack-dir-local-get-variables-functions): New hook Make it possible to provide more dir-local variables, such as done by the Editorconfig package. * lisp/files.el (hack-dir-local--get-variables): Make arg optional. (hack-dir-local-get-variables-functions): New hook. (hack-dir-local-variables): Run it instead of calling `hack-dir-local--get-variables`. * doc/lispref/variables.texi (Directory Local Variables): Document the new hook. --- doc/lispref/variables.texi | 29 +++++++++++++++ etc/NEWS | 4 ++ lisp/files.el | 76 ++++++++++++++++++++++++++++++-------- 3 files changed, 93 insertions(+), 16 deletions(-) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index e05d3bb0f81..c63057e31ea 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2277,6 +2277,35 @@ Directory Local Variables updates this list. @end defvar +@defvar hack-dir-local-get-variables-functions +This special hook holds the functions that gather the directory-local +variables to use for a given buffer. By default it contains just the +function that obeys the other settings described in the present section. +But it can be used to add support for more sources of directory-local +variables, such as those used by other text editors. + +The functions on this hook are called with no argument, in the buffer to +which we intend to apply the directory-local variables, after the +buffer's major mode function has been run, so it can use sources of +information such as @code{major-mode} or @code{buffer-file-name} to find +the variables that should be applied. + +It should return either a cons cell of the form @code{(@var{directory} +. @var{alist})} or a list of such cons-cells. A @code{nil} return value +means that it found no directory-local variables. @var{directory} +should be a string: the name of the directory to which the variables +apply. @var{alist} is a list of variables together with their values +that apply to the current buffer, where every element is of the form +@code{(@var{varname} . @var{value})}. + +The various @var{alist} returned by these functions will be combined, +and in case of conflicts, the settings coming from deeper directories +will take precedence over those coming from higher directories in the +directory hierarchy. Finally, since this hook is run every time we visit +a file it is important to try and keep those functions efficient, which +will usually require some of caching. +@end defvar + @defvar enable-dir-local-variables If @code{nil}, directory-local variables are ignored. This variable may be useful for modes that want to ignore directory-locals while diff --git a/etc/NEWS b/etc/NEWS index 52486b7bbe9..14e5dafbadc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2163,6 +2163,10 @@ completion candidate. * Lisp Changes in Emacs 30.1 +** New hook 'hack-dir-local-get-variables-functions'. +This can be used to provide support for other directory-local settings +beside '.dir-locals.el'. + +++ ** 'auto-coding-functions' can know the name of the file. The functions on this hook take can now find the name of the file to diff --git a/lisp/files.el b/lisp/files.el index 210cd0fa7ad..a36ac6b1318 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3494,6 +3494,8 @@ set-auto-mode ;; Check for auto-mode-alist entry in dir-locals. (with-demoted-errors "Directory-local variables error: %s" ;; Note this is a no-op if enable-local-variables is nil. + ;; We don't use `hack-dir-local-get-variables-functions' here, because + ;; modes are specific to Emacs. (let* ((mode-alist (cdr (hack-dir-local--get-variables (lambda (key) (eq key 'auto-mode-alist)))))) (set-auto-mode--apply-alist mode-alist keep-mode-if-same t))) @@ -4769,7 +4771,7 @@ enable-remote-dir-locals (defvar hack-dir-local-variables--warned-coding nil) -(defun hack-dir-local--get-variables (predicate) +(defun hack-dir-local--get-variables (&optional predicate) "Read per-directory local variables for the current buffer. Return a cons of the form (DIR . ALIST), where DIR is the directory name (maybe nil) and ALIST is an alist of all variables @@ -4799,6 +4801,16 @@ hack-dir-local--get-variables (dir-locals-get-class-variables class) dir-name nil predicate)))))) +(defvar hack-dir-local-get-variables-functions + (list #'hack-dir-local--get-variables) + "Special hook to compute the set of dir-local variables. +Every function is called without arguments and should return either +a cons of the form (DIR . ALIST) or a (possibly empty) list of such conses, +where ALIST is an alist of (VAR . VAL) settings. +DIR should be a string (a directory name) and is used to obey +`safe-local-variable-directories'. +This hook is run after the major mode has been setup.") + (defun hack-dir-local-variables () "Read per-directory local variables for the current buffer. Store the directory-local variables in `dir-local-variables-alist' @@ -4806,21 +4818,53 @@ hack-dir-local-variables This does nothing if either `enable-local-variables' or `enable-dir-local-variables' are nil." - (let* ((items (hack-dir-local--get-variables nil)) - (dir-name (car items)) - (variables (cdr items))) - (when variables - (dolist (elt variables) - (if (eq (car elt) 'coding) - (unless hack-dir-local-variables--warned-coding - (setq hack-dir-local-variables--warned-coding t) - (display-warning 'files - "Coding cannot be specified by dir-locals")) - (unless (memq (car elt) '(eval mode)) - (setq dir-local-variables-alist - (assq-delete-all (car elt) dir-local-variables-alist))) - (push elt dir-local-variables-alist))) - (hack-local-variables-filter variables dir-name)))) + (let (items) + (when (and enable-local-variables + enable-dir-local-variables + (or enable-remote-dir-locals + (not (file-remote-p (or (buffer-file-name) + default-directory))))) + (run-hook-wrapped 'hack-dir-local-get-variables-functions + (lambda (fun) + (let ((res (funcall fun))) + (cond + ((null res)) + ((consp (car-safe res)) + (setq items (append res items))) + (t (push res items))))))) + ;; Sort the entries from nearest dir to furthest dir. + (setq items (sort (nreverse items) + :key (lambda (x) (length (car-safe x))) :reverse t)) + ;; Filter out duplicates, preferring the settings from the nearest dir + ;; and from the first hook function. + (let ((seen nil)) + (dolist (item items) + (when seen ;; Special case seen=nil since it's the most common case. + (setcdr item (seq-filter (lambda (vv) (not (memq (car-safe vv) seen))) + (cdr item)))) + (setq seen (nconc (seq-difference (mapcar #'car (cdr item)) + '(eval mode)) + seen)))) + ;; Rather than a loop, maybe we should handle all the dirs + ;; "together", e.g. prompting the user only once. But if so, we'd + ;; probably want to also merge the prompt for file-local vars, + ;; which comes from the call to `hack-local-variables-filter' in + ;; `hack-local-variables'. + (dolist (item items) + (let ((dir-name (car items)) + (variables (cdr items))) + (when variables + (dolist (elt variables) + (if (eq (car elt) 'coding) + (unless hack-dir-local-variables--warned-coding + (setq hack-dir-local-variables--warned-coding t) + (display-warning 'files + "Coding cannot be specified by dir-locals")) + (unless (memq (car elt) '(eval mode)) + (setq dir-local-variables-alist + (assq-delete-all (car elt) dir-local-variables-alist))) + (push elt dir-local-variables-alist))) + (hack-local-variables-filter variables dir-name)))))) (defun hack-dir-local-variables-non-file-buffer () "Apply directory-local variables to a non-file buffer. -- 2.39.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 08 08:51:10 2024 Received: (at 70105) by debbugs.gnu.org; 8 Jun 2024 12:51:10 +0000 Received: from localhost ([127.0.0.1]:37849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFvXJ-00047X-RZ for submit@debbugs.gnu.org; Sat, 08 Jun 2024 08:51:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFvXH-00047B-K9 for 70105@debbugs.gnu.org; Sat, 08 Jun 2024 08:51:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFvWv-0000tz-EI; Sat, 08 Jun 2024 08:50:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=T8eNmQwOrJxzWxVT4QqcJ/Of7WhiStMPv9iUBiRkTQg=; b=lp6SXmYuZPZbOJPNwMtm jMnV2p2gzCl/9rqb/10LHCl/DIVtLo71KerToZYSBLDdlmDQOznVUIe6/0NklIcSkyvewiJeL/WBs ObzpQ7jIvBifEHzAuxCJbG5eRv7MqzvHReAaRq0AVlGcdvutjRx7DpzImJR/EWl9anKwuteXJmblz Uep2hnGfyUAB9NEe6EiVpZynFXKySzwrGbJSDULCrLtwvRR6SLnP2P1T8Cap6+CLrEPu4ILDrdqqZ Xl0fJOA+48pVLrhpBrEFkbEt+Rrx3/hfqe/RW12WWI3REjsECDBkp/UB8bbKQ+Q+4QsSeCuy8E+E8 mdjG3L1tf8B69A==; Date: Sat, 08 Jun 2024 15:50:41 +0300 Message-Id: <86frtnd2e6.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Thu, 06 Jun 2024 19:51:37 -0400) Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box References: <867chibhqi.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: 70105@debbugs.gnu.org, Björn Bidar > , > 10sr <8slashes+git@gmail.com>, Jen-Chieh Shen > Date: Thu, 06 Jun 2024 19:51:37 -0400 > > I'm hoping this can get into Emacs-30. > Comments/objections? Comments: > +** 'auto-coding-functions' can know the name of the file. > +The functions on this hook take can now find the name of the file to ^^^^ The "take" part should probably be removed. > +@defvar hack-dir-local-get-variables-functions > +This special hook holds the functions that gather the directory-local > +variables to use for a given buffer. By default it contains just the > +function that obeys the other settings described in the present section. > +But it can be used to add support for more sources of directory-local > +variables, such as those used by other text editors. > + > +The functions on this hook are called with no argument, in the buffer to > +which we intend to apply the directory-local variables, after the > +buffer's major mode function has been run, so it can use sources of I'm guessing you meant "they", not "it", because this refers to "functions on this hook", right? > +directory hierarchy. Finally, since this hook is run every time we visit > +a file it is important to try and keep those functions efficient, which > +will usually require some of caching. ^^^^^^^^^^^^^^^ "some kind of caching", perhaps? From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 00:21:54 2024 Received: (at 70105) by debbugs.gnu.org; 9 Jun 2024 04:21:54 +0000 Received: from localhost ([127.0.0.1]:36550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGA41-0005cE-QI for submit@debbugs.gnu.org; Sun, 09 Jun 2024 00:21:54 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGA40-0005br-Ga for 70105@debbugs.gnu.org; Sun, 09 Jun 2024 00:21:52 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 81E8F100043; Sun, 9 Jun 2024 00:21:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1717906889; bh=vr/asPTRLdUflXg1J2JI6ZO3mXxcvVbZ3K3k1v9RfSc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hnL+PUDx8c491wlLhqz7RdypYq1KbAwqrjkcaDIFTBDwglUYiyBGppR+NIwfwZW2j RXwKzNddSPKnUDQqlvPAvRDJwdp9vqc6sel1fWpAVkjiyODQTUouVqhsw0AdwVCkcC htm4byFhGiQh3FHxeqyNg1Bo4KKw0VST7CgVkOlYyDJgBQWbXENwvx0iwbNyaI4JTM xlLyFoRiqHuzOlQspw3AoV7d2ii2HhQjSZopetvkY2EaZsjuXi+o0FQplXIdfpRTT9 vjXbHxggi5PUA41wYaYpzkWnX6k6NrKZyL7gRAve9myYfq5wYr+NNPV+htiNSidxlG fYcmO21RDTnHQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7C28D100035; Sun, 9 Jun 2024 00:21:29 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 30A8E12024D; Sun, 9 Jun 2024 00:21:29 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <86frtnd2e6.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Jun 2024 15:50:41 +0300") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Sun, 09 Jun 2024 00:21:28 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.284 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Comments: > >> +** 'auto-coding-functions' can know the name of the file. >> +The functions on this hook take can now find the name of the file to > ^^^^ > The "take" part should probably be removed. > >> +@defvar hack-dir-local-get-variables-functions >> +This special hook holds the functions that gather the directory-local >> +variables to use for a given buffer. By default it contains just the >> +function that obeys the other settings described in the present section. >> +But it can be used to add support for more sources of directory-local >> +variables, such as those used by other text editors. >> + >> +The functions on this hook are called with no argument, in the buffer to >> +which we intend to apply the directory-local variables, after the >> +buffer's major mode function has been run, so it can use sources of > > I'm guessing you meant "they", not "it", because this refers to > "functions on this hook", right? > >> +directory hierarchy. Finally, since this hook is run every time we visit >> +a file it is important to try and keep those functions efficient, which >> +will usually require some of caching. > ^^^^^^^^^^^^^^^ > "some kind of caching", perhaps? Well, the upside is that the above shows the value of taking one's time when writing (I was in a bit of a hurry). Thanks, pushed, Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 07:59:47 2024 Received: (at 70105) by debbugs.gnu.org; 9 Jun 2024 11:59:47 +0000 Received: from localhost ([127.0.0.1]:33619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGHD8-0006Ix-Td for submit@debbugs.gnu.org; Sun, 09 Jun 2024 07:59:47 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:43081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGHD6-0006Ic-7a for 70105@debbugs.gnu.org; Sun, 09 Jun 2024 07:59:45 -0400 Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-52b78ef397bso4255611e87.0 for <70105@debbugs.gnu.org>; Sun, 09 Jun 2024 04:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717934302; x=1718539102; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=Feb/FJFg2nNrMw/zgFmhnxzczMB64CpUi4MdMHhYCIM=; b=CX4VFt+2syKDfVTQkut/FuE+BohKuqibpAP/Mn29x4x6t6GNdVv+yb7j5H2q/yM9uw vzZhJPyFNK+68tpEB8mup54ScC5qS2OWSEtYVjtZo+efdqQPXQvlmX3kjTl8y98OGV7+ RjuwJdoMQH+K1TpRr4Guk69Ki5tpUXS4wqM8iTze+AyPObYjl9XCbgGY/7r0cr7cL4er 27sLYDWzNtINs5tCR7hchsvUsFQv0ybveGY/eYZjjy8ZfdMrSbThbWoRMwjh8uETbNql CZYDdIEhZqcw3Q1zOT4uapnjJXpOO9FBDZxw2UYO33OxCTvXmqTtMpNhiyHX+4fCrlb+ 95rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717934302; x=1718539102; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Feb/FJFg2nNrMw/zgFmhnxzczMB64CpUi4MdMHhYCIM=; b=lXDUHzgfW6tA5SItg2zrKheCcoFP7wFbOXbef9XStd8ppv/zv54Dn73YYa1/Vrh5bk cDXGj+NgI30ZWKhQA8+ulYEZUSoRe0Kg9pRc8nOO9/1t0Ecay0HvwxVfVA5cD0/gWBON 62Nm4iE3SU+tPBePpCrzG8JlIhwb51SGxGKQeCsPi1Jt4VcW+LiLE3bo+OV+ibPV4MJb SC3WE13xzpFIPJiQrgpB+UW0sR1cmZJV05nZ5e/RfHHY1V7SDEcdVbu1wIiQdX3hCtom BqKAW1pA+h4fnSefnxnTUMl7X2MCphThbYmRBSJwvpaZRphmzKKXLRpT233LaNgtZXTB 9+pA== X-Forwarded-Encrypted: i=1; AJvYcCXVgirmqXlNipzCStJnjfnA5G/X8O5bZxE+6cwID5rkYD58ap+ei3r6uyv/OKr0RtG5hev8WCGStdx4El8JWroBhDg/jUA= X-Gm-Message-State: AOJu0YwqvEv7voPkgcUuoFKjz02A3Kn4EyH4qbBj/XDupF5sS5X1XNui 1AaGrmvZyFofw3YnASGQYlCXBTKqkhsfqDx9iNDLoMBWMVf3UxL6PK6BXKgqZQ27drCnZ2zMi+J /0VSbQbZjbOOxR3UVkAgyMYsWzJvU1FRK X-Google-Smtp-Source: AGHT+IEXiw8XpP+2QHuqo7z42rlAYanHX6+iu/n7ZQaeiS/Lw464gLuYu5MHVxi429NtpCDzkR6iaqLiIpdKwzYqR8o= X-Received: by 2002:aa7:d982:0:b0:57c:739c:b5bc with SMTP id 4fb4d7f45d1cf-57c739cb714mr1480561a12.13.1717933772085; Sun, 09 Jun 2024 04:49:32 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 9 Jun 2024 04:49:31 -0700 From: Stefan Kangas In-Reply-To: References: <867chibhqi.fsf@gnu.org> MIME-Version: 1.0 Date: Sun, 9 Jun 2024 04:49:31 -0700 Message-ID: Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box To: Stefan Monnier , Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70105 Cc: Jen-Chieh Shen , =?UTF-8?B?QmrDtnJuIEJpZGFy?= , 10sr <8slashes+git@gmail.com>, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > I'm hoping this can get into Emacs-30. > Comments/objections? Thanks for working on this. Your patches LGTM with Eli's comments. > (defun find-auto-coding (filename size) > + ;; FIXME: Shouldn't we use nil rather than "" to mean that there's no file? > + ;; FIXME: Clarify what the SOURCE is for in the return value? BTW, shouldn't this sentence now end with a "."? :-) From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 02:02:06 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 06:02:06 +0000 Received: from localhost ([127.0.0.1]:40411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJRuw-00058Y-CT for submit@debbugs.gnu.org; Tue, 18 Jun 2024 02:02:06 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJRuu-000582-68 for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 02:02:05 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4385780783; Tue, 18 Jun 2024 02:01:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718690513; bh=YsPcabaWSJB0KvqaA8AHRPksZrh8seBtBkBuM1IFkgI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EYbeFkCJgEzDg2DLMia2h710YZV2ruWpLMaMYBijBjyOQgyaK57uW1ppECHpseu47 D4NNC4sBTC01BlaMZAG61ZFquKE5uQ7chZRnSupv8jFc5ZOivjBwF+agj0LCyuhz90 bCOkOwMaFnI3QDREkPYGKjMgYGdAyl3guk73bW1T0r6jnD1CvZyRyRHpD/tyd+JETk YZ9wp8mNJOQWwvPtvc8qFDWB7RvjuT6/6Iqxp7o4OsjU2oRnlYe4Hed/+AJoJ41s+M 29/jyjdLq5A96egKo2EI40+mcVbx9V+oHZ1OjMZ3o7p7T3J/Nx5yY6jo/7fISvAZh5 zcPnBMRhHOwJA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E527E8089D; Tue, 18 Jun 2024 02:01:53 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A8330120193; Tue, 18 Jun 2024 02:01:53 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Monnier's message of "Sun, 09 Jun 2024 00:21:28 -0400") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Tue, 18 Jun 2024 02:01:51 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.080 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) OK, here's the other part. I pushed to the branch `scratch/emacs-editorconfig` a bunch of patches which add a few `lisp/editorconfig*.el` files. The main effect is to define a new (global) minor mode `editorconfig-mode` (I assumed we'll keep it disabled by default in Emacs-30, but I think it would make sense to enable by default in Emacs-31 (i.e. on `master` after the branch is cut)) as well as a new major mode `editorconfig-conf-mode` to edit `.editorconfig` files. I'm still working on the actual metadata of that branch, as well as etc/NEWS and doc, but in the mean time maybe you could look at the code to see if you have any objections there. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 02:19:51 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 06:19:52 +0000 Received: from localhost ([127.0.0.1]:40626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJSC7-0005eS-69 for submit@debbugs.gnu.org; Tue, 18 Jun 2024 02:19:51 -0400 Received: from mout02.posteo.de ([185.67.36.66]:43361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJSC4-0005eE-KR for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 02:19:49 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D65DA240104 for <70105@debbugs.gnu.org>; Tue, 18 Jun 2024 08:19:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1718691579; bh=lddRGjw/wuUDquKP+VlEYHMRHgecnPjLBawgUZVVSrw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=Bw5cjrEPXflLgpm3sic49knHH3X+8IB9aVxwN3kLgCgjMRr41ozSdN1k3WB7Vc1zu jAdgOjNnw8RPAg241z9h5FmeexoQYFqzQzGd9gnL9eXBBnUrA2h2r/sI7cmoiilUfD N3z0zGDBobeeC6l43r0BnDW0rk/dSdkH+CzTw0v3ByEG2tZyaeeFvKoCa9hjjDdd3o s0bz2r4HBOpUnzOL73/RBpMA8PlrIzTyMOLyfS9Su7LYYiA97YH9WZRbfdoy9J2AYr snS5cT9wfSCXTxpQ683PjiyiltFwMMYaAAr0oxWaCkU5EedcnqdpEjfeWiKmaKmldl SE8fZGC84kFIw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W3Gn619F3z9rxD; Tue, 18 Jun 2024 08:19:37 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Tue, 18 Jun 2024 06:21:17 +0000 Message-ID: <87bk3yai02.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > OK, here's the other part. > > I pushed to the branch `scratch/emacs-editorconfig` a bunch of patches > which add a few `lisp/editorconfig*.el` files. > > The main effect is to define a new (global) minor mode > `editorconfig-mode` (I assumed we'll keep it disabled by default in > Emacs-30, but I think it would make sense to enable by default in > Emacs-31 (i.e. on `master` after the branch is cut)) as well as a new > major mode `editorconfig-conf-mode` to edit `.editorconfig` files. Is it possible for major modes to indicate that [*] editorconfig setting must not be used? In particular, Org mode needs to use a fixed `tab-width' and editorconfig must not override that (it is a part of the syntax). We already had a user reporting problems caused by https://github.com/editorconfig/editorconfig-emacs where tab-width was changed to 4 by default. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 05:10:13 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 09:10:13 +0000 Received: from localhost ([127.0.0.1]:41780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJUqz-000221-0z for submit@debbugs.gnu.org; Tue, 18 Jun 2024 05:10:13 -0400 Received: from thaodan.de ([185.216.177.71]:44398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJUqw-00021n-H6 for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 05:10:11 -0400 Received: from odin (dsl-trebng12-50dc75-154.dhcp.inet.fi [80.220.117.154]) by thaodan.de (Postfix) with ESMTPSA id 64CB2D00055; Tue, 18 Jun 2024 12:10:01 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1718701801; bh=XctESLAbUvyPXMxPeiC9kfaMnW8wBjmxrrvdPS4LM4I=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=LA5EBdYD3oMJ3Suq6teEheSZzfeBadOmARhGtMN1YV2SweabbGca4PwoaI6iuhsmp mnXz4H4z4IuXzDsw9ISCzBbBHdADa5DneQxgxVGXRRsLjBb5ydR3VThdJ40mGK+Zat 46af3GOawsD8r3dkzz5mL9BMfsffvzjpiav+t4L2dXo+IsV112k3W5DuLAoI7PH7Lt n1UpWf2Oaj962N51NcoswOU+KXF+NfoIyY77MRz6m5KsnRXJOiAtD0b0cVvU2RZybn k3Wotp/6Mq+RFENSBdvGY3owtvtSrqqIfia8c7YPWbQ2w2UW+XhUQItesVxI+VPMI6 vQSC9eytgmm8Fcc/cgvurqdDdmsG/ShV2n0fzTb5kDMf71jt6azAVh2YsmqWmKTnqc Tod7Ln+OgMQFtHyt7UG2Hs6d9a8yrK4svuIvx8HyBvK+HAOtEWgE4H6FMzCaI5PnGN rKTvxTXu/V0BpPEpu/GatRIEevI+540i7IZtleDREbF4wX/gyR+IC7AHYRPEcLAah2 33K6AB8+d9W7z0sJqmhcMWgg8GJePylpJUk4/nPETRft3ePqUEXoS697trF22iRTeo SuLDD+Msp4UbZanAPHhOq+m52TlcE5N8gf852e4rNhLBj4x10qWiFJU0gMJgFe9n1+ dTv48FrXkVkeLu3g9xxfKsNM= From: =?utf-8?Q?Bj=C3=B6rn?= Bidar To: Stefan Monnier Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Monnier's message of "Tue, 18 Jun 2024 02:01:51 -0400") References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1+ntAhsDBQsJCAcCAiICBhUKCQgL AgQWAgMBAh4HAheAAAoJEFwbdKFlHF9oBgwA/iQHwe0VL4Df4GGTYlNjMSHFlIkBmN4UfYGLYj3E TrOUAQC51M+M3cjsL8WHdpBz6VAo6df9d+rVwhQ9vQuFHqevArg4BGTX6T4SCisGAQQBl1UBBQEB B0Cbohc3JEfn005/cm0AOGjSsW1ZxAkgaoVNjbpqk4MgNAMBCAeIeAQYFgoAIBYhBFHxdut1RzAe pymoq1wbdKFlHF9oBQJk1+k+AhsMAAoJEFwbdKFlHF9ooHABAKGmrGBic/Vys3BBrOQiRB3Z7izO HwhqTRpAqFZtXS2nAQDZhp/5aYw1TZjTzkm1KVt9QiYnjd/MvxRE9iaY6x4mDbgzBGTX6T4WCSsG AQQB2kcPAQEHQAgRJq/tMcCCB2XyA5WZpu7GvpRx0m9IPRWazeqhOq7uiO8EGBYKACAWIQRR8Xbr dUcwHqcpqKtcG3ShZRxfaAUCZNf71AIbIgCBCRBcG3ShZRxfaHYgBBkWCgAdFiEEUfF263VHMB6n KairXBt0oWUcX2gFAmTX+9QACgkQXBt0oWUcX2jeSwD6AtWn0cuo8IF35YRo4o3cDRJnUfJnbvJy GxyCDThR+zYBAKG6/jdwmZkBQZKslnDAbMMd2WfiZZT5JW3IWC4EaKMO7HkBAKYPGZ3UbfkRvfFK S+pQ9CgtNfkSJQBtT1Ob7Y6nsacgAQCpyXN7yppmhW/oBgivITPy9Lkg+V4NK9WZYZCU9Q7LBA== Date: Tue, 18 Jun 2024 12:10:00 +0300 Message-ID: <87v826hb13.fsf@> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Stefan Monnier writes: > OK, here's the other part. > > I pushed to the branch `scratch/emacs-editorconfig` a bunch of patches > which add a few `lisp/editorconfig*.el` files. > > The main effect is to define a new (global) [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.2 INVALID_MSGID Message-Id is not valid, according to RFC 2822 -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Stefan Monnier writes: > OK, here's the other part. > > I pushed to the branch `scratch/emacs-editorconfig` a bunch of patches > which add a few `lisp/editorconfig*.el` files. > > The main effect is to define a new (global) minor mode > `editorconfig-mode` (I assumed we'll keep it disabled by default in > Emacs-30, but I think it would make sense to enable by default in > Emacs-31 (i.e. on `master` after the branch is cut)) as well as a new > major mode `editorconfig-conf-mode` to edit `.editorconfig` files. > > I'm still working on the actual metadata of that branch, as well as > etc/NEWS and doc, but in the mean time maybe you could look at the code to > see if you have any objections there. > > Stefan Should your work complement/have a migration path from the upstream editorconfig Emacs package? It be good to avoid duplication and provide a smooth transition path. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 08:56:47 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 12:56:47 +0000 Received: from localhost ([127.0.0.1]:42212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJYOF-0002Ci-AK for submit@debbugs.gnu.org; Tue, 18 Jun 2024 08:56:47 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJYOD-0002CU-0w for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 08:56:46 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id CCE1580974; Tue, 18 Jun 2024 08:56:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718715393; bh=0I7xN3brqTGcpZmOH4m5GHNZ58oLivs9NhqGinXzBgY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=e6+Uz4hPcAkZ8QH3m9wL7hN7RyKsRrBFAGSDD4XuavYPu62xQRZwAXyKpgYmaBYFL 7IsoVvkbxbQ6SqozoD/ozkWSSXd5u37XHDAHewndU6WWeo+yV32g8Av8aRn0+8RlOe +08y9kIvszSQte7AwLloh+oTh6/Vg3ltKK3ZK4tbxVHOHGdkt8HOAdMxRXgkf+Iw28 PCImB4ToOOLfE3VrjwCQnYEBxcvuBPv/uN+hOdaanDYfvqHPyVJ5UCIKv5jnBrHCxn evrIC0e54QId3TKMbh2ddO706lElpaa9UBIiliDWAvkXsyjWNO/e7lqoTJ0bGRQGSK vMfzJry1MBDNA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B7BBA8004C; Tue, 18 Jun 2024 08:56:33 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8221F12068E; Tue, 18 Jun 2024 08:56:33 -0400 (EDT) From: Stefan Monnier To: =?windows-1252?Q?Bj=F6rn?= Bidar Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <87v826hb13.fsf@> (=?windows-1252?Q?=22Bj=F6rn?= Bidar"'s message of "Tue, 18 Jun 2024 12:10:00 +0300") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Tue, 18 Jun 2024 08:56:32 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.079 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> OK, here's the other part. >> >> I pushed to the branch `scratch/emacs-editorconfig` a bunch of patches >> which add a few `lisp/editorconfig*.el` files. >> >> The main effect is to define a new (global) minor mode >> `editorconfig-mode` (I assumed we'll keep it disabled by default in >> Emacs-30, but I think it would make sense to enable by default in >> Emacs-31 (i.e. on `master` after the branch is cut)) as well as a new >> major mode `editorconfig-conf-mode` to edit `.editorconfig` files. >> >> I'm still working on the actual metadata of that branch, as well as >> etc/NEWS and doc, but in the mean time maybe you could look at the code to >> see if you have any objections there. >> >> Stefan > > Should your work complement/have a migration path from the upstream > editorconfig Emacs package? It be good to avoid duplication and provide > a smooth transition path. "My work" is the integration of the upstream package into Emacs. The submitted code is currently not completely in sync with upstream, but mostly because I removed some features which I'm not completely sure yet if/how we'll support them. This non-syncness is temporary because I want to try and have it included in Emacs-30. Once that is done, I'll work on merging the changes I made back upstream, as well as smoothing over the remaining differences. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 09:17:17 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 13:17:17 +0000 Received: from localhost ([127.0.0.1]:42228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJYi4-0002i6-MI for submit@debbugs.gnu.org; Tue, 18 Jun 2024 09:17:16 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJYi1-0002ht-TQ for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 09:17:15 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B8A84441640; Tue, 18 Jun 2024 09:17:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718716624; bh=NWNvIGWjYg8d/EXhT1GCcDRFTwZvgmxc4ce48AK0JII=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iRYPAlbLJxxCmhUOnHNz8ZE6FcrUPzow6RSCH6pJAE876O85umK61LKgNvZIFQTmN nI+S3B2gW/YUI55j5xZtDK5Mbu9BJoGZYwevjStB7MERKta9ynQ/6mi40UTyUvWORp FLgKSXMTP8pPH7vpDzgFZ8Z/VTo4wZOYyUuFtYG1rx/+oOMVbwP9X3GiGCgtyVjN7A Pq6gCFn+dWpuz22cFbiHogMPcJlb6NzKoyZau9Dzc9Ra5bj74wWPyvXx6ZqqJtDhkf 0ryb8ON7wuP11vMFa1DHaatTLntQrF5Ouy4cJWOG4+2/SBu0BkBRbBhkZkTS6Ml8fp YbltxLJDG8NHQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3D22D441606; Tue, 18 Jun 2024 09:17:04 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 023301203FF; Tue, 18 Jun 2024 09:17:03 -0400 (EDT) From: Stefan Monnier To: Ihor Radchenko Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <87bk3yai02.fsf@localhost> (Ihor Radchenko's message of "Tue, 18 Jun 2024 06:21:17 +0000") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> <87bk3yai02.fsf@localhost> Date: Tue, 18 Jun 2024 09:17:03 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.087 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I pushed to the branch `scratch/emacs-editorconfig` a bunch of patches >> which add a few `lisp/editorconfig*.el` files. >> The main effect is to define a new (global) minor mode >> `editorconfig-mode` (I assumed we'll keep it disabled by default in >> Emacs-30, but I think it would make sense to enable by default in >> Emacs-31 (i.e. on `master` after the branch is cut)) as well as a new >> major mode `editorconfig-conf-mode` to edit `.editorconfig` files. > Is it possible for major modes to indicate that [*] editorconfig setting > must not be used? In the upstream package, yes, but I have not included that part currently in the code I submit to Emacs. > In particular, Org mode needs to use a fixed `tab-width' and > editorconfig must not override that (it is a part of the syntax). I don't understand: `tab-width` mostly affects the display, how can it break Org mode? In any case, Org is not the only mode with such needs (Makefile, Haskell, Python, come to mind). But also, disabling editorconfig wholesale seems a bit crude. Maybe we'll need a more targeted way to address the problem (and there's always `hack-local-variables-hook`). > We already had a user reporting problems caused by > https://github.com/editorconfig/editorconfig-emacs where tab-width was > changed to 4 by default. The upstream code sets `tab-width` in more cases than the code I'm submitting, so maybe I already fixed the problem? Do you have a more precise URL for the issue? Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 12:19:56 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 16:19:56 +0000 Received: from localhost ([127.0.0.1]:44660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJbYp-0005Ff-Me for submit@debbugs.gnu.org; Tue, 18 Jun 2024 12:19:56 -0400 Received: from mout01.posteo.de ([185.67.36.65]:42505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJbYn-0005FN-9z for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 12:19:54 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9113A240027 for <70105@debbugs.gnu.org>; Tue, 18 Jun 2024 18:19:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1718727584; bh=tn8ZrcYcLUm/+cIxsLaIBU+ZCFe68hZM9xyO+CbuKnM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=Ci27b24mFh8GYv5Qa0qgDs2voXZfmIyfsko+OEGfEyUDW9KJXfOCqS7d8kTlZ0hR1 bwmqEnPwrRdx+uizelTlXZ2Lwm6OKelz8Jeo9b0+cOXpZmVW38r6ou5kZmWhOZb/S0 m7jAqpvB5UrvWgdPyuH4IlztO80fBNCvAwCjfy4oxa3BNLkN2TvO1TTOpGAslZw/Ab DXi/8A4gCicnm1v27kBU/wDdck5cfZdZZ5e//r/Q8Kzs2L2eXLbhwdwgH1k9jKTz04 W/NwamxFcZ6U5Kyv6x9aIZ8HUsABfjhOj8rR7Xse05nd/FtLWm2jdsZfbZytvfGxLj aErF8LLb+gcQQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W3X5V4t8vz6ty4; Tue, 18 Jun 2024 18:19:42 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> <87bk3yai02.fsf@localhost> Date: Tue, 18 Jun 2024 16:21:26 +0000 Message-ID: <87y172ql15.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> In particular, Org mode needs to use a fixed `tab-width' and >> editorconfig must not override that (it is a part of the syntax). > > I don't understand: `tab-width` mostly affects the display, how can it > break Org mode? Because Org mode syntax depends on indentation for lists: - parent list - sub-list - sub-sub-list When the indentation has tabs in it, (current-indentation) return value becomes a variable of `tab-width'. As a result, Org file syntax unexpectedly becomes dependent on seemingly unrelated Emacs configuration toggle. (I also considered let-binding `tab-width' when Org parser the file, but lists will then look funny visually) > In any case, Org is not the only mode with such needs (Makefile, Haskell, > Python, come to mind). But also, disabling editorconfig wholesale seems > a bit crude. Maybe we'll need a more targeted way to address the problem > (and there's always `hack-local-variables-hook`). I did not imply that editorconfig should be _completely_ disabled. Just for tab-width in our case. I guess that `hack-local-variables-hook' should be an ok option. Although it feels a bit funny to: 1. Set tab-width in org-mode body 2. Set it again in hack-local-variables-hook >> We already had a user reporting problems caused by >> https://github.com/editorconfig/editorconfig-emacs where tab-width was >> changed to 4 by default. > > The upstream code sets `tab-width` in more cases than the code > I'm submitting, so maybe I already fixed the problem? > Do you have a more precise URL for the issue? Hmm... Sorry, I cannot see anything in the list archives. Either I made things up in my mind or it was discussed on IRC/Matrix. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 15:27:40 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 19:27:40 +0000 Received: from localhost ([127.0.0.1]:49418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJeUV-0005tm-Jt for submit@debbugs.gnu.org; Tue, 18 Jun 2024 15:27:40 -0400 Received: from mail-ed1-f46.google.com ([209.85.208.46]:51450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJeUT-0005tP-0j for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 15:27:38 -0400 Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-57d044aa5beso962493a12.2 for <70105@debbugs.gnu.org>; Tue, 18 Jun 2024 12:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718738788; x=1719343588; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=eKrfOkgChDCxKLig78G1U1kIHXzv5iyT3CaG3k69jCI=; b=My45Jj1jzG+YblojvQJoNjVJ4ZpfDnbY6MmwwsBGE3susFPQ4al+bmOguvbAkaD+G7 2x3JNyi2218d0u7y3wg9QF7anv07x4O+QoprkQf3cJLUuhH4INNAkpXx84bl9duSuRpj J1ytZHfCmYWjbNfHJ6fP3x5z2gJ4riYG5BQVq8G66xhXWquCcTEEKz/WwUP0gXEZ8clL Tl9GJTX24b6DnYHB9/uhAWGIZIYWSUaqTw+gaYf8buSICIcFi7LZOBu6gX+CaY9wIIR7 gnI6yGXLLZtbUP1su8H/1zXj5xU2eHC5eXgLPH4vCjKWZ7ZgwKGAp3Pe5p6UagsG+XIy konQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718738788; x=1719343588; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eKrfOkgChDCxKLig78G1U1kIHXzv5iyT3CaG3k69jCI=; b=DjMtJfp3Pa7ctCznPthK5WUVMZqGRbLbecdadUppIt0JZt3iXpaPrCtBNPC/iPAVES pnhEJNKZ4Jp3PqhaXW5L08MlJBgra/ADkQvhsFd7zPZb/FcfwCd2gDaTdFBgb9WeOoav yLSTTIieiqODWz3x0Rf1Y5d0j23G+uS/owL7vrs6S5m3OeCPH5HVgsEHyHasPRLDaZw4 KJ1aPnxaV+oHCuyqR8UEhJ/AZXJuTqGsi1j97ufm7tuX7neju3A/YvD+GkBhn3v3A9RL D51hxIZJv6DE1jKJYylp7NjzF7mwUz4sx6HZzdDT8VcVWDV72aCJn4l7NImZQ232S1BX I7Mw== X-Forwarded-Encrypted: i=1; AJvYcCU5mGPzG0Yqi0RP0fei41zRkv+lyMvgmtLAkeq+9DXUXf+meIpwmiIw93SNGnBEeqHRxu4P7LLxWdxAp7CzdVOU3Xvs8Oc= X-Gm-Message-State: AOJu0Ywkc/7FPzavSWpWAaUuklpa8jFc0JC3f8C8hhtMToCd0Eu9d9f4 PIqjydLYyE9KbDHzP6sX35zIcbPXFPO55kC/46NzNTeDAcqWIYbMxIez5wdFHNiVs5uW07DHZ9m vnStrtg/D5JIZwViMG3xpjtGVARM= X-Google-Smtp-Source: AGHT+IEGA1jru2d27cVTv96gcuTKw6hD9eOEVBvIzZRrKljV2H/Rx0t8dOyaHrMenkeZ8831+irR/yJx+5PPgUn2qn4= X-Received: by 2002:a50:ccd4:0:b0:57c:a4a8:70f0 with SMTP id 4fb4d7f45d1cf-57d07e421d3mr226557a12.15.1718738788271; Tue, 18 Jun 2024 12:26:28 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 18 Jun 2024 12:26:26 -0700 From: Stefan Kangas In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> MIME-Version: 1.0 Date: Tue, 18 Jun 2024 12:26:26 -0700 Message-ID: Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box To: Stefan Monnier , Eli Zaretskii Content-Type: multipart/mixed; boundary="000000000000efe85f061b2f0ead" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000efe85f061b2f0ead Content-Type: text/plain; charset="UTF-8" Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > I'm still working on the actual metadata of that branch, as well as > etc/NEWS and doc, but in the mean time maybe you could look at the code to > see if you have any objections there. No objections here. I've attached a small patch with some minor doc fixes, feel free to use it if it's of any help. BTW, package-lint gives the following warning: 540:13: error: You should depend on (emacs "28.1") or the compat package if you need `dlet'. --000000000000efe85f061b2f0ead Content-Type: text/x-patch; charset="US-ASCII"; name="0001-minor-fixes.patch" Content-Disposition: attachment; filename="0001-minor-fixes.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 1c07ac5e0c22efe4_0.1 RnJvbSBhZGY3ZGRiMzUwYmMyYWU1ZWRjYmZhZWQxNzA3NDE4MmU1ZmNhMTEyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5rYW5nYXNAZ21haWwuY29t PgpEYXRlOiBUdWUsIDE4IEp1biAyMDI0IDIxOjE3OjIxICswMjAwClN1YmplY3Q6IFtQQVRDSF0g bWlub3IgZml4ZXMKCi0tLQogZG9jL21hbi9lZGl0b3Jjb25maWcudGV4aSAgICAgICAgfCAzNSAr KysrKysrKysrKysrKysrLS0tLS0tLS0tLS0tLS0tLQogbGlzcC9lZGl0b3Jjb25maWctY29yZS1o YW5kbGUuZWwgfCAgMyArLS0KIGxpc3AvZWRpdG9yY29uZmlnLmVsICAgICAgICAgICAgIHwgIDQg KystLQogMyBmaWxlcyBjaGFuZ2VkLCAyMSBpbnNlcnRpb25zKCspLCAyMSBkZWxldGlvbnMoLSkK CmRpZmYgLS1naXQgYS9kb2MvbWFuL2VkaXRvcmNvbmZpZy50ZXhpIGIvZG9jL21hbi9lZGl0b3Jj b25maWcudGV4aQppbmRleCA1ZTdkM2I4NTU1Mi4uOThiYzg3NzQzYTUgMTAwNjQ0Ci0tLSBhL2Rv Yy9tYW4vZWRpdG9yY29uZmlnLnRleGkKKysrIGIvZG9jL21hbi9lZGl0b3Jjb25maWcudGV4aQpA QCAtMSwxMCArMSwxMCBAQAogQGRpcmNhdGVnb3J5IEVtYWNzCiBAZGlyZW50cnkKLSogRWRpdG9y Q29uZmlnOiAoZWRpdG9yY29uZmlnKS4gRWRpdG9yQ29uZmlnIEVtYWNzIFBsdWdpbi4KKyogRWRp dG9yQ29uZmlnOiAoZWRpdG9yY29uZmlnKS4gRWRpdG9yQ29uZmlnIFBsdWdpbi4KIEBlbmQgZGly ZW50cnkKIAogQG5vZGUgVG9wCi1AY2hhcHRlciBFZGl0b3JDb25maWcgRW1hY3MgUGx1Z2luCitA Y2hhcHRlciBFZGl0b3JDb25maWcgUGx1Z2luCiBAYW5jaG9yeyNlZGl0b3Jjb25maWctZW1hY3Mt cGx1Z2lufQogVGhpcyBpcyBhbiBAdXJlZntodHRwczovL2VkaXRvcmNvbmZpZy5vcmcsRWRpdG9y Q29uZmlnfSBwbHVnaW4gZm9yCiBAdXJlZntodHRwczovL3d3dy5nbnUub3JnL3NvZnR3YXJlL2Vt YWNzLyxFbWFjc30uCkBAIC0yMywxOCArMjMsMTkgQEAgR2V0dGluZyBTdGFydGVkCiBAYW5jaG9y eyNnZXR0aW5nLXN0YXJ0ZWR9CiAKIEBtZW51Ci0qIHBhY2thZ2VlbDo6CisqIHBhY2thZ2U6Ogog KiB1c2UtcGFja2FnZTo6CiAqIE1hbnVhbCBpbnN0YWxsYXRpb246OgogQGVuZCBtZW51CiAKLUBu b2RlIHBhY2thZ2VlbAorQG5vZGUgcGFja2FnZQogQHN1YnNlY3Rpb24gcGFja2FnZS5lbAogQGFu Y2hvcnsjcGFja2FnZS5lbH0KLVRoaXMgcGFja2FnZSBpcyBhdmFpbGFibGUgZnJvbQotQHVyZWZ7 aHR0cHM6Ly9tZWxwYS5vcmcvIy9lZGl0b3Jjb25maWcsTUVMUEF9LAotQHVyZWZ7aHR0cHM6Ly9z dGFibGUubWVscGEub3JnLyMvZWRpdG9yY29uZmlnLE1FTFBBIFN0YWJsZX0gYW5kCisKK1RoaXMg cGFja2FnZSBpcyBzaGlwcGVkIHdpdGggRW1hY3MuICBNb3JlIHJlY2VudCB2ZXJzaW9ucyBjYW4g YmUKK2luc3RhbGxlZCBmcm9tCiBAdXJlZntodHRwOi8vZWxwYS5ub25nbnUub3JnL25vbmdudS9l ZGl0b3Jjb25maWcuaHRtbCxOb25HTlUgRUxQQX0uCisKIEluc3RhbGwgZnJvbSB0aGVzZSByZXBv c2l0b3JpZXMgYW5kIGVuYWJsZSBnbG9iYWwgbWlub3ItbW9kZQogQGNvZGV7ZWRpdG9yY29uZmln LW1vZGV9OgogCkBAIC00Myw3ICs0NCw3IEBAIHBhY2thZ2VlbAogQGVuZCB2ZXJiYXRpbQogCiBO b3JtYWxseSwgZW5hYmxpbmcgQGNvZGV7ZWRpdG9yY29uZmlnLW1vZGV9IHNob3VsZCBiZSBlbm91 Z2ggZm9yIHRoaXMKLXBsdWdpbiB0byB3b3JrOiBhbGwgb3RoZXIgY29uZmlndXJhdGlvbnMgYXJl IG9wdGlvbmFsLiBUaGlzIG1vZGUgc2V0cyB1cAorcGx1Z2luIHRvIHdvcms6IGFsbCBvdGhlciBj b25maWd1cmF0aW9ucyBhcmUgb3B0aW9uYWwuICBUaGlzIG1vZGUgc2V0cyB1cAogaG9va3Mgc28g dGhhdCBFZGl0b3JDb25maWcgcHJvcGVydGllcyB3aWxsIGJlIGxvYWRlZCBhbmQgYXBwbGllZCB0 byB0aGUKIG5ldyBidWZmZXJzIGF1dG9tYXRpY2FsbHkgd2hlbiB2aXNpdGluZyBmaWxlcy4KIApA QCAtMTI5LDcgKzEzMCw3IEBAIEZpbGUgVHlwZSBmaWxlX3R5cGVfZXh0IGZpbGVfdHlwZV9lbWFj cwogQHN1YnNlY3Rpb24gRmlsZSBUeXBlIChmaWxlX3R5cGVfZXh0LCBmaWxlX3R5cGVfZW1hY3Mp CiBAYW5jaG9yeyNmaWxlLXR5cGUtZmlsZV90eXBlX2V4dC1maWxlX3R5cGVfZW1hY3N9CiBGaWxl LXR5cGUgZmVhdHVyZSBpcyBjdXJyZW50bHkgZGlzYWJsZWQsIGJlY2F1c2UgdGhpcyBwYWNrYWdl IGlzIG5vdwotdW5kZXJnb2luZyBiaWcgaW50ZXJuYWwgcmVmYWN0b3JpbmcuIEZvciB0aG9zZSB3 aG8gd2FudCB0aGlzCit1bmRlcmdvaW5nIGJpZyBpbnRlcm5hbCByZWZhY3RvcmluZy4gIEZvciB0 aG9zZSB3aG8gd2FudCB0aGlzCiBmdW5jdGlvbmFsaXR5LCBwbGVhc2UgY29uc2lkZXIgdXNpbmcK IEB1cmVme2h0dHBzOi8vZ2l0aHViLmNvbS8xMHNyL2VkaXRvcmNvbmZpZy1jdXN0b20tbWFqb3Jt b2RlLWVsLGVkaXRvcmNvbmZpZy1jdXN0b20tbWFqb3Jtb2RlfS4KIApAQCAtMTU5LDcgKzE2MCw3 IEBAIGVkaXRvcmNvbmZpZy10cmltLXdoaXRlc3BhY2VzLW1vZGUKIAogT25lIHBvc3NpYmxlIHZh bHVlIGlzCiBAdXJlZntodHRwczovL2dpdGh1Yi5jb20vbGV3YW5nL3dzLWJ1dGxlcixAY29kZXt3 cy1idXRsZXItbW9kZX19LCB3aXRoCi13aGljaCBvbmx5IGxpbmVzIHRvdWNoZWQgZ2V0IHRyaW1t ZWQuIFRvIHVzZSBpdCwgYWRkIGZvbGxvd2luZyB0byB5b3VyCit3aGljaCBvbmx5IGxpbmVzIHRv dWNoZWQgZ2V0IHRyaW1tZWQuICBUbyB1c2UgaXQsIGFkZCBmb2xsb3dpbmcgdG8geW91cgogaW5p dC5lbDoKIAogQHZlcmJhdGltCkBAIC0yMTUsNyArMjE2LDcgQEAgVHJvdWJsZXNob290aW5nCiBA Y29kZXtNLXggZWRpdG9yY29uZmlnLWRpc3BsYXktY3VycmVudC1wcm9wZXJ0aWVzfS4KIAogVGhp cyBjb21tYW5kIHdpbGwgb3BlbiBhIG5ldyBidWZmZXIgYW5kIGRpc3BsYXkgdGhlIEVkaXRvckNv bmZpZwotcHJvcGVydGllcyBsb2FkZWQgZm9yIGN1cnJlbnQgYnVmZmVyLiBZb3UgY2FuIGNoZWNr IGlmIEVkaXRvckNvbmZpZworcHJvcGVydGllcyBsb2FkZWQgZm9yIGN1cnJlbnQgYnVmZmVyLiAg WW91IGNhbiBjaGVjayBpZiBFZGl0b3JDb25maWcKIHByb3BlcnRpZXMgd2VyZSBub3QgcmVhZCBm b3IgYnVmZmVycyBhdCBhbGwsIG9yIHRoZXkgd2VyZSBsb2FkZWQgYnV0IGRpZAogbm90IHRha2Ug ZWZmZWN0IGZvciBzb21lIG90aGVyIHJlYXNvbnMuCiAKQEAgLTIzMiw4ICsyMzMsOCBAQCBJbmRl bnRhdGlvbiBmb3IgbmV3IG1ham9yLW1vZGVzCiBAY29kZXtpbmRlbnRfc2l6ZX0gcHJvcGVydHku CiAKIEJ5IGRlZmF1bHQgdGhpcyBwbHVnaW4gc2hpcHMgd2l0aCBzZXR0aW5ncyBmb3IgbWFueSBt YWpvci1tb2RlcywgYnV0LAotc29ycnkgdG8gc2F5LCBpdCBjYW5ub3QgYmUgcGVyZmVjdC4gRXNw ZWNpYWxseSBpdCBpcyBkaWZmaWN1bHQgdG8KLXN1cHBvcnQgYnJhbmQtbmV3IG1ham9yLW1vZGVz LiBQbGVhc2UgZmVlbCBmcmVlIHRvIHN1Ym1pdCBpc3N1ZSBvcgorc29ycnkgdG8gc2F5LCBpdCBj YW5ub3QgYmUgcGVyZmVjdC4gIEVzcGVjaWFsbHkgaXQgaXMgZGlmZmljdWx0IHRvCitzdXBwb3J0 IGJyYW5kLW5ldyBtYWpvci1tb2Rlcy4gIFBsZWFzZSBmZWVsIGZyZWUgdG8gc3VibWl0IGlzc3Vl IG9yCiBwdWxsLXJlcXVlc3QgZm9yIHN1Y2ggbWFqb3ItbW9kZSEKIAogU3VwcG9ydGVkIG1ham9y LW1vZGVzIGFuZCB0aGVpciBpbmRlbnRhdGlvbiBjb25maWdzIGFyZSBkZWZpbmVkIGluIHRoZQpA QCAtMjQzLDEzICsyNDQsMTMgQEAgTm90IHdvcmsgYXQgYWxsIGZvciBGT08tbW9kZSEKIEBzdWJz ZWN0aW9uIE5vdCB3b3JrIGF0IGFsbCBmb3IgRk9PLW1vZGUhCiBAYW5jaG9yeyNub3Qtd29yay1h dC1hbGwtZm9yLWZvby1tb2RlfQogTW9zdCBjYXNlcyBwcm9wZXJ0aWVzIGFyZSBsb2FkZWQganVz dCBhZnRlciB2aXNpdGluZyBmaWxlcyB3aGVuCi1AY29kZXtlZGl0b3Jjb25maWctbW9kZX0gaXMg ZW5hYmxlZC4gQnV0IGl0IGlzIGtub3duIHRoYXQgdGhlcmUgYXJlCitAY29kZXtlZGl0b3Jjb25m aWctbW9kZX0gaXMgZW5hYmxlZC4gIEJ1dCBpdCBpcyBrbm93biB0aGF0IHRoZXJlIGFyZQogbWFq b3ItbW9kZXMgdGhhdCB0aGlzIG1lY2hhbmlzbSBkb2VzIG5vdCB3b3JrIGZvciBhbmQgcmVxdWly ZSBleHBsaWNpdAogY2FsbCBvZiBAY29kZXtlZGl0b3Jjb25maWctYXBwbHl9LgogCiBUeXBpY2Fs bHkgaXQgd2lsbCBvY2N1ciB3aGVuIHRoZSBtYWpvci1tb2RlIGlzIG5vdCBkZWZpbmVkIHVzaW5n CiBAY29kZXtkZWZpbmUtZGVyaXZlZC1tb2RlfSAoQGNvZGV7cnBtLXNwZWMtbW9kZX0gaXMgYW4g ZXhhbXBsZSBmb3IKLXRoaXMpLiBQbGVhc2UgZmVlbCBmcmVlIHRvIHN1Ym1pdCBpc3N1ZXMgaWYg eW91IGZpbmQgc3VjaCBtb2RlcyEKK3RoaXMpLiAgUGxlYXNlIGZlZWwgZnJlZSB0byBzdWJtaXQg aXNzdWVzIGlmIHlvdSBmaW5kIHN1Y2ggbW9kZXMhCiAKIEBub2RlIFN1Ym1pdHRpbmcgQnVncyBh bmQgRmVhdHVyZSBSZXF1ZXN0cwogQHNlY3Rpb24gU3VibWl0dGluZyBCdWdzIGFuZCBGZWF0dXJl IFJlcXVlc3RzCkBAIC0yODgsMTAgKzI4OSwxMCBAQCBMaWNlbnNlCiAKIFRoaXMgcHJvZ3JhbSBp cyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLCBidXQKIFdJ VEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YK LU1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gU2Vl IHRoZSBHTlUgR2VuZXJhbAorTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEgUEFSVElD VUxBUiBQVVJQT1NFLiAgU2VlIHRoZSBHTlUgR2VuZXJhbAogUHVibGljIExpY2Vuc2UgZm9yIG1v cmUgZGV0YWlscy4KIAogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05V IEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYWxvbmcKLXdpdGggdGhpcyBwcm9ncmFtLiBJZiBub3Qs IHNlZSBAdXJse2h0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvfS4KK3dpdGggdGhpcyBwcm9n cmFtLiAgSWYgbm90LCBzZWUgQHVybHtodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzL30uCiAK IEBieWUKZGlmZiAtLWdpdCBhL2xpc3AvZWRpdG9yY29uZmlnLWNvcmUtaGFuZGxlLmVsIGIvbGlz cC9lZGl0b3Jjb25maWctY29yZS1oYW5kbGUuZWwKaW5kZXggZDIyNWUxNDU2YmEuLmMyNGFmYTEx NDU1IDEwMDY0NAotLS0gYS9saXNwL2VkaXRvcmNvbmZpZy1jb3JlLWhhbmRsZS5lbAorKysgYi9s aXNwL2VkaXRvcmNvbmZpZy1jb3JlLWhhbmRsZS5lbApAQCAtNzQsOCArNzQsNyBAQCBlZGl0b3Jj b25maWctY29yZS1oYW5kbGUKICAgTGFzdCBtb2RpZmllZCB0aW1lIG9mIC5lZGl0b3Jjb25maWcg ZmlsZS4KIAogYHBhdGgnCi0gIEFic29sdXRlIHBhdGggdG8gLmVkaXRvcmNvbmZpZyBmaWxlLicK LSIKKyAgQWJzb2x1dGUgcGF0aCB0byAuZWRpdG9yY29uZmlnIGZpbGUuIgogICAodG9wLXByb3Bz IG5pbCkKICAgKHNlY3Rpb25zIG5pbCkKICAgKG10aW1lIG5pbCkKZGlmZiAtLWdpdCBhL2xpc3Av ZWRpdG9yY29uZmlnLmVsIGIvbGlzcC9lZGl0b3Jjb25maWcuZWwKaW5kZXggOGMzNGY5NDA5M2Mu LmE3ZTM0NDM0MjU4IDEwMDY0NAotLS0gYS9saXNwL2VkaXRvcmNvbmZpZy5lbAorKysgYi9saXNw L2VkaXRvcmNvbmZpZy5lbApAQCAtMSw0ICsxLDQgQEAKLTs7OyBlZGl0b3Jjb25maWcuZWwgLS0t IEVkaXRvckNvbmZpZyBFbWFjcyBQbHVnaW4gIC0qLSBsZXhpY2FsLWJpbmRpbmc6IHQgLSotCis7 OzsgZWRpdG9yY29uZmlnLmVsIC0tLSBFZGl0b3JDb25maWcgUGx1Z2luICAtKi0gbGV4aWNhbC1i aW5kaW5nOiB0IC0qLQogCiA7OyBDb3B5cmlnaHQgKEMpIDIwMTEtMjAyNCBFZGl0b3JDb25maWcg VGVhbQogCkBAIC0xODIsNyArMTgyLDcgQEAgZWRpdG9yY29uZmlnLWluZGVudGF0aW9uLWFsaXN0 CiAgICAgKHdlYi1tb2RlIC4gZWRpdG9yY29uZmlnLS1nZXQtaW5kZW50YXRpb24td2ViLW1vZGUp CiAgICAgKHppZy1tb2RlIHppZy1pbmRlbnQtb2Zmc2V0KQogICAgICkKLSAgIkFsaXN0IG9mIGlu ZGVudGF0aW9uIHNldHRpbmcgbWV0aG9kcyBieSBtb2RlcworICAiQWxpc3Qgb2YgaW5kZW50YXRp b24gc2V0dGluZyBtZXRob2RzIGJ5IG1vZGVzLgogCiBUaGlzIGlzIGEgZmFsbGJhY2sgdXNlZCBm b3IgdGhvc2UgbW9kZXMgd2hpY2ggZG9uJ3Qgc2V0CiBgZWRpdG9yY29uZmlnLWluZGVudC1zaXpl LXZhcnMnLgotLSAKMi40NS4yCgo= --000000000000efe85f061b2f0ead-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 15:38:14 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 19:38:14 +0000 Received: from localhost ([127.0.0.1]:49714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJeej-0006KO-WF for submit@debbugs.gnu.org; Tue, 18 Jun 2024 15:38:14 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15133) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJeeg-0006K6-Ps for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 15:38:11 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B7E51444491; Tue, 18 Jun 2024 15:38:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718739479; bh=mxxeo7VnD5cyrJld5Uxq8pYsRaVvwG3QmDEJVFrtDKo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=YzRl3f7AV8E5JMYV0wQs4xR82JZVDuCHTPV/cZCSNhbjsX7Dn/ebSHeY5c+Xj+kwV NozrnDCTBrVjdzxaygw1Nwsfju/gggbf6rRelDwwawKpAFELJZioAzLSVxDa6EwoUz PPW0BO6iddokP19XhyFcsCkc7KfZUCVV9JO7QOIb9ErSY35V1QlVx+PvhyBzz8VB/5 Ti42BUzwDBumQYTmdb79guwVA/w//TILETJAKddQja6PGecXJWqm6l7fCYczZPmAeD 48RheGgjq12RrUSmcWjmNonBHcw8D/IbUx4KfI+1abivKs2q+U8iUikbeoJNPYblBF lmgzQEsZsw2Rw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1F1BA44446F; Tue, 18 Jun 2024 15:37:59 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0F1C3120193; Tue, 18 Jun 2024 15:37:59 -0400 (EDT) From: Stefan Monnier To: Ihor Radchenko Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <87y172ql15.fsf@localhost> (Ihor Radchenko's message of "Tue, 18 Jun 2024 16:21:26 +0000") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> <87bk3yai02.fsf@localhost> <87y172ql15.fsf@localhost> Date: Tue, 18 Jun 2024 15:37:52 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.199 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >>> In particular, Org mode needs to use a fixed `tab-width' and >>> editorconfig must not override that (it is a part of the syntax). >> I don't understand: `tab-width` mostly affects the display, how can it >> break Org mode? > Because Org mode syntax depends on indentation for lists: > > - parent list > - sub-list > - sub-sub-list > > When the indentation has tabs in it, (current-indentation) return value > becomes a variable of `tab-width'. As a result, Org file syntax > unexpectedly becomes dependent on seemingly unrelated Emacs > configuration toggle. > (I also considered let-binding `tab-width' when Org parser the file, but > lists will then look funny visually) If you use the `tab-width` set by the user then you have the advantage that you parse the code in a way that is consistent with what the users see (so the problem only bites the users who don't look at their code). If you parse with a fixed `tab-width` OTOH the user may be puzzled because the code looks like one thing to them but you parse it as something else. >> In any case, Org is not the only mode with such needs (Makefile, Haskell, >> Python, come to mind). But also, disabling editorconfig wholesale seems >> a bit crude. Maybe we'll need a more targeted way to address the problem >> (and there's always `hack-local-variables-hook`). > I did not imply that editorconfig should be _completely_ disabled. > Just for tab-width in our case. I mentioned it because that's the option that the upstream package offers. > I guess that `hack-local-variables-hook' should be an ok > option. Although it feels a bit funny to: > 1. Set tab-width in org-mode body > 2. Set it again in hack-local-variables-hook There's also the option of saying that it's the user's fault. It's hard to tell in general what would be the right behavior, so I think it's important we look at concrete cases. > Hmm... Sorry, I cannot see anything in the list archives. > Either I made things up in my mind or it was discussed on IRC/Matrix. I guess we'll have to wait to see if the issue pops up again. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 15:48:01 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 19:48:02 +0000 Received: from localhost ([127.0.0.1]:49996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJeoD-0006jz-MH for submit@debbugs.gnu.org; Tue, 18 Jun 2024 15:48:01 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJeoC-0006ja-Bo for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 15:48:00 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 206AE4444A1; Tue, 18 Jun 2024 15:47:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718740070; bh=s3iE29gFl7cdgqdnh6x2giwOCeBJP7GBg+9jx7OeQhM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=UHvgZtsBoXovDSIDiuvYEG8NfgWgQPux2P704VITFftz5fNEu0z2/uYyTFPuGOJww aTF2zUTgX68e5r2zzU1H4vhMb1sV/AXfwsLagAU7sJtiTYYYyFAt+EmIZcrUTO6dZy bqtAJaSHEmJGO8+eZjcZIiAlXX8C+i0x5670ry57ic54A1In4d339C/rAo8fYta0kZ s+pWMXuwTY4WI5e/y2Szu6L3nmudQDGiNqrMDieMXp8bIPhMGVLqRlmK4DyVZ3AZ13 sA5c0rJyCdK63K+nro2npWKdfVKRIvlAxp3IAu/5wVKoypC1n8AApXXThkf+koUyWL LbRai8G/yKLxA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D63CD44446F; Tue, 18 Jun 2024 15:47:50 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C3DBB12032D; Tue, 18 Jun 2024 15:47:50 -0400 (EDT) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Kangas's message of "Tue, 18 Jun 2024 12:26:26 -0700") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Tue, 18 Jun 2024 15:47:43 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.194 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I'm still working on the actual metadata of that branch, as well as >> etc/NEWS and doc, but in the mean time maybe you could look at the code to >> see if you have any objections there. > No objections here. > I've attached a small patch with some minor doc fixes, feel free to use > it if it's of any help. Thanks. I'm planning on integrating the texi into Emacs's user manual, so I'll probably have to massage it significantly. > BTW, package-lint gives the following warning: > 540:13: error: You should depend on (emacs "28.1") or the compat > package if you need `dlet'. Good catch, thanks. It's not an issue for `master` (it's even in code that's not used on `master`), but I'll have to deal with that when I send the patches upstream. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 15:54:05 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 19:54:05 +0000 Received: from localhost ([127.0.0.1]:50182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJeu5-00070d-9C for submit@debbugs.gnu.org; Tue, 18 Jun 2024 15:54:05 -0400 Received: from mout02.posteo.de ([185.67.36.66]:51471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJeu2-000700-FK for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 15:54:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 77299240106 for <70105@debbugs.gnu.org>; Tue, 18 Jun 2024 21:53:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1718740433; bh=F8wkwOdyn9j29Rs+TVYEPkM57GSz4xaelTQMcWGD6DQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=YTpdTQ4LynflfTj7qP5Bb3UMmGsCKWIUb/kxSLpAhZupzJr9tim70fivXnp37kAug +Bz6bwUVLaoU4ODBYoTWVefJdF1Fnxk9uJix2gpPy3o52pcEH9EDk8PxU6Vc48qWqV 0pymN0XrB+pkl0oCreVo1xkWU3dtDGQUke/cgjcNIDTTY0i5hw8NmfQSYLH2kvLLsK Ai9tkgmQeJjGQgstPMliNfCBNkmsg4vNeL5tlVpmfkGCYD1ibbsD5SE+uV/9g0ehsJ lBzNXP+jV9sMQ4zK1Y3T3Az16AyWMsOjlS8Q0mjm2pTK0WHMkvBqugsiziZF6GiX1/ rKvDKEEWpembA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W3crZ6dQrz9rxM; Tue, 18 Jun 2024 21:53:50 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> <87bk3yai02.fsf@localhost> <87y172ql15.fsf@localhost> Date: Tue, 18 Jun 2024 19:55:31 +0000 Message-ID: <87jzimqb4c.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> (I also considered let-binding `tab-width' when Org parser the file, but >> lists will then look funny visually) > > If you use the `tab-width` set by the user then you have the advantage > that you parse the code in a way that is consistent with what the users > see (so the problem only bites the users who don't look at their code). Indeed, but what if an Org file comes from another user, with different tab-width? Parsing it differently is simply wrong. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 16:07:33 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 20:07:33 +0000 Received: from localhost ([127.0.0.1]:50541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJf77-0007VV-38 for submit@debbugs.gnu.org; Tue, 18 Jun 2024 16:07:33 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJf75-0007VE-Nc for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 16:07:32 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 80B92809AC; Tue, 18 Jun 2024 16:07:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718741242; bh=D62XWf5DjMthgkQOdje1mRDjW5VuNROmzRwUuXAuKig=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Y+5CB66qkP/PLhbdsKywgxyCllqGUZKle1J2QR73R6MD+vMDYq8nUW0YQHRVsRD9C MsxvN+7AO5Um3rdehMfxpHpmnFTa7XiQx1Pa0BkEgqQtV2e6AV5SJfNt0tcrupaRaD nJ0iDpkEbUHyM6NKdyqtuLMgciZ994eDbl4So4X+RK1y/CCu3BB0/EOzIqZx36ZvN+ MNM861cmlXd5lqGvyZnJ11720ehfISN8qqhcFB5YlzttHfyfKwG/QaTDT4lF+7772X VCk2UhMQPQP+X3PkxJ1V6cHGh6fjPNA7XWE7JIwtqbKrrQH4En1llIsEONLpBq/eW9 KjprhFLN/sitw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5538E80882; Tue, 18 Jun 2024 16:07:22 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 422881204EE; Tue, 18 Jun 2024 16:07:22 -0400 (EDT) From: Stefan Monnier To: Ihor Radchenko Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <87jzimqb4c.fsf@localhost> (Ihor Radchenko's message of "Tue, 18 Jun 2024 19:55:31 +0000") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> <87bk3yai02.fsf@localhost> <87y172ql15.fsf@localhost> <87jzimqb4c.fsf@localhost> Date: Tue, 18 Jun 2024 16:07:15 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.067 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >>> (I also considered let-binding `tab-width' when Org parser the file, but >>> lists will then look funny visually) >> If you use the `tab-width` set by the user then you have the advantage >> that you parse the code in a way that is consistent with what the users >> see (so the problem only bites the users who don't look at their code). > Indeed, but what if an Org file comes from another user, with different > tab-width? Parsing it differently is simply wrong. Exactly: there's no way to win in all cases. Which is why I think it's important to see the real cases so we can have a better idea of the origin of the problem and how best to mitigate it. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 19:08:55 2024 Received: (at 70105) by debbugs.gnu.org; 18 Jun 2024 23:08:55 +0000 Received: from localhost ([127.0.0.1]:54907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJhwZ-0004pP-Te for submit@debbugs.gnu.org; Tue, 18 Jun 2024 19:08:54 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJhwV-0004p9-8k for 70105@debbugs.gnu.org; Tue, 18 Jun 2024 19:08:50 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D68F1444505; Tue, 18 Jun 2024 19:08:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718752111; bh=hmKudAKOKIUG2fbjIRmHMAhbH2DUlDUoTHWWOlOoHTI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Sn0wqhfmLcTJFqsYB6QoyPy5eeoJWNzPzuDNz3U50oKyaqQop+92tprADKhWSPa9E +eZCxfJ7MtD0Eh6AOOc2KUinmTwKs/5CPpDNapnKnz7NeRv//eQ/qo08g4qPMRYSLp mFBsMndQbDTkWAMD++tqVNm6WGuALvEJ3z91MG9rKF1hwym+LjFqHMGioJkiw9jJOm pT2N4eU/8imy9YTZCshp/wAsbjv3NEJ3HvC66EeJGad/ndXj3G+cAa/MnmzX7c6TZD gEDb+0Bz+5RRQqT6SjrodYRBkGqMmYn+YvWDUD8ODEAqc9kWqOTxsH29nqQtsKafJ0 Jxa+3FeRqKPQA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 17B66444509; Tue, 18 Jun 2024 19:08:31 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E0FE4120708; Tue, 18 Jun 2024 19:08:30 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Monnier's message of "Tue, 18 Jun 2024 02:01:51 -0400") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Tue, 18 Jun 2024 19:08:30 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.187 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain > I'm still working on the actual metadata of that branch, as well as > etc/NEWS and doc, but in the mean time maybe you could look at the code to > see if you have any objections there. OK, I have a first cut at the doc done. So, here's what I'm proposing, presented as a single diff. Some commit messages still need to be improved (and I just noticed that the files' copyright lines also need to be fixed), but other than that, I think it's about ready. Comments? Objections? Stefan --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=editorconfig.patch Content-Transfer-Encoding: quoted-printable diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 6bf4cbe00df..5287a90bb71 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1550,6 +1550,41 @@ Directory Variables do not visit a file directly but perform work within a directory, such as Dired buffers (@pxref{Dired}). =20 +@node EditorConfig support +@subsubsection Per-Directory Variables via EditorConfig +@cindex EditorConfig support + +The EditorConfig standard is an alternative to the @code{.dir-locals.el} +files, which can control only a very small number of variables, but +has the advantage of being editor-neutral. Those settings are stored in +files named @code{.editorconfig}. + +If you want Emacs to obey those settings, you need to enable +the @code{editorconfig-mode} minor mode. This is usually all that is +needed: when the mode is activated, Emacs will look for @code{.editorconfi= g} +files whenever a file is visited, just as it does for @code{.dir-locals.el= }. + +When both @code{.editorconfig} and @code{.dir-locals.el} files are +encountered, the corresponding settings are combined, and in case there +is overlap, the settings coming from the nearest file take precedence. + +The @code{indent_size} setting of the EditorConfig standard does not +correspond to a fixed variable in Emacs, but instead needs to set +different variables depending on the major mode. Ideally all major +modes should set the corresponding @code{editorconfig-indent-size-vars}, +but if you use a major mode in which @code{indent_size} does not take +effect because the major mode does not yet support it, you can customize +the @code{editorconfig-indentation-alist} variable to tell Emacs which +variables need to be set in that major mode. + +Similarly, there are several different ways to ``trim whitespace'' at +the end of lines. When the EditorConfig @code{trim_trailing_whitespace} +setting is used, by default @code{editorconfig-mode} simply calls +@code{delete-trailing-whitespace} every time you save your file. +If you prefer some other behavior, You can customize +@code{editorconfig-trim-whitespaces-mode} to the minor mode of +your preference, such as @code{ws-butler-mode}. + @node Connection Variables @subsection Per-Connection Local Variables @cindex local variables, for all remote connections diff --git a/etc/NEWS b/etc/NEWS index b2fdbc4a88f..06742d24afe 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1964,6 +1964,14 @@ The following new XML schemas are now supported: * New Modes and Packages in Emacs 30.1 =20 +** New package EditorConfig. +This package provides support for the EditorConfig standard that +is an editor-neutral way to provide directory local settings. +It is enabled via a new global minor mode 'editorconfig-mode' +which makes Emacs obey the '.editorconfig' files. +And the package also comes with a new major mode 'editorconfig-conf-mode' +to edit those configuration files. + +++ ** New package Track-Changes. This library is a layer of abstraction above 'before-change-functions' diff --git a/lisp/editorconfig-conf-mode.el b/lisp/editorconfig-conf-mode.el new file mode 100644 index 00000000000..2b4ddd4410f --- /dev/null +++ b/lisp/editorconfig-conf-mode.el @@ -0,0 +1,95 @@ +;;; editorconfig-conf-mode.el --- Major mode for editing .editorconfig fil= es -*- lexical-binding: t -*- + +;; Copyright (C) 2011-2024 EditorConfig Team + +;; Author: EditorConfig Team + +;; See +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors +;; or the CONTRIBUTORS file for the list of contributors. + +;; This file is part of EditorConfig Emacs Plugin. + +;; EditorConfig Emacs Plugin is free software: you can redistribute it and= /or +;; modify it under the terms of the GNU General Public License as publishe= d by +;; the Free Software Foundation, either version 3 of the License, or (at y= our +;; option) any later version. + +;; EditorConfig Emacs Plugin is distributed in the hope that it will be us= eful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gener= al +;; Public License for more details. + +;; You should have received a copy of the GNU General Public License along= with +;; EditorConfig Emacs Plugin. If not, see . + +;;; Commentary: + +;; Major mode for editing .editorconfig files. + +;;; Code: + +(require 'conf-mode) + +(defvar editorconfig-conf-mode-syntax-table + (let ((table (make-syntax-table conf-unix-mode-syntax-table))) + (modify-syntax-entry ?\; "<" table) + table) + "Syntax table in use in `editorconfig-conf-mode' buffers.") + +(defvar editorconfig-conf-mode-abbrev-table nil + "Abbrev table in use in `editorconfig-conf-mode' buffers.") +(define-abbrev-table 'editorconfig-conf-mode-abbrev-table ()) + +;;;###autoload +(define-derived-mode editorconfig-conf-mode conf-unix-mode "Conf[EditorCon= fig]" + "Major mode for editing .editorconfig files." + (set-variable 'indent-line-function 'indent-relative) + (let ((key-property-list + '("charset" + "end_of_line" + "file_type_emacs" + "file_type_ext" + "indent_size" + "indent_style" + "insert_final_newline" + "max_line_length" + "root" + "tab_width" + "trim_trailing_whitespace")) + (key-value-list + '("unset" + "true" + "false" + "lf" + "cr" + "crlf" + "space" + "tab" + "latin1" + "utf-8" + "utf-8-bom" + "utf-16be" + "utf-16le")) + (font-lock-value + '(("^[ \t]*\\[\\(.+?\\)\\]" 1 font-lock-type-face) + ("^[ \t]*\\(.+?\\)[ \t]*[=3D:]" 1 font-lock-variable-name-face)= ))) + + ;; Highlight all key values + (dolist (key-value key-value-list) + (push `(,(format "[=3D:][ \t]*\\(%s\\)\\([ \t]\\|$\\)" key-value) + 1 font-lock-constant-face) + font-lock-value)) + ;; Highlight all key properties + (dolist (key-property key-property-list) + (push `(,(format "^[ \t]*\\(%s\\)[ \t]*[=3D:]" key-property) + 1 font-lock-builtin-face) + font-lock-value)) + + (conf-mode-initialize "#" font-lock-value))) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.editorconfig\\'" . editorconfig-conf-m= ode)) + +(provide 'editorconfig-conf-mode) +;;; editorconfig-conf-mode.el ends here diff --git a/lisp/editorconfig-core-handle.el b/lisp/editorconfig-core-hand= le.el new file mode 100644 index 00000000000..868d622af94 --- /dev/null +++ b/lisp/editorconfig-core-handle.el @@ -0,0 +1,223 @@ +;;; editorconfig-core-handle.el --- Handle Class for EditorConfig File -*= - lexical-binding: t -*- + +;; Copyright (C) 2011-2024 EditorConfig Team + +;; Author: EditorConfig Team + +;; See +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors +;; or the CONTRIBUTORS file for the list of contributors. + +;; This file is part of EditorConfig Emacs Plugin. + +;; EditorConfig Emacs Plugin is free software: you can redistribute it and= /or +;; modify it under the terms of the GNU General Public License as publishe= d by +;; the Free Software Foundation, either version 3 of the License, or (at y= our +;; option) any later version. + +;; EditorConfig Emacs Plugin is distributed in the hope that it will be us= eful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gener= al +;; Public License for more details. + +;; You should have received a copy of the GNU General Public License along= with +;; EditorConfig Emacs Plugin. If not, see . + +;;; Commentary: + +;; Handle structures for EditorConfig config file. This library is used +;; internally from editorconfig-core.el . + +;;; Code: + +(require 'cl-lib) + +(require 'editorconfig-fnmatch) + +(defvar editorconfig-core-handle--cache-hash + (make-hash-table :test 'equal) + "Hash of EditorConfig filename and its `editorconfig-core-handle' instan= ce.") + +(cl-defstruct editorconfig-core-handle-section + "Structure representing one section in a .editorconfig file. + +Slots: + +`name' + String of section name (glob string). + +`props' + Alist of properties: (KEY . VALUE)." + (name nil) + (props nil)) + +(defun editorconfig-core-handle-section-get-properties (section file) + "Return properties alist when SECTION name match FILE. + +FILE should be a relative file name, relative to the directory where +the `.editorconfig' file which has SECTION lives. +If not match, return nil." + (when (editorconfig-core-handle--fnmatch-p + file (editorconfig-core-handle-section-name section)) + (editorconfig-core-handle-section-props section))) + +(cl-defstruct editorconfig-core-handle + "Structure representing an .editorconfig file. + +Slots: +`top-props' + Alist of top properties like ((\"root\" . \"true\")) + +`sections' + List of `editorconfig-core-handle-section' structure objects. + +`mtime' + Last modified time of .editorconfig file. + +`path' + Absolute path to .editorconfig file." + (top-props nil) + (sections nil) + (mtime nil) + (path nil)) + + +(defun editorconfig-core-handle (conf) + "Return EditorConfig handle for CONF, which should be a file path. + +If CONF does not exist return nil." + (when (file-readable-p conf) + (let ((cached (gethash conf editorconfig-core-handle--cache-hash)) + (mtime (nth 5 (file-attributes conf)))) + (if (and cached + (equal (editorconfig-core-handle-mtime cached) mtime)) + cached + (let ((parsed (editorconfig-core-handle--parse-file conf))) + (puthash conf parsed editorconfig-core-handle--cache-hash)))))) + +(defun editorconfig-core-handle-root-p (handle) + "Return non-nil if HANDLE represent root EditorConfig file. + +If HANDLE is nil return nil." + (when handle + (string-equal "true" + (downcase (or (cdr (assoc "root" + (editorconfig-core-handle-top-= props handle))) + ""))))) + +(defun editorconfig-core-handle-get-properties (handle file) + "Return list of alist of properties from HANDLE for FILE. +The list returned will be ordered by the lines they appear. + +If HANDLE is nil return nil." + (declare (obsolete editorconfig-core-handle-get-properties-hash "0.8.0")) + (when handle + (let* ((dir (file-name-directory (editorconfig-core-handle-path handle= ))) + (file (file-relative-name file dir))) + (cl-loop for section in (editorconfig-core-handle-sections handle) + for props =3D (editorconfig-core-handle-section-get-propert= ies + section file) + when props collect (copy-alist props))))) + + +(defun editorconfig-core-handle-get-properties-hash (handle file) + "Return hash of properties from HANDLE for FILE. + +If HANDLE is nil return nil." + (when handle + (let ((hash (make-hash-table)) + (file (file-relative-name file (editorconfig-core-handle-path + handle)))) + (dolist (section (editorconfig-core-handle-sections handle)) + (cl-loop for (key . value) in (editorconfig-core-handle-section-ge= t-properties section file) + do (puthash (intern key) value hash))) + hash))) + +(defun editorconfig-core-handle--fnmatch-p (name pattern) + "Return non-nil if NAME match PATTERN. +If pattern has slash, pattern should be relative to DIR. + +This function is a fnmatch with a few modification for EditorConfig usage." + (if (string-match-p "/" pattern) + (let ((pattern (replace-regexp-in-string "\\`/" "" pattern))) + (editorconfig-fnmatch-p name pattern)) + (editorconfig-fnmatch-p (file-name-nondirectory name) pattern))) + +(defsubst editorconfig-core-handle--string-trim (str) + "Remove leading and trailing whitespaces from STR." + (replace-regexp-in-string "[[:space:]]+\\'" + "" + (replace-regexp-in-string "\\`[[:space:]]+" + "" + str))) + +(defun editorconfig-core-handle--parse-file (conf) + "Parse EditorConfig file CONF. + +This function returns a `editorconfig-core-handle'. +If CONF is not found return nil." + (when (file-readable-p conf) + (with-temp-buffer + ;; NOTE: Use this instead of insert-file-contents-literally to enable + ;; code conversion + (insert-file-contents conf) + (goto-char (point-min)) + (let ((sections ()) + (top-props nil) + + ;; nil when pattern not appeared yet, "" when pattern is empty= ("[]") + (pattern nil) + ;; Alist of properties for current PATTERN + (props ()) + + ;; Current line num + (current-line-number 1)) + (while (not (eobp)) + (skip-chars-forward " \t\f") + (cond + ((looking-at "\\(?:[#;].*\\)?$") + nil) + + ;; Start of section + ((looking-at "\\[\\(.*\\)\\][ \t]*$") + (let ((newpattern (match-string 1))) + (when pattern + (push (make-editorconfig-core-handle-section + :name pattern + :props (nreverse props)) + sections)) + (setq props nil) + (setq pattern newpattern))) + + ((looking-at "\\([^=3D: \t]+\\)[ \t]*[=3D:][ \t]*\\(.*?\\)[ \t]= *$") + (let ((key (downcase (match-string 1))) + (value (match-string 2))) + (when (and (< (length key) 51) + (< (length value) 256)) + (if pattern + (when (< (length pattern) 4097) ;;FIXME: 4097? + (push `(,key . ,value) + props)) + (push `(,key . ,value) + top-props))))) + + (t (error "Error while reading config file: %s:%d:\n %s\n" + conf current-line-number + (buffer-substring-no-properties (line-beginning-posit= ion) + (line-end-position)))= )) + (setq current-line-number (1+ current-line-number)) + (goto-char (point-min)) + (forward-line (1- current-line-number))) + (when pattern + (push (make-editorconfig-core-handle-section + :name pattern + :props (nreverse props)) + sections)) + (make-editorconfig-core-handle + :top-props (nreverse top-props) + :sections (nreverse sections) + :mtime (nth 5 (file-attributes conf)) + :path conf))))) + +(provide 'editorconfig-core-handle) +;;; editorconfig-core-handle.el ends here diff --git a/lisp/editorconfig-core.el b/lisp/editorconfig-core.el new file mode 100644 index 00000000000..908d5db6f7e --- /dev/null +++ b/lisp/editorconfig-core.el @@ -0,0 +1,156 @@ +;;; editorconfig-core.el --- EditorConfig Core library in Emacs Lisp -*- = lexical-binding: t -*- + +;; Copyright (C) 2011-2024 EditorConfig Team + +;; Author: EditorConfig Team + +;; See +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors +;; or the CONTRIBUTORS file for the list of contributors. + +;; This file is part of EditorConfig Emacs Plugin. + +;; EditorConfig Emacs Plugin is free software: you can redistribute it and= /or +;; modify it under the terms of the GNU General Public License as publishe= d by +;; the Free Software Foundation, either version 3 of the License, or (at y= our +;; option) any later version. + +;; EditorConfig Emacs Plugin is distributed in the hope that it will be us= eful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gener= al +;; Public License for more details. + +;; You should have received a copy of the GNU General Public License along= with +;; EditorConfig Emacs Plugin. If not, see . + +;;; Commentary: + +;; This library is one implementation of EditorConfig Core, which parses +;; .editorconfig files and returns properties for given files. +;; This can be used in place of, for example, editorconfig-core-c. + + +;; Use from EditorConfig Emacs Plugin + +;; Emacs plugin (v0.5 or later) can utilize this implementation. +;; By default, the plugin first search for any EditorConfig executable, +;; and fallback to this library if not found. +;; If you always want to use this library, add following lines to your ini= t.el: + +;; (setq editorconfig-get-properties-function +;; 'editorconfig-core-get-properties-hash) + + +;; Functions + +;; editorconfig-core-get-properties-hash (&optional file confname confvers= ion) + +;; Get EditorConfig properties for FILE. + +;; This function is almost same as `editorconfig-core-get-properties', but +;; returns hash object instead. + +;;; Code: + +(require 'cl-lib) + +(require 'editorconfig-core-handle) + +(eval-when-compile + (require 'subr-x)) + + +(defun editorconfig-core--get-handles (dir confname &optional result) + "Get list of EditorConfig handlers for DIR from CONFNAME. + +In the resulting list, the handle for root config file comes first, and the +nearest comes last. +The list may contains nil when no file was found for directories. +RESULT is used internally and normally should not be used." + (setq dir (expand-file-name dir)) + (let ((handle (editorconfig-core-handle (concat (file-name-as-directory = dir) + confname))) + (parent (file-name-directory (directory-file-name dir)))) + (if (or (string=3D parent dir) + (and handle (editorconfig-core-handle-root-p handle))) + (cl-remove-if-not #'identity (cons handle result)) + (editorconfig-core--get-handles parent + confname + (cons handle result))))) + +(defun editorconfig-core-get-nearest-editorconfig (directory) + "Return path to .editorconfig file that is closest to DIRECTORY." + (when-let* ((handle (car (last + (editorconfig-core--get-handles directory + ".editorconfig"= ))))) + (editorconfig-core-handle-path handle))) + +(defun editorconfig-core--hash-merge (into update) + "Merge two hashes INTO and UPDATE. + +This is a destructive function, hash INTO will be modified. +When the same key exists in both two hashes, values of UPDATE takes preced= ence." + (maphash (lambda (key value) (puthash key value into)) update) + into) + +(defun editorconfig-core-get-properties-hash (&optional file confname conf= version) + "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 re= turns +hash object instead." + (setq file + (expand-file-name (or file + buffer-file-name + (error "FILE is not given and `buffer-file-n= ame' 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 f= ile) + confname)) + (editorconfig-core--hash-merge result + (editorconfig-core-handle-get-propert= ies-hash handle + = file))) + + ;; Downcase known boolean values + ;; FIXME: Why not do that in `editorconfig-core-handle--parse-file'? + (dolist (key '( end_of_line indent_style indent_size insert_final_newl= ine + trim_trailing_whitespace charset)) + (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=3D v-indent-style "tab") + ;; ;; If VERSION < 0.9.0, indent_size should have no defau= lt value + ;; (version<=3D "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=3D 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=3D v-indent-size "tab")) + ;; (puthash 'indent_size v-tab-width result))) + + result)) + +(provide 'editorconfig-core) +;;; editorconfig-core.el ends here diff --git a/lisp/editorconfig-fnmatch.el b/lisp/editorconfig-fnmatch.el new file mode 100644 index 00000000000..74d1795ee75 --- /dev/null +++ b/lisp/editorconfig-fnmatch.el @@ -0,0 +1,292 @@ +;;; editorconfig-fnmatch.el --- Glob pattern matching in Emacs lisp -*- l= exical-binding: t -*- + +;; Copyright (C) 2011-2024 EditorConfig Team + +;; Author: EditorConfig Team + +;; See +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors +;; or the CONTRIBUTORS file for the list of contributors. + +;; This file is part of EditorConfig Emacs Plugin. + +;; EditorConfig Emacs Plugin is free software: you can redistribute it and= /or +;; modify it under the terms of the GNU General Public License as publishe= d by +;; the Free Software Foundation, either version 3 of the License, or (at y= our +;; option) any later version. + +;; EditorConfig Emacs Plugin is distributed in the hope that it will be us= eful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gener= al +;; Public License for more details. + +;; You should have received a copy of the GNU General Public License along= with +;; EditorConfig Emacs Plugin. If not, see . + +;;; Commentary: + +;; editorconfig-fnmatch.el provides a fnmatch implementation with a few +;; extensions. +;; The main usage of this library is glob pattern matching for EditorConfi= g, but +;; it can also act solely. + +;; editorconfig-fnmatch-p (name pattern) + +;; Test whether NAME match PATTERN. + +;; PATTERN should be a shell glob pattern, and some zsh-like wildcard matc= hings +;; can be used: + +;; * Matches any string of characters, except path separators (/) +;; ** Matches any string of characters +;; ? Matches any single character +;; [name] Matches any single character in name +;; [^name] Matches any single character not in name +;; {s1,s2,s3} Matches any of the strings given (separated by commas) +;; {min..max} Matches any number between min and max + + +;; This library is a port from editorconfig-core-py library. +;; https://github.com/editorconfig/editorconfig-core-py/blob/master/editor= config/fnmatch.py + +;;; Code: + +(require 'cl-lib) + +(defvar editorconfig-fnmatch--cache-hashtable + nil + "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 + "\\(^\\|[^\\]\\){" + "Regular expression for left brace ({).") + +(defconst editorconfig-fnmatch--right-brace-regexp + "\\(^\\|[^\\]\\)}" + "Regular expression for right brace (}).") + + +(defconst editorconfig-fnmatch--numeric-range-regexp + "\\([+-]?[0-9]+\\)\\.\\.\\([+-]?[0-9]+\\)" + "Regular expression for numeric range (like {-3..+3}).") + +(defun editorconfig-fnmatch--match-num (regexp string) + "Return how many times REGEXP is found in STRING." + (let ((num 0)) + ;; START arg does not work as expected in this case + (while (string-match regexp string) + (setq num (1+ num) + string (substring string (match-end 0)))) + num)) + +(defun editorconfig-fnmatch-p (string pattern) + "Test whether STRING match PATTERN. + +Matching ignores case if `case-fold-search' is non-nil. + +PATTERN should be a shell glob pattern, and some zsh-like wildcard matchin= gs can +be used: + +* Matches any string of characters, except path separators (/) +** Matches any string of characters +? Matches any single character +[name] Matches any single character in name +[^name] Matches any single character not in name +{s1,s2,s3} Matches any of the strings given (separated by commas) +{min..max} Matches any number between min and max" + (string-match (editorconfig-fnmatch-translate pattern) + string)) + +;;(editorconfig-fnmatch-translate "{a,{-3..3}}.js") +;;(editorconfig-fnmatch-p "1.js" "{a,{-3..3}}.js") + +(defun editorconfig-fnmatch-translate (pattern) + "Translate a shell PATTERN to a regular expression. + +Translation result will be cached, so same translation will not be done tw= ice." + (let ((cached (gethash pattern + editorconfig-fnmatch--cache-hashtable))) + (or cached + (puthash pattern + (editorconfig-fnmatch--do-translate pattern) + editorconfig-fnmatch--cache-hashtable)))) + + +(defun editorconfig-fnmatch--do-translate (pattern &optional nested) + "Translate a shell PATTERN to a regular expression. + +Set NESTED to t when this function is called from itself. + +This function is called from `editorconfig-fnmatch-translate', when no cac= hed +translation is found for PATTERN." + (let ((index 0) + (length (length pattern)) + (brace-level 0) + (in-brackets nil) + ;; List of strings of resulting regexp, in reverse order. + (result ()) + (is-escaped nil) + (matching-braces (=3D (editorconfig-fnmatch--match-num + editorconfig-fnmatch--left-brace-regexp + pattern) + (editorconfig-fnmatch--match-num + editorconfig-fnmatch--right-brace-regexp + pattern))) + + current-char + pos + has-slash + has-comma + num-range) + + (while (< index length) + (if (and (not is-escaped) + (string-match "[^]\\*?[{},/\\-]+" + ;;(string-match "[^]\\*?[{},/\\-]+" "?.a") + pattern + index) + (eq index (match-beginning 0))) + (progn + (push (regexp-quote (match-string 0 pattern)) result) + (setq index (match-end 0) + is-escaped nil)) + + (setq current-char (aref pattern index) + index (1+ index)) + + (cl-case current-char + (?* + (setq pos index) + (if (and (< pos length) + (=3D (aref pattern pos) ?*)) + (push ".*" result) + (push "[^/]*" result))) + + (?? + (push "[^/]" result)) + + (?\[ + (if in-brackets + (push "\\[" result) + (if (=3D (aref pattern index) ?/) + ;; Slash after an half-open bracket + (progn + (push "\\[/" result) + (setq index (+ index 1))) + (setq pos index + has-slash nil) + (while (and (< pos length) + (not (=3D (aref pattern pos) ?\])) + (not has-slash)) + (if (and (=3D (aref pattern pos) ?/) + (not (=3D (aref pattern (- pos 1)) ?\\))) + (setq has-slash t) + (setq pos (1+ pos)))) + (if has-slash + (progn + (push (concat "\\[" + (substring pattern + index + (1+ pos)) + "\\]") + result) + (setq index (+ pos 2))) + (if (and (< index length) + (memq (aref pattern index) + '(?! ?^))) + (progn + (setq index (1+ index)) + (push "[^" result)) + (push "[" result)) + (setq in-brackets t))))) + + (?- + (if in-brackets + (push "-" result) + (push "\\-" result))) + + (?\] + (push "]" result) + (setq in-brackets nil)) + + (?{ + (setq pos index + has-comma nil) + (while (and (or (and (< pos length) + (not (=3D (aref pattern pos) ?}))) + is-escaped) + (not has-comma)) + (if (and (eq (aref pattern pos) ?,) + (not is-escaped)) + (setq has-comma t) + (setq is-escaped (and (eq (aref pattern pos) + ?\\) + (not is-escaped)) + pos (1+ pos)))) + (if (and (not has-comma) + (< pos length)) + (let ((pattern-sub (substring pattern index pos))) + (setq num-range (string-match editorconfig-fnmatch--numer= ic-range-regexp + pattern-sub)) + (if num-range + (let ((number-start (string-to-number (match-string 1 + p= attern-sub))) + (number-end (string-to-number (match-string 2 + pat= tern-sub)))) + (push (concat "\\(?:" + (mapconcat #'number-to-string + (cl-loop for i from number= -start to number-end + collect i) + "\\|") + "\\)") + result)) + (let ((inner (editorconfig-fnmatch--do-translate patter= n-sub t))) + (push (format "{%s}" inner) result))) + (setq index (1+ pos))) + (if matching-braces + (progn + (push "\\(?:" result) + (setq brace-level (1+ brace-level))) + (push "{" result)))) + + (?, + (if (and (> brace-level 0) + (not is-escaped)) + (push "\\|" result) + (push "\\," result))) + + (?} + (if (and (> brace-level 0) + (not is-escaped)) + (progn + (push "\\)" result) + (setq brace-level (- brace-level 1))) + (push "}" result))) + + (?/ + (if (and (<=3D (+ index 3) (length pattern)) + (string=3D (substring pattern index (+ index 3)) "**/"= )) + (progn + (push "\\(?:/\\|/.*/\\)" result) + (setq index (+ index 3))) + (push "/" result))) + + (t + (unless (=3D current-char ?\\) + (push (regexp-quote (char-to-string current-char)) result)))) + + (if (=3D current-char ?\\) + (progn (when is-escaped + (push "\\\\" result)) + (setq is-escaped (not is-escaped))) + (setq is-escaped nil)))) + (unless nested + (setq result `("\\'" ,@result "\\`"))) + (apply #'concat (reverse result)))) + +(provide 'editorconfig-fnmatch) +;;; editorconfig-fnmatch.el ends here diff --git a/lisp/editorconfig-tools.el b/lisp/editorconfig-tools.el new file mode 100644 index 00000000000..4738a6c4d94 --- /dev/null +++ b/lisp/editorconfig-tools.el @@ -0,0 +1,119 @@ +;;; editorconfig-tools.el --- Editorconfig tools -*- lexical-binding: t = -*- + +;; Copyright (C) 2011-2024 EditorConfig Team + +;; Author: EditorConfig Team + +;; See +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors +;; or the CONTRIBUTORS file for the list of contributors. + +;; This file is part of EditorConfig Emacs Plugin. + +;; EditorConfig Emacs Plugin is free software: you can redistribute it and= /or +;; modify it under the terms of the GNU General Public License as publishe= d by +;; the Free Software Foundation, either version 3 of the License, or (at y= our +;; option) any later version. + +;; EditorConfig Emacs Plugin is distributed in the hope that it will be us= eful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gener= al +;; Public License for more details. + +;; You should have received a copy of the GNU General Public License along= with +;; EditorConfig Emacs Plugin. If not, see . + +;;; Commentary: + +;; Some utility commands for users, not used from editorconfig-mode. + +;;; Code: + +(require 'cl-lib) + +(eval-when-compile + (require 'subr-x)) + + +(require 'editorconfig) + +;;;###autoload +(defun editorconfig-apply () + "Get and apply EditorConfig properties to current buffer. + +This function does not respect the values of `editorconfig-exclude-modes' = and +`editorconfig-exclude-regexps' and always applies available properties. +Use `editorconfig-mode-apply' instead to make use of these variables." + (interactive) + (when buffer-file-name + (condition-case err + (progn + (let ((props (editorconfig-call-get-properties-function buffer-f= ile-name))) + (condition-case err + (run-hook-with-args 'editorconfig-hack-properties-function= s props) + (error + (display-warning '(editorconfig editorconfig-hack-propertie= s-functions) + (format "Error while running editorconfig-= hack-properties-functions, abort running hook: %S" + err) + :warning))) + (setq editorconfig-properties-hash props) + (editorconfig-set-local-variables props) + (editorconfig-set-coding-system-revert + (gethash 'end_of_line props) + (gethash 'charset props)) + (condition-case err + (run-hook-with-args 'editorconfig-after-apply-functions pr= ops) + (error + (display-warning '(editorconfig editorconfig-after-apply-fu= nctions) + (format "Error while running editorconfig-= after-apply-functions, abort running hook: %S" + err) + :warning))))) + (error + (display-warning '(editorconfig editorconfig-apply) + (format "Error in editorconfig-apply, styles will = not be applied: %S" err) + :error))))) + +(defun editorconfig-mode-apply () + "Get and apply EditorConfig properties to current buffer. + +This function does nothing when the major mode is listed in +`editorconfig-exclude-modes', or variable `buffer-file-name' matches +any of regexps in `editorconfig-exclude-regexps'." + (interactive) + (when (and major-mode buffer-file-name) + (editorconfig-apply))) + + +;;;###autoload +(defun editorconfig-find-current-editorconfig () + "Find the closest .editorconfig file for current file." + (interactive) + (eval-and-compile (require 'editorconfig-core)) + (when-let* ((file (editorconfig-core-get-nearest-editorconfig + default-directory))) + (find-file file))) + +;;;###autoload +(defun editorconfig-display-current-properties () + "Display EditorConfig properties extracted for current buffer." + (interactive) + (if editorconfig-properties-hash + (let ((buf (get-buffer-create "*EditorConfig Properties*")) + (file buffer-file-name) + (props editorconfig-properties-hash)) + (with-current-buffer buf + (erase-buffer) + (insert (format "# EditorConfig for %s\n" file)) + (maphash (lambda (k v) + (insert (format "%S =3D %s\n" k v))) + props)) + (display-buffer buf)) + (message "Properties are not applied to current buffer yet.") + nil)) +;;;###autoload +(defalias 'describe-editorconfig-properties + #'editorconfig-display-current-properties) + + +(provide 'editorconfig-tools) +;;; editorconfig-tools.el ends here diff --git a/lisp/editorconfig.el b/lisp/editorconfig.el new file mode 100644 index 00000000000..a7e34434258 --- /dev/null +++ b/lisp/editorconfig.el @@ -0,0 +1,711 @@ +;;; editorconfig.el --- EditorConfig Plugin -*- lexical-binding: t -*- + +;; Copyright (C) 2011-2024 EditorConfig Team + +;; Author: EditorConfig Team +;; Version: 0.11.0 +;; URL: https://github.com/editorconfig/editorconfig-emacs#readme +;; Package-Requires: ((emacs "26.1")) +;; Keywords: convenience editorconfig + +;; See +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors +;; or the CONTRIBUTORS file for the list of contributors. + +;; This file is part of EditorConfig Emacs Plugin. + +;; EditorConfig Emacs Plugin is free software: you can redistribute it and= /or +;; modify it under the terms of the GNU General Public License as publishe= d by +;; the Free Software Foundation, either version 3 of the License, or (at y= our +;; option) any later version. + +;; EditorConfig Emacs Plugin is distributed in the hope that it will be us= eful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gener= al +;; Public License for more details. + +;; You should have received a copy of the GNU General Public License along= with +;; EditorConfig Emacs Plugin. If not, see . + +;;; Commentary: + +;; EditorConfig helps developers define and maintain consistent +;; coding styles between different editors and IDEs. + +;; The EditorConfig project consists of a file format for defining +;; coding styles and a collection of text editor plugins that enable +;; editors to read the file format and adhere to defined styles. +;; EditorConfig files are easily readable and they work nicely with +;; version control systems. + +;;; News: + +;; - In `editorconfig-indentation-alist', if a mode is associated to a fun= ction +;; that function should not set the vars but should instead *return* the= m. +;; - New var `editorconfig-indent-size-vars' for major modes to set. +;; - New hook `editorconfig-get-local-variables-functions' to support +;; additional settings. + +;;; Code: + +(require 'cl-lib) + +(eval-when-compile (require 'subr-x)) + +(require 'editorconfig-core) + +(defgroup editorconfig nil + "EditorConfig Emacs Plugin. + +EditorConfig helps developers define and maintain consistent +coding styles between different editors and IDEs." + :tag "EditorConfig" + :prefix "editorconfig-" + :group 'tools) + +(when (< emacs-major-version 30) + (define-obsolete-variable-alias + 'edconf-custom-hooks + 'editorconfig-after-apply-functions + "0.5") + (define-obsolete-variable-alias + 'editorconfig-custom-hooks + 'editorconfig-after-apply-functions + "0.7.14") + (defcustom editorconfig-after-apply-functions () + "A list of functions after loading common EditorConfig settings. + +Each element in this list is a hook function. This hook function +takes one parameter, which is a property hash table. The value +of properties can be obtained through gethash function. + +The hook does not have to be coding style related; you can add +whatever functionality you want. For example, the following is +an example to add a new property emacs_linum to decide whether to +show line numbers on the left: + + (add-hook \\=3D'editorconfig-after-apply-functions + \\=3D'(lambda (props) + (let ((show-line-num (gethash \\=3D'emacs_linum props))) + (cond ((equal show-line-num \"true\") (linum-mode 1)) + ((equal show-line-num \"false\") (linum-mode 0)))))) + +This hook will be run even when there are no matching sections in +\".editorconfig\", or no \".editorconfig\" file was found at all." + :type 'hook)) + +(when (< emacs-major-version 30) + (defcustom editorconfig-hack-properties-functions () + "A list of function to alter property values before applying them. + +These functions will be run after loading \".editorconfig\" files and befo= re +applying them to current buffer, so that you can alter some properties from +\".editorconfig\" before they take effect. +\(Since 2021/08/30 (v0.9.0): Buffer coding-systems are set before running +this functions, so this variable cannot be used to change coding-systems.) + +For example, Makefiles always use tab characters for indentation: you can +overwrite \"indent_style\" property when current `major-mode' is a +`makefile-mode' with following code: + + (add-hook \\=3D'editorconfig-hack-properties-functions + \\=3D'(lambda (props) + (when (derived-mode-p \\=3D'makefile-mode) + (puthash \\=3D'indent_style \"tab\" props)))) + +This hook will be run even when there are no matching sections in +\".editorconfig\", or no \".editorconfig\" file was found at all." + :type 'hook)) +(make-obsolete-variable 'editorconfig-hack-properties-functions + 'editorconfig-get-local-variables-functions + "2024") + +(define-obsolete-variable-alias + 'edconf-indentation-alist + 'editorconfig-indentation-alist + "0.5") +(defcustom editorconfig-indentation-alist + ;; For contributors: Sort modes in alphabetical order + `((apache-mode apache-indent-level) + (bash-ts-mode sh-basic-offset + sh-indentation) + (bpftrace-mode c-basic-offset) + (c++-ts-mode c-basic-offset + c-ts-mode-indent-offset) + (c-ts-mode c-basic-offset + c-ts-mode-indent-offset) + (cmake-mode cmake-tab-width) + (cmake-ts-mode cmake-tab-width + cmake-ts-mode-indent-offset) + (csharp-mode c-basic-offset) + (csharp-ts-mode c-basic-offset + csharp-ts-mode-indent-offset) + (emacs-lisp-mode . editorconfig--get-indentation-lisp-mode) + (ess-mode ess-indent-offset) + (feature-mode feature-indent-offset + feature-indent-level) + (gdscript-mode gdscript-indent-offset) + (go-ts-mode go-ts-mode-indent-offset) + (hcl-mode hcl-indent-level) + (html-ts-mode html-ts-mode-indent-offset) + (java-ts-mode c-basic-offset + java-ts-mode-indent-offset) + (js-mode js-indent-level) + (jsonian-mode jsonian-default-indentation) + (latex-mode . editorconfig--get-indentation-latex-mode) + (lisp-mode . editorconfig--get-indentation-lisp-mode) + (matlab-mode matlab-indent-level) + (octave-mode octave-block-offset) + ;; No need to change `php-mode-coding-style' value for php-mode + ;; since we run editorconfig later than it resets `c-basic-offset'. + ;; See https://github.com/editorconfig/editorconfig-emacs/issues/116 + ;; for details. + (php-mode c-basic-offset) + (php-ts-mode php-ts-mode-indent-offset) + (ps-mode ps-mode-tab) + (ruby-mode ruby-indent-level) + (rust-ts-mode rust-indent-offset + rust-ts-mode-indent-offset) + (scss-mode css-indent-offset) + (sgml-mode sgml-basic-offset) + (sh-mode sh-indentation) + (svelte-mode svelte-basic-offset) + (tcl-mode tcl-indent-level + tcl-continued-indent-level) + (toml-ts-mode toml-ts-mode-indent-offset) + (verilog-mode verilog-indent-level + verilog-indent-level-behavioral + verilog-indent-level-declaration + verilog-indent-level-module + verilog-cexp-indent + verilog-case-indent) + (web-mode . editorconfig--get-indentation-web-mode) + (zig-mode zig-indent-offset) + ) + "Alist of indentation setting methods by modes. + +This is a fallback used for those modes which don't set +`editorconfig-indent-size-vars'. + +Each element should look like (MODE . SETTING) where SETTING +should obey the same rules as `editorconfig-indent-size-vars'." + :type '(alist :key-type symbol + :value-type (choice function (repeat symbol))) + :risky t) + +(defcustom editorconfig-trim-whitespaces-mode nil + "Buffer local minor-mode to use to trim trailing whitespaces. + +If set, enable that mode when `trim_trailing_whitespace` is set to true. +Otherwise, use `delete-trailing-whitespace'." + :type 'symbol) + +(defvar editorconfig-properties-hash nil + "Hash object of EditorConfig properties that was enabled for current buf= fer. +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_size for Lisp files. +Prevents `lisp-indent-offset' from being set selectively. + +nil - `lisp-indent-offset' is always set normally. +t - `lisp-indent-offset' is never set normally + (always use default indent for lisps). +number - `lisp-indent-offset' is not set only if indent_size is + equal to this number. For example, if this is set to 2, + `lisp-indent-offset' will not be set only if indent_size is 2.") + +(define-error 'editorconfig-error + "Error thrown from editorconfig lib") + +(defun editorconfig-error (&rest args) + "Signal an `editorconfig-error'. +Make a message by passing ARGS to `format-message'." + (signal 'editorconfig-error (list (apply #'format-message args)))) + +(defun editorconfig-string-integer-p (string) + "Return non-nil if STRING represents integer." + (and (stringp string) + (string-match-p "\\`[0-9]+\\'" string))) + +(defun editorconfig--get-indentation-web-mode (size) + `((web-mode-indent-style . 2) + (web-mode-markup-indent-offset . ,size) + (web-mode-css-indent-offset . ,size) + (web-mode-code-indent-offset . ,size))) + +(defun editorconfig--get-indentation-latex-mode (size) + "Vars to set `latex-mode' indent size to SIZE." + `((tex-indent-basic . ,size) + (tex-indent-item . ,size) + (tex-indent-arg . ,(* 2 size)) + ;; For AUCTeX + (TeX-brace-indent-level . ,size) + (LaTeX-indent-level . ,size) + (LaTeX-item-indent . ,(- size)))) + +(defun editorconfig--get-indentation-lisp-mode (size) + "Set indent size to SIZE for Lisp mode(s)." + (when (cond ((null editorconfig-lisp-use-default-indent) t) + ((eql t editorconfig-lisp-use-default-indent) nil) + ((numberp editorconfig-lisp-use-default-indent) + (not (eql size editorconfig-lisp-use-default-indent))) + (t t)) + `((lisp-indent-offset . ,size)))) + +(cl-defun editorconfig--should-set (symbol) + "Determine if editorconfig should set SYMBOL." + (display-warning '(editorconfig editorconfig--should-set) + (format "symbol: %S" + symbol) + :debug) + (when (assq symbol file-local-variables-alist) + (cl-return-from editorconfig--should-set + nil)) + + (when (assq symbol dir-local-variables-alist) + (cl-return-from editorconfig--should-set + nil)) + + t) + +(defvar editorconfig-indent-size-vars + #'editorconfig--default-indent-size-function + "Rule to use to set a given `indent_size'. +Can take the form of a function, in which case we call it with a single SI= ZE +argument (an integer) and it should return a list of (VAR . VAL) pairs. +Otherwise it can be a list of symbols (those which should be set to SIZE). +Major modes are expected to set this buffer-locally.") + +(defun editorconfig--default-indent-size-function (size) + (let ((parents (if (fboundp 'derived-mode-all-parents) ;Emacs-30 + (derived-mode-all-parents major-mode) + (let ((modes nil) + (mode major-mode)) + (while mode + (push mode modes) + (setq mode (get mode 'derived-mode--parent))) + (nreverse modes)))) + entry) + (let ((parents parents)) + (while (and parents (not entry)) + (setq entry (assq (pop parents) editorconfig-indentation-alist)))) + (or + (when entry + (let ((rule (cdr entry))) + ;; Filter out settings of unknown vars. + (delq nil + (mapcar (lambda (elem) + (let ((v (car elem))) + (cond + ((not (symbolp v)) + (message "Unsupported element in `editorconfi= g-indentation-alist': %S" elem)) + ((or (eq 'eval v) (boundp v)) elem)))) + (if (functionp rule) + (funcall rule size) + (mapcar (lambda (elem) `(,elem . ,size)) rule))))= )) + ;; Fallback, let's try and guess. + (let ((suffixes '("-indent-level" "-basic-offset" "-indent-offset" + "-block-offset")) + (guess ())) + (while (and parents (not guess)) + (let* ((mode (pop parents)) + (modename (symbol-name mode)) + (name (substring modename 0 + (string-match "-mode\\'" modename)))) + (dolist (suffix suffixes) + (let ((sym (intern-soft (concat name suffix)))) + (when (and sym (boundp sym)) + (setq guess sym)))))) + (when guess `((,guess . ,size)))) + (and (local-variable-p 'smie-rules-function) + `((smie-indent-basic . ,size)))))) + +(defun editorconfig--get-indentation (props) + "Get indentation vars according to STYLE, SIZE, and TAB_WIDTH." + (let ((style (gethash 'indent_style props)) + (size (gethash 'indent_size props)) + (tab_width (gethash 'tab_width props))) + (when tab_width + (setq tab_width (string-to-number tab_width))) + + (setq size + (cond ((editorconfig-string-integer-p size) + (string-to-number size)) + ((equal size "tab") + (or tab_width tab-width)) + (t + nil))) + `(,@(if tab_width `((tab-width . ,tab_width))) + + ,@(pcase style + ("space" `((indent-tabs-mode . nil))) + ("tab" `((indent-tabs-mode . t)))) + + ,@(when (and size (featurep 'evil)) + `((evil-shift-width . ,size))) + + ,@(cond + ((null size) nil) + ((functionp editorconfig-indent-size-vars) + (funcall editorconfig-indent-size-vars size)) + (t (mapcar (lambda (v) `(,v . ,size)) editorconfig-indent-size-va= rs)))))) + +(defvar-local editorconfig--apply-coding-system-currently nil + "Used internally.") +(put 'editorconfig--apply-coding-system-currently + 'permanent-local + t) + +(defun editorconfig-merge-coding-systems (end-of-line charset) + "Return merged coding system symbol of END-OF-LINE and CHARSET." + (let ((eol (cond + ((equal end-of-line "lf") 'undecided-unix) + ((equal end-of-line "cr") 'undecided-mac) + ((equal end-of-line "crlf") 'undecided-dos))) + (cs (cond + ((equal charset "latin1") 'iso-latin-1) + ((equal charset "utf-8") 'utf-8) + ((equal charset "utf-8-bom") 'utf-8-with-signature) + ((equal charset "utf-16be") 'utf-16be-with-signature) + ((equal charset "utf-16le") 'utf-16le-with-signature)))) + (if (and eol cs) + (merge-coding-systems cs eol) + (or eol cs)))) + +(cl-defun editorconfig-set-coding-system-revert (end-of-line charset) + "Set buffer coding system by END-OF-LINE and CHARSET. + +This function will revert buffer when the coding-system has been changed." + ;; `editorconfig--advice-find-file-noselect' does not use this function + (let ((coding-system (editorconfig-merge-coding-systems end-of-line + charset))) + (display-warning '(editorconfig editorconfig-set-coding-system-revert) + (format "editorconfig-set-coding-system-revert: buffe= r-file-name: %S | buffer-file-coding-system: %S | coding-system: %S | apply= -currently: %S" + buffer-file-name + buffer-file-coding-system + coding-system + editorconfig--apply-coding-system-currently) + :debug) + (when (memq coding-system '(nil undecided)) + (cl-return-from editorconfig-set-coding-system-revert)) + (when (and buffer-file-coding-system + (memq buffer-file-coding-system + (coding-system-aliases (merge-coding-systems coding-s= ystem + buffer-f= ile-coding-system)))) + (cl-return-from editorconfig-set-coding-system-revert)) + (unless (file-readable-p buffer-file-name) + (set-buffer-file-coding-system coding-system) + (cl-return-from editorconfig-set-coding-system-revert)) + (unless (memq coding-system + (coding-system-aliases editorconfig--apply-coding-system= -currently)) + ;; Revert functions might call `editorconfig-apply' again + ;; FIXME: I suspect `editorconfig--apply-coding-system-currently' + ;; gymnastics is not needed now that we hook into `find-auto-coding'. + (unwind-protect + (progn + (setq editorconfig--apply-coding-system-currently coding-syste= m) + ;; Revert without query if buffer is not modified + (let ((revert-without-query '("."))) + (revert-buffer-with-coding-system coding-system))) + (setq editorconfig--apply-coding-system-currently nil))))) + +(defun editorconfig--get-trailing-nl (props) + "Get the vars to require final newline according to PROPS." + (pcase (gethash 'insert_final_newline props) + ("true" + ;; Keep prefs around how/when the nl is added, if set. + `((require-final-newline + . ,(or require-final-newline mode-require-final-newline t)))) + ("false" + `((require-final-newline . nil))))) + +(defun editorconfig--delete-trailing-whitespace () + "Call `delete-trailing-whitespace' unless the buffer is read-only." + (unless buffer-read-only (delete-trailing-whitespace))) + +;; Arrange for our (eval . (add-hook ...)) "local var" to be considered sa= fe. +(defun editorconfig--add-hook-safe-p (exp) + (equal exp '(add-hook 'before-save-hook + #'editorconfig--delete-trailing-whitespace nil t))) +(let ((predicates (get 'add-hook 'safe-local-eval-function))) + (when (functionp predicates) + (setq predicates (list predicates))) + (unless (memq #'editorconfig--add-hook-safe-p predicates) + (put 'add-hook 'safe-local-eval-function #'editorconfig--add-hook-safe= -p))) + +(defun editorconfig--get-trailing-ws (props) + "Get vars to trim of trailing whitespace according to PROPS." + (pcase (gethash 'trim_trailing_whitespace props) + ("true" + `((eval + . ,(if editorconfig-trim-whitespaces-mode + `(,editorconfig-trim-whitespaces-mode 1) + '(add-hook 'before-save-hook + #'editorconfig--delete-trailing-whitespace nil t))= ))) + ("false" + ;; Just do it right away rather than return a (VAR . VAL), which + ;; would be probably more trouble than it's worth. + (when editorconfig-trim-whitespaces-mode + (funcall editorconfig-trim-whitespaces-mode 0)) + (remove-hook 'before-save-hook + #'editorconfig--delete-trailing-whitespace t) + nil))) + +(defun editorconfig--get-line-length (props) + "Get the max line length (`fill-column') to PROPS." + (let ((length (gethash 'max_line_length props))) + (when (and (editorconfig-string-integer-p length) + (> (string-to-number length) 0)) + `((fill-column . ,(string-to-number length)))))) + +(defun editorconfig-call-get-properties-function (filename) + "Call `editorconfig-core-get-properties-hash' with FILENAME and return r= esult. + +This function also removes `unset' properties and calls +`editorconfig-hack-properties-functions'." + (if (stringp filename) + (setq filename (expand-file-name filename)) + (editorconfig-error "Invalid argument: %S" filename)) + (let ((props nil)) + (condition-case err + (setq props (editorconfig-core-get-properties-hash filename)) + (error + (editorconfig-error "Error from editorconfig-core-get-properties-ha= sh: %S" + err))) + (cl-loop for k being the hash-keys of props using (hash-values v) + when (equal v "unset") do (remhash k props)) + props)) + +(defvar editorconfig-get-local-variables-functions + '(editorconfig--get-indentation + editorconfig--get-trailing-nl + editorconfig--get-trailing-ws + editorconfig--get-line-length) + "Special hook run to convert EditorConfig settings to their Emacs equiva= lent. +Every function is called with one argument, a hash-table indexed by +EditorConfig settings represented as symbols and whose corresponding value +is represented as a string. It should return a list of (VAR . VAL) settin= gs +where VAR is an ELisp variable and VAL is the value to which it should be = set.") + +(defun editorconfig--get-local-variables (props) + "Get variables settings according to EditorConfig PROPS." + (let ((alist ())) + (run-hook-wrapped 'editorconfig-get-local-variables-functions + (lambda (fun props) + (setq alist (append (funcall fun props) alist)) + nil) + props) + alist)) + +(defun editorconfig-set-local-variables (props) + "Set buffer variables according to EditorConfig PROPS." + (pcase-dolist (`(,var . ,val) (editorconfig--get-local-variables props)) + (if (eq 'eval var) + (eval val t) + (when (editorconfig--should-set var) + (set (make-local-variable var) val))))) + +(defun editorconfig-major-mode-hook () + "Function to run when `major-mode' has been changed. + +This functions does not reload .editorconfig file, just sets local variabl= es +again. Changing major mode can reset these variables. + +This function also executes `editorconfig-after-apply-functions' functions= ." + (display-warning '(editorconfig editorconfig-major-mode-hook) + (format "editorconfig-major-mode-hook: editorconfig-mod= e: %S, major-mode: %S, -properties-hash: %S" + (and (boundp 'editorconfig-mode) + editorconfig-mode) + major-mode + editorconfig-properties-hash) + :debug) + (when (and (bound-and-true-p editorconfig-mode) + editorconfig-properties-hash) + (editorconfig-set-local-variables editorconfig-properties-hash) + (condition-case err + (run-hook-with-args 'editorconfig-after-apply-functions editorconf= ig-properties-hash) + (error + (display-warning '(editorconfig editorconfig-major-mode-hook) + (format "Error while running `editorconfig-after-a= pply-functions': %S" + err)))))) + +(defun editorconfig--advice-find-auto-coding (filename &rest _args) + "Consult `charset' setting of EditorConfig." + (let ((cs (dlet ((auto-coding-file-name filename)) + (editorconfig--get-coding-system)))) + (when cs (cons cs 'EditorConfig)))) + +(defun editorconfig--advice-find-file-noselect (f filename &rest args) + "Get EditorConfig properties and apply them to buffer to be visited. + +This function should be added as an advice function to `find-file-noselect= '. +F is that function, and FILENAME and ARGS are arguments passed to F." + (let ((props nil) + (ret nil)) + (condition-case err + (when (stringp filename) + (setq props (editorconfig-call-get-properties-function filename)= )) + (error + (display-warning '(editorconfig editorconfig--advice-find-file-nose= lect) + (format "Failed to get properties, styles will not= be applied: %S" + err) + :warning))) + + (setq ret (apply f filename args)) + + (condition-case err + (with-current-buffer ret + (when props + + ;; NOTE: hack-properties-functions cannot affect coding-system= value, + ;; because it has to be set before initializing buffers. + (condition-case err + (run-hook-with-args 'editorconfig-hack-properties-function= s props) + (error + (display-warning '(editorconfig editorconfig-hack-propertie= s-functions) + (format "Error while running editorconfig-= hack-properties-functions, abort running hook: %S" + err) + :warning))) + (setq editorconfig-properties-hash props) + ;; When initializing buffer, `editorconfig-major-mode-hook' + ;; will be called before setting `editorconfig-properties-hash= ', so + ;; execute this explicitly here. + (editorconfig-set-local-variables props) + + (condition-case err + (run-hook-with-args 'editorconfig-after-apply-functions pr= ops) + (error + (display-warning '(editorconfig editorconfig--advice-find-f= ile-noselect) + (format "Error while running `editorconfig= -after-apply-functions': %S" + err)))))) + (error + (display-warning '(editorconfig editorconfig--advice-find-file-nose= lect) + (format "Error while setting variables from Editor= Config: %S" err)))) + ret)) + +(defvar editorconfig--getting-coding-system nil) + +(defun editorconfig--get-coding-system (&optional _size) + "Return the coding system to use according to EditorConfig. +Meant to be used on `auto-coding-functions'." + (defvar auto-coding-file-name) ;; Emacs=E2=89=A530 + (when (and (stringp auto-coding-file-name) + (file-name-absolute-p auto-coding-file-name) + ;; Don't recurse infinitely. + (not (member auto-coding-file-name + editorconfig--getting-coding-system))) + (let* ((editorconfig--getting-coding-system + (cons auto-coding-file-name editorconfig--getting-coding-syste= m)) + (props (editorconfig-call-get-properties-function + auto-coding-file-name))) + (editorconfig-merge-coding-systems (gethash 'end_of_line props) + (gethash 'charset props))))) + +(defun editorconfig--get-dir-local-variables () + "Return the directory local variables specified via EditorConfig. +Meant to be used on `hack-dir-local-get-variables-functions'." + (when (stringp buffer-file-name) + (let* ((props (editorconfig-call-get-properties-function buffer-file-n= ame)) + (alist (editorconfig--get-local-variables props))) + ;; FIXME: Actually, we should loop over the "editorconfig-core-handl= es" + ;; since each one comes from a different directory. + (when alist + (cons + ;; FIXME: This should be the dir where we found the + ;; `.editorconfig' file. + (file-name-directory buffer-file-name) + alist))))) + +;;;###autoload +(define-minor-mode editorconfig-mode + "Toggle EditorConfig feature." + :global t + (if (boundp 'hack-dir-local-get-variables-functions) ;Emacs=E2=89=A530 + (if editorconfig-mode + (progn + (add-hook 'hack-dir-local-get-variables-functions + ;; Give them slightly lower precedence than settings= from + ;; `dir-locals.el'. + #'editorconfig--get-dir-local-variables t) + ;; `auto-coding-functions' also exists in Emacs<30 but without + ;; access to the file's name via `auto-coding-file-name'. + (add-hook 'auto-coding-functions + #'editorconfig--get-coding-system)) + (remove-hook 'hack-dir-local-get-variables-functions + #'editorconfig--get-dir-local-variables) + (remove-hook 'auto-coding-functions + #'editorconfig--get-coding-system)) + ;; Emacs<30 + (let ((modehooks '(prog-mode-hook + text-mode-hook + ;; Some modes call `kill-all-local-variables' in th= eir init + ;; code, which clears some values set by editorconf= ig. + ;; For those modes, editorconfig-apply need to be c= alled + ;; explicitly through their hooks. + rpm-spec-mode-hook))) + (if editorconfig-mode + (progn + (advice-add 'find-file-noselect :around #'editorconfig--advice= -find-file-noselect) + (advice-add 'find-auto-coding :after-until + #'editorconfig--advice-find-auto-coding) + (dolist (hook modehooks) + (add-hook hook + #'editorconfig-major-mode-hook + t))) + (advice-remove 'find-file-noselect #'editorconfig--advice-find-fil= e-noselect) + (advice-remove 'find-auto-coding + #'editorconfig--advice-find-auto-coding) + (dolist (hook modehooks) + (remove-hook hook #'editorconfig-major-mode-hook)))))) + + +;; (defconst editorconfig--version +;; (eval-when-compile +;; (require 'lisp-mnt) +;; (declare-function lm-version "lisp-mnt" nil) +;; (lm-version)) +;; "EditorConfig version.") + +;;;###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-full + (if (fboundp 'package-get-version) + (package-get-version) + (let* ((version + (with-temp-buffer + (require 'find-func) + (declare-function find-library-name "find-func" (libr= ary)) + (insert-file-contents (find-library-name "editorconfi= g")) + (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=3D 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 + +;; Local Variables: +;; sentence-end-double-space: t +;; End: --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 01:49:49 2024 Received: (at submit) by debbugs.gnu.org; 19 Jun 2024 05:49:49 +0000 Received: from localhost ([127.0.0.1]:33939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJoCb-0000Kc-9Y for submit@debbugs.gnu.org; Wed, 19 Jun 2024 01:49:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:40004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJoCZ-0000KV-Gb for submit@debbugs.gnu.org; Wed, 19 Jun 2024 01:49:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJoCV-0005Cg-R8 for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 01:49:43 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJoCT-0001UN-At for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 01:49:43 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1sJoCQ-0006Wd-5t for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 07:49:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Rudolf Schlatte Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box Date: Wed, 19 Jun 2024 07:48:47 +0200 Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:1Nw4TSveiRqCYI+CJ3ILflDSlao= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: >> I'm still working on the actual metadata of that branch, as well as >> etc/NEWS and doc, but in the mean time maybe you could look at the code to >> see if you have any objections there. > > OK, I have a first cut at the doc done. > So, here's what I'm proposing, presented as a single diff. > Some commit messages still need to be improved (and I just noticed that > the files' copyright lines also need to be fixed), but other than that, > I think it's about ready. > > Comments? Objections? > > > Stefan > > diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi > index 6bf4cbe00df..5287a90bb71 100644 > --- a/doc/emacs/custom.texi > +++ b/doc/emacs/custom.texi > @@ -1550,6 +1550,41 @@ Directory Variables > do not visit a file directly but perform work within a directory, such > as Dired buffers (@pxref{Dired}). > > +@node EditorConfig support > +@subsubsection Per-Directory Variables via EditorConfig > +@cindex EditorConfig support > + > +The EditorConfig standard is an alternative to the @code{.dir-locals.el} > +files, which can control only a very small number of variables, but > +has the advantage of being editor-neutral. Those settings are stored in > +files named @code{.editorconfig}. > + > +If you want Emacs to obey those settings, you need to enable > +the @code{editorconfig-mode} minor mode. This is usually all that is > +needed: when the mode is activated, Emacs will look for @code{.editorconfig} > +files whenever a file is visited, just as it does for @code{.dir-locals.el}. > + > +When both @code{.editorconfig} and @code{.dir-locals.el} files are > +encountered, the corresponding settings are combined, and in case there > +is overlap, the settings coming from the nearest file take precedence. What happens with both .dir-locals.el and .editorconfig present in the current directory? What would be the "nearest file" in that case? (I'd expect .dir-locals.el to override .editorconfig in that case, but there are of course other possibilities.) From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 02:02:29 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 06:02:29 +0000 Received: from localhost ([127.0.0.1]:34119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJoOq-0000gy-UH for submit@debbugs.gnu.org; Wed, 19 Jun 2024 02:02:29 -0400 Received: from mail-ed1-f42.google.com ([209.85.208.42]:55592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJoOo-0000gj-BQ for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 02:02:27 -0400 Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-57cce3bc8c6so4791073a12.3 for <70105@debbugs.gnu.org>; Tue, 18 Jun 2024 23:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718776877; x=1719381677; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=cBphvp7VBow9UDJfPTkVBw6dI16oG8xoHJ6JKB2MVK4=; b=VWUTBZV7l4jVqPk9YeG4dCWOfXH+VZuEWGdnybzN7xFJrLn9QZdpREc03NCX2bBgH9 ufquOBw02k6HYYudZ5cuoQY1idm8IPPO6kOx7yXEPTG7f92uYmqXCLoKY5yBSXju+cNv jUcfK3ODIGjv2F1iGzxiTaBTIkoLggsBwyJOUgsLAJ/40zbz4XcS6J40OJzVB2p5fiFl zR1wtJZSAWFLa9btl4n67HyzAVaJM7AyqAZxm3t4cmOk2LLf665uamgo9SfB91VAqn7m D3xkmelwLAaHUtmXnlVJgcBuy112fpK7Z6sjzyn3eErHyL1wxC6pe/Cg1VFwjkUEgapM dHSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718776877; x=1719381677; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cBphvp7VBow9UDJfPTkVBw6dI16oG8xoHJ6JKB2MVK4=; b=RQoYd/9GvZFuTF6TRHPfvaBNt9Rt6o7XyhpFg4V2XzTMasOq6oBwer0z3tTueQ1clD GbNdAahyjPX6Rs8SzwmRtt27lRy5T0Nz0JteZJgtwGxtljXvov+TiNfXNz9uwBzT8EBq 8CNbhGN01QwMYJnXphGSP4b2/8NZC785rQaz5SLw1SknSJyzLh6a7L2o9R4RDcCRqv84 yL1tho9M2j59VWljJ4wOapyyRBhyjgaQskqyUVwihTXk7WEeCo5suzsq/h76zj+EpNr1 WvHA7fO5OSL6/Y3dgJLQzD/DRlujbHMoVFY4jm7sTsXZEUP1RhmX9cN+jaH4bapHzc+T JETA== X-Forwarded-Encrypted: i=1; AJvYcCWseRKsecxgZvKcW8AOXtOeXaujiKIOmjf381WAxwIjd6jhp5uPO1A9AazgZ6zM56Ba31k0f95DxgkCAkmdF4vuWB0WdQA= X-Gm-Message-State: AOJu0YwVj9tuJ5patjUbUKRYaOJyAIf3q/tZ+SCSzUn3RNM5E61+D4Dn bMsSbs6iK0rv1JoYQHH1bRxVb4+tR2yCmsb6AVx7/CiNOGuoekjWuoIIoBq2hpGeBn9XOaKpbZ5 ACGhShari9pS++/U7YJlmr1vVBZA= X-Google-Smtp-Source: AGHT+IEqbKcCwX1Pm2nNUgMYUiI6bDNpLKA132Lsw0t/jwpBOkI/VAIId7KDxrabSeHxtgexUd+Ovanl9DMfW8SMWV8= X-Received: by 2002:a50:d707:0:b0:57c:5fca:ab25 with SMTP id 4fb4d7f45d1cf-57d07e84bf2mr724934a12.25.1718776876913; Tue, 18 Jun 2024 23:01:16 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 19 Jun 2024 06:01:16 +0000 From: Stefan Kangas In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> MIME-Version: 1.0 Date: Wed, 19 Jun 2024 06:01:16 +0000 Message-ID: Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box To: Stefan Monnier , Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > OK, I have a first cut at the doc done. > So, here's what I'm proposing, presented as a single diff. > Some commit messages still need to be improved (and I just noticed that > the files' copyright lines also need to be fixed), but other than that, > I think it's about ready. > > Comments? Objections? Thanks, LGTM. I have some comments and questions below. > diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi > index 6bf4cbe00df..5287a90bb71 100644 > --- a/doc/emacs/custom.texi > +++ b/doc/emacs/custom.texi > @@ -1550,6 +1550,41 @@ Directory Variables > do not visit a file directly but perform work within a directory, such > as Dired buffers (@pxref{Dired}). > > +@node EditorConfig support > +@subsubsection Per-Directory Variables via EditorConfig > +@cindex EditorConfig support > + > +The EditorConfig standard is an alternative to the @code{.dir-locals.el} > +files, which can control only a very small number of variables, but > +has the advantage of being editor-neutral. Those settings are stored in > +files named @code{.editorconfig}. > +If you want Emacs to obey those settings, you need to enable > +the @code{editorconfig-mode} minor mode. This is usually all that is > +needed: when the mode is activated, Emacs will look for @code{.editorcon= fig} > +files whenever a file is visited, just as it does for @code{.dir-locals.= el}. Is it ever dangerous to load settings from these files or is it always safe? Should that be documented somewhere, e.g.: In contrast to @code{.dir-locals.el}, it is always considered safe to load settings from @code{.editorconfig} files. (See @xref{...}) > +When both @code{.editorconfig} and @code{.dir-locals.el} files are > +encountered, the corresponding settings are combined, and in case there ^^^^^^^^^^^ a simpler word might suffice: "found" > +is overlap, the settings coming from the nearest file take precedence. I don't think I understand this: - Does "overlap" mean "conflict"? - What does "nearest" mean; which one is preferred? > +The @code{indent_size} setting of the EditorConfig standard does not > +correspond to a fixed variable in Emacs, but instead needs to set > +different variables depending on the major mode. Ideally all major > +modes should set the corresponding @code{editorconfig-indent-size-vars}, > +but if you use a major mode in which @code{indent_size} does not take > +effect because the major mode does not yet support it, you can customize > +the @code{editorconfig-indentation-alist} variable to tell Emacs which > +variables need to be set in that major mode. Does this suggest that our in-tree major modes should set that variable, IOW that we should spread the knowledge to those modes? That should also help encourage major mode authors elsewhere to do the same. Should this be documented also in (info "(elisp) Major Mode Conventions")? > +Similarly, there are several different ways to ``trim whitespace'' at ^^ ^^ > +the end of lines. When the EditorConfig @code{trim_trailing_whitespace} > +setting is used, by default @code{editorconfig-mode} simply calls > +@code{delete-trailing-whitespace} every time you save your file. > +If you prefer some other behavior, You can customize ^^^ lowercase > +@code{editorconfig-trim-whitespaces-mode} to the minor mode of > +your preference, such as @code{ws-butler-mode}. Why square quotes around "trim whitespace"? I think they can be removed. > @node Connection Variables > @subsection Per-Connection Local Variables > @cindex local variables, for all remote connections > diff --git a/etc/NEWS b/etc/NEWS > index b2fdbc4a88f..06742d24afe 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1964,6 +1964,14 @@ The following new XML schemas are now supported: > =0C > * New Modes and Packages in Emacs 30.1 > > +** New package EditorConfig. > +This package provides support for the EditorConfig standard that > +is an editor-neutral way to provide directory local settings. Suggested: This package provides support for the EditorConfig standard, an editor-neutral way to provide directory local (project) settings. > +It is enabled via a new global minor mode 'editorconfig-mode' > +which makes Emacs obey the '.editorconfig' files. > +And the package also comes with a new major mode 'editorconfig-conf-mode= ' ^^^ > +to edit those configuration files. Suggest replacing "And the package also comes with a new major mode" with "There is also a new major mode". > new file mode 100644 > index 00000000000..2b4ddd4410f > --- /dev/null > +++ b/lisp/editorconfig-conf-mode.el > @@ -0,0 +1,95 @@ > +;;; editorconfig-conf-mode.el --- Major mode for editing .editorconfig f= iles -*- lexical-binding: t -*- > + > +;; Copyright (C) 2011-2024 EditorConfig Team > + > +;; Author: EditorConfig Team > + > +;; See > +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributor= s > +;; or the CONTRIBUTORS file for the list of contributors. ^^^^^^^^^^^^^^^^^^^^^ Suggested: "the CONTRIBUTORS file in the linked git repository" > +(defsubst editorconfig-core-handle--string-trim (str) > + "Remove leading and trailing whitespaces from STR." > + (replace-regexp-in-string "[[:space:]]+\\'" > + "" > + (replace-regexp-in-string "\\`[[:space:]]+" > + "" > + str))) Could this be replaced by string-trim? Also, is this defsubst unused? > +(defun editorconfig-core-handle--parse-file (conf) > + "Parse EditorConfig file CONF. > + > +This function returns a `editorconfig-core-handle'. > +If CONF is not found return nil." > + (when (file-readable-p conf) > + (with-temp-buffer > + ;; NOTE: Use this instead of insert-file-contents-literally to ena= ble > + ;; code conversion > + (insert-file-contents conf) > + (goto-char (point-min)) > + (let ((sections ()) > + (top-props nil) > + > + ;; nil when pattern not appeared yet, "" when pattern is emp= ty ("[]") > + (pattern nil) > + ;; Alist of properties for current PATTERN > + (props ()) > + > + ;; Current line num > + (current-line-number 1)) > + (while (not (eobp)) > + (skip-chars-forward " \t\f") > + (cond > + ((looking-at "\\(?:[#;].*\\)?$") > + nil) > + > + ;; Start of section > + ((looking-at "\\[\\(.*\\)\\][ \t]*$") > + (let ((newpattern (match-string 1))) > + (when pattern > + (push (make-editorconfig-core-handle-section > + :name pattern > + :props (nreverse props)) > + sections)) > + (setq props nil) > + (setq pattern newpattern))) > + > + ((looking-at "\\([^=3D: \t]+\\)[ \t]*[=3D:][ \t]*\\(.*?\\)[ \= t]*$") > + (let ((key (downcase (match-string 1))) > + (value (match-string 2))) > + (when (and (< (length key) 51) > + (< (length value) 256)) > + (if pattern > + (when (< (length pattern) 4097) ;;FIXME: 4097? > + (push `(,key . ,value) > + props)) > + (push `(,key . ,value) > + top-props))))) > + > + (t (error "Error while reading config file: %s:%d:\n %s\n" > + conf current-line-number > + (buffer-substring-no-properties (line-beginning-pos= ition) > + (line-end-position)= )))) > + (setq current-line-number (1+ current-line-number)) > + (goto-char (point-min)) > + (forward-line (1- current-line-number))) > + (when pattern > + (push (make-editorconfig-core-handle-section > + :name pattern > + :props (nreverse props)) > + sections)) > + (make-editorconfig-core-handle > + :top-props (nreverse top-props) > + :sections (nreverse sections) > + :mtime (nth 5 (file-attributes conf)) > + :path conf))))) > + > +(provide 'editorconfig-core-handle) > +;;; editorconfig-core-handle.el ends here > diff --git a/lisp/editorconfig-core.el b/lisp/editorconfig-core.el > new file mode 100644 > index 00000000000..908d5db6f7e > --- /dev/null > +++ b/lisp/editorconfig-core.el > @@ -0,0 +1,156 @@ > +;;; editorconfig-core.el --- EditorConfig Core library in Emacs Lisp -*= - lexical-binding: t -*- Suggest scratching "in Emacs Lisp" as redundant > +(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-full > + (if (fboundp 'package-get-version) > + (package-get-version) > + (let* ((version > + (with-temp-buffer > + (require 'find-func) > + (declare-function find-library-name "find-func" (li= brary)) > + (insert-file-contents (find-library-name "editorcon= fig")) > + (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=3D version pkg-version))) > + (concat version "-" pkg-version) > + version))))) > + (when show-version > + (message "EditorConfig Emacs v%s" version-full)) > + version-full)) Can this function be removed and/or obsoleted? I would like us to discourage such functions in favor of using standard functions (e.g. `M-x list-packages' or `C-h p') to find out what version of a package is installed. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 04:19:07 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 08:19:07 +0000 Received: from localhost ([127.0.0.1]:36645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJqX5-0004pi-A6 for submit@debbugs.gnu.org; Wed, 19 Jun 2024 04:19:07 -0400 Received: from mout.gmx.net ([212.227.15.19]:40631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJqX1-0004p1-Vv for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 04:19:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1718785128; x=1719389928; i=michael.albinus@gmx.de; bh=aPpdqzkrjDXIL9y77RRwXUOcMz4huGfwVxY/CAJ/IYo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=dGJnosO9vufZ43sroMkFxJy6kPYh5OhAPBz0Zum8EceSYfks0YnlUE21mMk2FRiM MDkxTF+WlPr3DUZ8373BgBH/k3bELkb2K5u3TkJzbrGWFkPnAPYwbxZYqn9NpV5gz 1WIqxgjoTXY95Y3b3dWsynZ2rYqX2o3AsUjNsft5HXnboSDy8z/fzr0P2mq/aiWBQ 2x2A2jd84JtvEETn2rPZ0LOmrZ2SDFz+4x+ng6rw974K+pexozZEcUKwst2Opcapo erH66NvRRe2w/S48d+b8yz1Omm0gCgKSIJtHzkhHXgyg8RXfxwbi/pnOen2OTVcHk cLR9DZI4lgknAPZ+PQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M8hZD-1sFhnd2cld-006Xf8; Wed, 19 Jun 2024 10:18:48 +0200 From: Michael Albinus To: Stefan Kangas Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Kangas's message of "Wed, 19 Jun 2024 06:01:16 +0000") References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Wed, 19 Jun 2024 10:18:44 +0200 Message-ID: <87jzilgxaz.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:8xQmtAWj9sNk3Ez3F33WCDEpoXQtBH91ahxLOh1snPFzkDVTMGa 3id8ABFXvuV9AYIP0XN02y+4XPMnF2rpe8uStPHJRBPx5HrLlZ09rBJV24cLSkU8zAxKqC6 rsm7PFwjKNzMTpRNYk78hqh9h8HnitavauaL0iJCQnIvNj9ASM77zJ9mZ/Ykmreopqn+tCO nZS4pfasIstPejRrHA4xQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:wcG1Hn0758Y=;UQALcZMXxsDxxN+8M4F3Nf4On2Q L3VgrOOirtKTWsPZ8iMDxqxAqOgExXAkIKAZZGhxnIJYMKz2dIknv+DcUUdV3iNiKOR+A34NZ 5iO54oHzoN0MeBnFHqBAQYivB/tUkIvIBOglg2VO6yQ+J9A9kN+XUXgGcHESBQbALCdUIhnQk xvipGtH7210HSdec7YmNSCngcfp41PWdy2BBoM/poqcN2Z4BukZys/4hZfmk19S2lNtgZo+WU iHSrkct/11xn0QZ5jqrK8fxTY+inC3aNIa3XSNIgxvDB7sXsbV39Q5VFlITd+FAnCAaLsS8zO 4QjgPRrwATyoG7x9yCxtdUoY9sCyxplNvzgq/78e/9cRsKsWaMHaSp4yk5iCDx2xWxPhaCnEj VlHAouE3fsHdHJvjpDlxGstZ1sT470NZSJmk8IlOaCB0mx86sI8TZSWAmcG0xGh1OR1r0ts+b oJEBSUK57NNMnU1hsFpPzykAMRYh466y2YNBoSFlr8CQjhmVDyR84MSu45FOZJt6ICtJl+iiL jgUfh9BZKwQ5SBLi395gXAccSeGa1xc0mjTJdyja/3J7gsyrKS7rlz59hEb21Ko80TdCvWXKT TytSeJ/IlmBl+XgrujJDhPWFZODaop7rrnj7ZYfXjAuFzWerVFQbSvL62udzpunCAm3E0oTyM je2ihoRkRbJOfPGgiky/dfmfa5ApDQNzlTOcO6jh1oDeKRDAGzJhyzWTYYJu109oX+cg5xYi3 jqUj4L8JMbSpgV4TIizgXfSWHNCSPD6BSuyJ3tmu7STu1GnqV68uGrScALT8FvvmLmk6BORJL lpMXUsiWM+yhF9bjTuilCqk8ueKwfxCB8XUSEBz38cRLI= X-Spam-Score: 2.8 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Stefan Kangas writes: > In contrast to @code{.dir-locals.el}, it is always considered safe > to load settings from @code{.editorconfig} files. (See @xref{...}) Minor nit: it should be @file{.editorconfig} and @file{.dir-locals.el}, respectively. Content analysis details: (2.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.38.155 listed in zen.spamhaus.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.19 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.19 listed in list.dnswl.org] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, 8slashes+git@gmail.com, 70105@debbugs.gnu.org, bjorn.bidar@thaodan.de, Stefan Monnier , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Stefan Kangas writes: > In contrast to @code{.dir-locals.el}, it is always considered safe > to load settings from @code{.editorconfig} files. (See @xref{...}) Minor nit: it should be @file{.editorconfig} and @file{.dir-locals.el}, respectively. Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.89.38.155 listed in zen.spamhaus.org] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.19 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.19 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (michael.albinus[at]gmx.de) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Stefan Kangas writes: > In contrast to @code{.dir-locals.el}, it is always considered safe > to load settings from @code{.editorconfig} files. (See @xref{...}) Minor nit: it should be @file{.editorconfig} and @file{.dir-locals.el}, respectively. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 11:18:38 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 15:18:38 +0000 Received: from localhost ([127.0.0.1]:48099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJx53-0004TI-QX for submit@debbugs.gnu.org; Wed, 19 Jun 2024 11:18:38 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJx51-0004Sv-9X for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 11:18:36 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A55D1100061; Wed, 19 Jun 2024 11:18:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718810305; bh=M3RflPFpOtlMT/goE0B4NwPzVNy/nGkeHEE4DYL/J2w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iJz8ri1myiDTjjDOvcaMaoOAXoLBatwNcd45cRPJv6EokfMaK3OBJw6EFwWeangTJ I9fc9xxVU93lf0nqT9s7Sv6uNxaANZr8ItGUUsqzY4Od/lE36Sa8Xu6YUPDf+LHKZC RPnYxirSqVvAwMq4Aq5w0JIkAcBjdAZe0ASWovTFVD6/b2RxjY+g0OFNXhKbgEiUIi OjqTCUeyHIJgoWTr7kPHFL+rPk1iTo1vBiKMyQ43SES73AjNIHWCTWacP3ci8rS0bk BM+oZneM9xS+gr5GwOQZOMHxzFYa2phWNX7RIoUzyh+5uitD+/+6h7I7gHNfu9VcOB 7RmYWwveoaeOA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2846110002E; Wed, 19 Jun 2024 11:18:25 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 13E4512059E; Wed, 19 Jun 2024 11:18:25 -0400 (EDT) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Kangas's message of "Wed, 19 Jun 2024 06:01:16 +0000") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Wed, 19 Jun 2024 11:18:24 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.122 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> +If you want Emacs to obey those settings, you need to enable >> +the @code{editorconfig-mode} minor mode. This is usually all that is >> +needed: when the mode is activated, Emacs will look for @code{.editorconfig} >> +files whenever a file is visited, just as it does for @code{.dir-locals.el}. > > Is it ever dangerous to load settings from these files or is it always > safe? Should that be documented somewhere, e.g.: > > In contrast to @code{.dir-locals.el}, it is always considered safe > to load settings from @code{.editorconfig} files. (See @xref{...}) They're passed through the same checks, i.e. editorconfig.el translates them to their ELisp equivalent and then we check the result as if it came from a `dir-locals.el` file. Usually, the editorconfig.el code makes sure those tests pass without prompting the user, tho. >> +When both @code{.editorconfig} and @code{.dir-locals.el} files are >> +encountered, the corresponding settings are combined, and in case there > ^^^^^^^^^^^ a simpler word might suffice: "found" >> +is overlap, the settings coming from the nearest file take precedence. > > I don't think I understand this: > - Does "overlap" mean "conflict"? Your question suggests "conflict" is more clear, so I'll use that, thanks. > - What does "nearest" mean; which one is preferred? The settings come from a `.editorconfig` or `.dir-locals.el` file and apply to some other file. "nearest" here is the distance between the file where the settings were found and where they apply. E.g. a setting from `/foo/bar/baz/.editorconfig` should take priority over a setting from `/foo/bar/.dir-locals.el` because it's closer to `/foo/bar/baz/mydir/myfile.agda`. Not sure you state it more clearly (short of writing out a long explanation like I've just done, which doesn't seem warranted). >> +The @code{indent_size} setting of the EditorConfig standard does not >> +correspond to a fixed variable in Emacs, but instead needs to set >> +different variables depending on the major mode. Ideally all major >> +modes should set the corresponding @code{editorconfig-indent-size-vars}, >> +but if you use a major mode in which @code{indent_size} does not take >> +effect because the major mode does not yet support it, you can customize >> +the @code{editorconfig-indentation-alist} variable to tell Emacs which >> +variables need to be set in that major mode. > Does this suggest that our in-tree major modes should set that variable, > IOW that we should spread the knowledge to those modes? Yup. > Should this be documented also in (info "(elisp) Major Mode Conventions")? I have a pending bug-report for a discussion about that. Basically, I think `editorconfig-indent-size-vars` is a crutch because the need is not specific to EditorConfig: we should harmonize the way the "basic indentation step size" is set in the various major modes. Users shouldn't need to guess which variable does that for each and every mode. Instead we should have one convention for where that customization is done which applies uniformly to all modes. But I'm not completely sure what the convention should be. E.g. maybe they should all obey the same `indent-basic-offset` var (which would thus be set buffer-locally when you want to affect a single mode), or maybe they should all use a var whose name can be easily computed from the major mode's name, ... So, until we decide what the convention should be, I'd refrain from adding anything about it to that Texinfo node. >> +Similarly, there are several different ways to ``trim whitespace'' at > ^^ ^^ >> +the end of lines. When the EditorConfig @code{trim_trailing_whitespace} >> +setting is used, by default @code{editorconfig-mode} simply calls >> +@code{delete-trailing-whitespace} every time you save your file. >> +If you prefer some other behavior, You can customize > ^^^ lowercase >> +@code{editorconfig-trim-whitespaces-mode} to the minor mode of >> +your preference, such as @code{ws-butler-mode}. > > Why square quotes around "trim whitespace"? I think they can be > removed. Fair enough. >> @node Connection Variables >> @subsection Per-Connection Local Variables >> @cindex local variables, for all remote connections >> diff --git a/etc/NEWS b/etc/NEWS >> index b2fdbc4a88f..06742d24afe 100644 >> --- a/etc/NEWS >> +++ b/etc/NEWS >> @@ -1964,6 +1964,14 @@ The following new XML schemas are now supported: >> >> * New Modes and Packages in Emacs 30.1 >> >> +** New package EditorConfig. >> +This package provides support for the EditorConfig standard that >> +is an editor-neutral way to provide directory local settings. > > Suggested: > > This package provides support for the EditorConfig standard, an > editor-neutral way to provide directory local (project) settings. Thanks. >> +It is enabled via a new global minor mode 'editorconfig-mode' >> +which makes Emacs obey the '.editorconfig' files. >> +And the package also comes with a new major mode 'editorconfig-conf-mode' > ^^^ >> +to edit those configuration files. > > Suggest replacing "And the package also comes with a new major mode" > with "There is also a new major mode". OK. >> new file mode 100644 >> index 00000000000..2b4ddd4410f >> --- /dev/null >> +++ b/lisp/editorconfig-conf-mode.el >> @@ -0,0 +1,95 @@ >> +;;; editorconfig-conf-mode.el --- Major mode for editing .editorconfig >> files -*- lexical-binding: t -*- >> + >> +;; Copyright (C) 2011-2024 EditorConfig Team >> + >> +;; Author: EditorConfig Team >> + >> +;; See >> +;; https://github.com/editorconfig/editorconfig-emacs/graphs/contributors >> +;; or the CONTRIBUTORS file for the list of contributors. > ^^^^^^^^^^^^^^^^^^^^^ > > Suggested: > > "the CONTRIBUTORS file in the linked git repository" Hmm... good catch. >> +(defsubst editorconfig-core-handle--string-trim (str) >> + "Remove leading and trailing whitespaces from STR." >> + (replace-regexp-in-string "[[:space:]]+\\'" >> + "" >> + (replace-regexp-in-string "\\`[[:space:]]+" >> + "" >> + str))) > > Could this be replaced by string-trim? I never know *exactly* what is trimmed, and when I do it's usually not *quite* the same so I usually assume that the answer is "probably, but it would take more time to figure out than it's worth". > Also, is this defsubst unused? Oh, indeed, I removed all references to it, so it can be deleted, yay! >> +(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-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)) > > Can this function be removed and/or obsoleted? I would like us to > discourage such functions in favor of using standard functions > (e.g. `M-x list-packages' or `C-h p') to find out what version of a > package is installed. OK, I'll remove it (I fully agree with your goal). But the upstream maintainers may like it enough that when I later harmonize the code between Emacs and upstream that function ends up coming back :-( Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 11:18:49 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 15:18:49 +0000 Received: from localhost ([127.0.0.1]:48105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJx5F-0004Ts-IR for submit@debbugs.gnu.org; Wed, 19 Jun 2024 11:18:49 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:32247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJx5E-0004TX-1L for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 11:18:48 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 668508079A; Wed, 19 Jun 2024 11:18:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718810318; bh=mlWv2FEY9Ax2wCa5WDnr0he0sJCnx2MfUoujvgcqvgM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ivxRQDwsK59jRa2gqEa0WzfJ6ejPO+To3g56cxv/yA4mNFY/yztfo9CPGIdXlUZxZ CA5tPe8MnwLa3SfYcpkspEgABRBTdT3vSFwO/Q8SMED9CFt2/2oHAG9v443p5x15iz iCKTOwvzvz95a7RUW/xbLvMwygUeACIHRCU+o2xT/rnXkHhaTOEW7/QWyM6uMs7Gje vgmfyZ3NbJ5KHZ9g5HWG71LVAzLNv54vUNMEOvScXWjQ766jglwfrCaJYbIZEsJD8p +aCh6R/a6WRAmuYKY9Ok06xvmhDuPs+a1GP8n/kSIjP6ddRzBS+zLNr4UCsK4ODPTm EcS4W3Vvl+ChA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 38ED080136; Wed, 19 Jun 2024 11:18:38 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2725B12045A; Wed, 19 Jun 2024 11:18:38 -0400 (EDT) From: Stefan Monnier To: Michael Albinus Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <87jzilgxaz.fsf@gmx.de> (Michael Albinus's message of "Wed, 19 Jun 2024 10:18:44 +0200") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> <87jzilgxaz.fsf@gmx.de> Date: Wed, 19 Jun 2024 11:18:37 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.118 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, 8slashes+git@gmail.com, 70105@debbugs.gnu.org, bjorn.bidar@thaodan.de, Stefan Kangas , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> In contrast to @code{.dir-locals.el}, it is always considered safe >> to load settings from @code{.editorconfig} files. (See @xref{...}) > > Minor nit: it should be @file{.editorconfig} and @file{.dir-locals.el}, > respectively. Thanks! Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 11:50:59 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 15:50:59 +0000 Received: from localhost ([127.0.0.1]:49222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJxaM-0005dn-Pr for submit@debbugs.gnu.org; Wed, 19 Jun 2024 11:50:59 -0400 Received: from mout02.posteo.de ([185.67.36.66]:47445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJxaK-0005dV-0a for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 11:50:57 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6B74D240104 for <70105@debbugs.gnu.org>; Wed, 19 Jun 2024 17:50:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1718812246; bh=8W6fZZOkeZ4xW3Dtq1brmEvRVhXm9whENNyp4Kegt1M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=b0SVCUXvs/sU/Ug0/sGlsU4hs+8jupiecwCRkTuePBHmfFAgXQd9xjxvvJhwKZ0IA dwGBouUUrbSvp0nZDgLXAxNLX0CcRCF2cKFnqO4R0BEm2RFdUi8UilgstgUQwwRG5r 7XROZaSo0ulXXiwufjVRb1N5rIKi+73EcckypPvwL/jul+A9aFaEQtIq4vgZZTS23H WbDKZV9sqIN9MbewqiopJRXKJwPU7itZ+srCX2UE8t7ldMw+glcaUYwivkhg37/LZT lu5pI0hAgbfinGT7A2ojya6NYRSla/4gpCCz+nVA3I/Azw+tAXHnjer9x4IOt3SdRn 4BUphcTdre4Sw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W47Pd3cSjz6tvZ; Wed, 19 Jun 2024 17:50:45 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Wed, 19 Jun 2024 15:52:29 +0000 Message-ID: <878qz19bgi.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > +The @code{indent_size} setting of the EditorConfig standard does not > +correspond to a fixed variable in Emacs, but instead needs to set > +different variables depending on the major mode. Ideally all major > +modes should set the corresponding @code{editorconfig-indent-size-vars}, > +but if you use a major mode in which @code{indent_size} does not take > +effect because the major mode does not yet support it, you can customize > +the @code{editorconfig-indentation-alist} variable to tell Emacs which > +variables need to be set in that major mode. Reading this as a major mode maintainer, I have not the slightest clue about EditorConfig standard. So, I have no idea what indent_size is all about and what I am supposed to do with it. Maybe you can explain in more details what indent_size does and how it should reflect on the indentation settings. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 11:57:59 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 15:57:59 +0000 Received: from localhost ([127.0.0.1]:49507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJxh8-0005tq-LZ for submit@debbugs.gnu.org; Wed, 19 Jun 2024 11:57:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJxh7-0005tU-9b for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 11:57:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJxgx-0003CF-3a; Wed, 19 Jun 2024 11:57:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Vs/wXPq9dAJS2K0tEmN9e6g1AQgDxwsV3RFo59qnBZQ=; b=qdDHfPbvGNGS 352JbNfWQYrz6nejti144SEhW+3JVcyuJ11I5/NcE/erw7WmRA2k1IK2d+1NmRow5lNDtYv77BzqH M8HrqVySHw4SJCkquz0uV0ITZ08vCGTKdzObXA2Dsa8a/MEeL3uR4EdHbwaK9TrzcACemURaB1qun 2FbE4yzSeKuuryYyyu2YjKP8J75lFFJBG9DX76/RucnsscGfPcZV1HNeDL3a2x3TiFLU0YjcOZzWP Qh77J1q7+nrlEYQD8UGZdJy5DIuIuiyOyUYsvm+IoGgoQj4WzZNOp/FXErsP/pzurLGAkGt+Xm9d0 Rbw5ZuWBD9qa5MwuEIUihw==; Date: Wed, 19 Jun 2024 18:57:43 +0300 Message-Id: <861q4torgo.fsf@gnu.org> From: Eli Zaretskii To: Ihor Radchenko In-Reply-To: <878qz19bgi.fsf@localhost> (message from Ihor Radchenko on Wed, 19 Jun 2024 15:52:29 +0000) Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> <878qz19bgi.fsf@localhost> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, 8slashes+git@gmail.com, 70105@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ihor Radchenko > Cc: Eli Zaretskii , jcs090218@gmail.com, > bjorn.bidar@thaodan.de, 8slashes+git@gmail.com, 70105@debbugs.gnu.org > Date: Wed, 19 Jun 2024 15:52:29 +0000 > > Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" writes: > > > +The @code{indent_size} setting of the EditorConfig standard does not > > +correspond to a fixed variable in Emacs, but instead needs to set > > +different variables depending on the major mode. Ideally all major > > +modes should set the corresponding @code{editorconfig-indent-size-vars}, > > +but if you use a major mode in which @code{indent_size} does not take > > +effect because the major mode does not yet support it, you can customize > > +the @code{editorconfig-indentation-alist} variable to tell Emacs which > > +variables need to be set in that major mode. > > Reading this as a major mode maintainer, I have not the slightest clue > about EditorConfig standard. So, I have no idea what indent_size is all > about and what I am supposed to do with it. This is from the Emacs user manual, not from the ELisp reference manual. So the intended audience is users, and in particular those who have .editorconfig files and thus already know about indent_size. Guidance and recommendations for mode developers are of course also needed, but they will go into the other manual, and (AFIU) we don't yet fully know what to write there, because this is still a moving target. When we figure that out, it would be good to document the conventions and recommended practices. But we are not there yet. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 12:54:08 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 16:54:09 +0000 Received: from localhost ([127.0.0.1]:51250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJyZU-0007mb-DZ for submit@debbugs.gnu.org; Wed, 19 Jun 2024 12:54:08 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:45320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJyZS-0007m1-FG for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 12:54:07 -0400 Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-57d15b85a34so1005554a12.3 for <70105@debbugs.gnu.org>; Wed, 19 Jun 2024 09:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718815977; x=1719420777; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=X1nDPrp+MuusbxktMSBADgb5061KD81XrAkIPTGj6kQ=; b=RRe1ZVto4Y6XC0QNPhxJYxOWKCg1Ad9lYRC9mLhqK4r71GgMl9ywIAY7Y315mDG3cq qWOLBFaeNM/6O1zZLiJ4GUDwkI+CJD4eYHRqCKAWjtGiTHiebp+j2wx5E0FopAu6e9Km pur2xo9/xVob+dW1/aeCVKuNJeLAeJlbYAjbwZ93yBaLyJhtGhVTxpe0OcmC6/CE62nl b84HoAb35nLfhy1TgwFN4KnV1JlDjVB8tR51yFKmis9kWfOlqnupp91ZBFpOUDLxlZOy ThNv77556VbeOONMhbaqNRKXBwTWQX9Ba+Mlp39Va6ERLxs7nfRm2Cp2s7TAjQoa/rT+ 5jYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718815977; x=1719420777; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X1nDPrp+MuusbxktMSBADgb5061KD81XrAkIPTGj6kQ=; b=i9EU/td6gckzfWmfptHxt0mBDPV3tGRD4TVbTdf6Z6ScRQDedQHCP8Xoqz8eTiziQ7 6A9RRyRGr9nCz+pqMx+/b63nKw01Njt5P/Vl7YO+6sQ1MkWrHAfTHcS+JzXrIL8f1i9Y 6tUgIQRLoObUT1Tj7TamvgKQPb4p0AgS5RR1TGrwmJfom5WfW5GQ1WA7tIedZwpGNyGT W15vDDiRWeSbgth7/qmXkqIKNdCX9t088QMw5sLvsVY3/NG/eiGCzip6HS5FI2Kuinhz Z92i8SrYas1tqGHaJ6WXP96inqThkGW1KU3oEOijZoZkXE7KonyzFIjZaSLcF5EzTaBt zuSQ== X-Forwarded-Encrypted: i=1; AJvYcCVBUPIQVP8UQ4Pl2TxMXjTrZ6sAKTdfDFoT4yNTkZCRDXFI6paOn9/fJNFMRNE9nPd6RTkXGa8VzgvxAizBEiNYb5qEOAQ= X-Gm-Message-State: AOJu0YxWeIYOCRjBPx8BlK1K5QoeKozepqlJR9SkXgNAWsNLayEV2R1a MVad5kPF2HzX2GX7dVDww5lYN975m+mdCNQciG4Ya3IvV3g44OnrSgJfRGJ1a4O38s4QwYRCqPa qMQjcEIwOklv3Cw79pUcG0dXT1wg= X-Google-Smtp-Source: AGHT+IE1ZJ8F1vtyqA5BPXUEFeLkVUX4PW3jti6qwKxC60LGy/0/PZHRr1XyK8il6oemwrlAZ7lTvGNyg8E8g5KZOuM= X-Received: by 2002:a05:6402:174a:b0:57d:5c0:9dc0 with SMTP id 4fb4d7f45d1cf-57d07edd0d9mr1666513a12.38.1718815976998; Wed, 19 Jun 2024 09:52:56 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 19 Jun 2024 16:52:56 +0000 From: Stefan Kangas In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> MIME-Version: 1.0 Date: Wed, 19 Jun 2024 16:52:56 +0000 Message-ID: Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box To: Stefan Monnier Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > The settings come from a `.editorconfig` or `.dir-locals.el` file and > apply to some other file. "nearest" here is the distance between the > file where the settings were found and where they apply. > > E.g. a setting from `/foo/bar/baz/.editorconfig` should take priority > over a setting from `/foo/bar/.dir-locals.el` because it's closer to > `/foo/bar/baz/mydir/myfile.agda`. > > Not sure you state it more clearly (short of writing out a long > explanation like I've just done, which doesn't seem warranted). Which one takes precedence if they are equally near? In other words, when you have: /foo/bar/.dir-locals.el /foo/bar/.editorconfig From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 13:26:24 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 17:26:24 +0000 Received: from localhost ([127.0.0.1]:52312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJz4i-0000Q4-DR for submit@debbugs.gnu.org; Wed, 19 Jun 2024 13:26:24 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJz4g-0000Pm-Oq for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 13:26:23 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A599F100061; Wed, 19 Jun 2024 13:26:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718817972; bh=flaPvKOKjM/6SPZkwEGjopQ8ljkJiRT8uBN+aNxJc/A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=n2xbmfaeJilJHXPpattr9O0HdRPdulFZk4ExQb0ZJ+HiythEuYW+WGZjGYG/0A3/t 2oWZzdx+Zqyx60T8LB74BD7CfW+LRUhbGcxNc01zSd5xgEpavAP98R7Edt8AVwNkoz pDZokYrLduVnN4Aqi2wcZOyi+XF12Xj3qgfUuXQ85SHkVuiTcAMbMMAbBNrP3pE5KE k40ex9u98DhZI5NquGqWaXhjO/sItsmdC6lCcdM3mzLluH83aKHEY5qj2Ard7B4U7x NEZeohHebxj6x3gyIPBu+dmvJUBur7K8g7t+w47C2HUSNqIlfhV1S/5XLCIO6Fk3R3 1UEnSxYwG8eqA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 892BC10002E; Wed, 19 Jun 2024 13:26:12 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 779721201F4; Wed, 19 Jun 2024 13:26:12 -0400 (EDT) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Kangas's message of "Wed, 19 Jun 2024 16:52:56 +0000") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Wed, 19 Jun 2024 13:26:11 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.122 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > In other words, when you have: > > /foo/bar/.dir-locals.el > /foo/bar/.editorconfig `.dir-locals.el` should take precedence in that case. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 15:32:25 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 19:32:25 +0000 Received: from localhost ([127.0.0.1]:56245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK12f-00051N-3Q for submit@debbugs.gnu.org; Wed, 19 Jun 2024 15:32:25 -0400 Received: from mail-ed1-f46.google.com ([209.85.208.46]:52400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK12c-000513-Kb for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 15:32:23 -0400 Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-57d0699fd02so43526a12.0 for <70105@debbugs.gnu.org>; Wed, 19 Jun 2024 12:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718825473; x=1719430273; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=2NhIvSX3kpj2rGwLp+jHhGEiZ5BSJGkgo5r2GNHk4j0=; b=mstQ/zzHWmcn179Xoe7tNF8boDFIVnvzKylLeH5WGlxkAgSacHvIhuFCPxmRPa5btu WdGBxNbxVsp4RjTWEGNpHc4UfNmmdOYIGtQOqCsLzl1K/Bp7DdruCsYM05bqQHWTttjd 6seXkDnliigMgbdpP3yQMqzsZOVlN2oCeh2L+R2kLBawWTnjM5xdFVPJuodtElMfjiCg G8OdX3KYOgvMnMi0ygjQQaAIq0WChLhR37P0HIuwPEtFQ/Tufan6NPygWwFibNZdA1nP S+M4lyM0nShJMx6GzXbAX3hePFP23zC/VvG7Tc7+B5j1FTqNqHyO+eotEL5ampoJMvoG z3Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718825473; x=1719430273; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2NhIvSX3kpj2rGwLp+jHhGEiZ5BSJGkgo5r2GNHk4j0=; b=Rxta4QeiZcN+ciP7qzbryFpejsiXoGp/O9wpEPUbjuTSXwk93VRwhzf7/3DmVydaTq dxzaYbGndGzKpOve0YzViIbpMLbs6JkPeShfoIt0JWHnf/Z2xlfj493evkOKYXfD7PRl UCZI82o9iDJ5iSty6b8XlXabhJo/XH3rLbHAkN4EHTgIsM9f3fDpgmHaTlIm0iFFJvTJ I9SvyUV051BrKCyWFEKRAjDshyJE+kncWlwJZoAyecdvBAf9g4Q+20X2aW5SM8OY80zx 4xOqZJn/suMBy7lIXcZDwCsezU3qzLteZnjpUkdG2Ss+lg5wTr9RmeNdnPWY8u6czy7p NP5w== X-Forwarded-Encrypted: i=1; AJvYcCVIQs95eI2PAprM1nU3wnsMOvG6i38Rgx9hk4CM62rjCSGTU+KyqWn3pV/jp+AF7ngBLUnbwWU6jflgUVrzpaWwLn0oWqU= X-Gm-Message-State: AOJu0YwQN5CaQvlX4y6C52sfMI1U67iNpQ8nlVmXer1eukP7pg19dRgQ iySwAtotvIHmLGPPDLqnLOFWoZmhj2J5/6VKgNOMvIqXmRECSG7Q1WDdwn6Dwg9uVUdP/G/BPYf iILt3mQVISz7YVIEY7W6uF63mvVE= X-Google-Smtp-Source: AGHT+IEiOiR66xznXn2WVANUqJRo7Zw1C4UuDlKd4LrxkP+xD3zMGw4aKEn9I3PoIMTd/FqdgkE6xYmXd3RwN3kvvk0= X-Received: by 2002:a50:aada:0:b0:57c:57b3:8d0e with SMTP id 4fb4d7f45d1cf-57d07e3b939mr2610598a12.11.1718825472871; Wed, 19 Jun 2024 12:31:12 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 19 Jun 2024 19:31:12 +0000 From: Stefan Kangas In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> MIME-Version: 1.0 Date: Wed, 19 Jun 2024 19:31:12 +0000 Message-ID: Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box To: Stefan Monnier Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> In other words, when you have: >> >> /foo/bar/.dir-locals.el >> /foo/bar/.editorconfig > > `.dir-locals.el` should take precedence in that case. How does this read? When both @file{.editorconfig} and @code{.dir-locals.el} files are found and they both set the same settings, the nearest file take precedence. If they are equally close, @file{.dir-locals.el} takes precedence. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 15:56:54 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 19:56:54 +0000 Received: from localhost ([127.0.0.1]:57047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK1QL-0005oC-NH for submit@debbugs.gnu.org; Wed, 19 Jun 2024 15:56:54 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK1QJ-0005np-Bv for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 15:56:52 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C5273805BE; Wed, 19 Jun 2024 15:56:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718827000; bh=uyfOgOci+CjRfcmm0xnme3JDeZ+ssWD8jXKuEFOtb/Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JpDQ4StYfxnaaf7GzQQnpm5Lh9xWGiVw1rsndnahKL+NQs6LIx2kqdrSU+hIAPhvH IQIm57sWljyzii/2zaUzDvJMrEOIJb5nQiA5PsGsLY3B2KOpBNaA/aYHzBP0i7PylK xIeJy6X01sLr+p4PZo1bhykAo1sFqnoRZ/ll2UrwdwEpZuhLD3wcEHiZi68DyQmiHa GmTYXAaLxRjltZiKP0Op8pO97lzWJiqVVsRxL55FqU3tRQcl83HY+enS1tPJRBNFY9 uNJ2HyW3LX+P3pfLaTMkuChHrvnSzbyjLpdG5oxjSqjC38I5Cnyv/A6AD/0NiSBVjg IFY1I7id0wn+Q== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9F4CE80136; Wed, 19 Jun 2024 15:56:40 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8AECD1205F0; Wed, 19 Jun 2024 15:56:40 -0400 (EDT) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Kangas's message of "Wed, 19 Jun 2024 19:31:12 +0000") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Wed, 19 Jun 2024 15:56:40 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.118 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >>> In other words, when you have: >>> >>> /foo/bar/.dir-locals.el >>> /foo/bar/.editorconfig >> >> `.dir-locals.el` should take precedence in that case. > > How does this read? > > When both @file{.editorconfig} and @code{.dir-locals.el} files are found > and they both set the same settings, the nearest file takes precedence. > If they are equally close, @file{.dir-locals.el} takes precedence. Doesn't this risk suggesting that the settings from only one of the two files will be used? Here's my current text: When both @file{.editorconfig} and @file{.dir-locals.el} files are found, their settings are combined, and in case of a conflict, the setting coming from the closest file takes precedence. If they are equally close, @file{.dir-locals.el} takes precedence. - Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 16:53:10 2024 Received: (at 70105) by debbugs.gnu.org; 19 Jun 2024 20:53:10 +0000 Received: from localhost ([127.0.0.1]:58770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK2In-0007cv-Ku for submit@debbugs.gnu.org; Wed, 19 Jun 2024 16:53:09 -0400 Received: from mail-ed1-f50.google.com ([209.85.208.50]:59768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK2Ik-0007cK-P8 for 70105@debbugs.gnu.org; Wed, 19 Jun 2024 16:53:08 -0400 Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-57cf8880f95so131162a12.3 for <70105@debbugs.gnu.org>; Wed, 19 Jun 2024 13:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718830317; x=1719435117; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=rOtefE8THl2pRJ0xac3GpeST7NtWiZMuot8pH+JDCgo=; b=iUI8ow3OprQRfZAPr8qZtQsXwSE1NUc1mNLc6bArK6zyHZD3WKtERopqJ5F9kKkLPO f1+fRNQCbN7rBo6E2wnSmwWuezK7MO88eiqo40Dv77lMFuuHB37kyLQngBxTDZHSaljx B533kr21Opkndt4bruKaIotpN3hmT5dlF8tNLOSX/VJxmZX9jGE8QRyautntNeFulcex Cng5vTpwpNHXN2vxGasyhcogB0Lo8YMc+uzZZic6xY6CO3hWQq06H/Yd0UJcXWdnklwB P01N5ah6RG8SVGdsHsNXHpbuhWn8xDe9+p6GWdKaUjOdROXnCgA3AKbrH1zj8/fnsmzD QyqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718830317; x=1719435117; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rOtefE8THl2pRJ0xac3GpeST7NtWiZMuot8pH+JDCgo=; b=jreZEQen3StRidEtQYtQWINX19dEKmd6v9giY0saRikBGD1pDHwxXvQzFCR1db/r93 rkDeQyFwVvcGTCRRlN0e7/CzUIbczFWbPXpYDohmV3TtdExKtk/PaFT5KCbgGEmrl63X BKa2QPOyxIpdr83g0HkYnPAQXypPQZCk1pt4ecchhNR733gV/CMTg4ZonacaP9wX5YLp YZoS2lyxn9jfST7K/6+dmNpFIpQI0f9W9QSuEHEMIp9Hml0LY9zG2ViuK+5qSyOYoRkH Dt5UFAxATD7ZYXidSymEqXCRZiO3Hauu2LNr5CoVxFARNTm2rrluhP05fXI1jdoh60Ao sOPQ== X-Forwarded-Encrypted: i=1; AJvYcCX+wIHJmsibguQlw2uv+f+X+STdylqQbNmnIao/0E5bCF5ysNPD6B++2UZZACekXJrAs9EV75AzkY5zNec/ZTzfaX8UFiA= X-Gm-Message-State: AOJu0YwqiaWR+B1d/p7Jya0vGui9y4zW+1JveIBfc58Lyc6HzA7TgEnF cYVbP2lFS0ZsbDjUxYzurjAUPKvKEMgfxyMEjTSOl2VU98H3qlxElJAT/15A+prQieSzMOgKCg9 w3/bUzZIUDlRUaEuEw92dwaeL+CM= X-Google-Smtp-Source: AGHT+IE8m7316XolNaRAPDshw0hOw2HkfI4juFo35ZOjXjpLsYE+rss9B87JtejCDd30P1GhctezEpHRIkOGgPlxgzI= X-Received: by 2002:a50:9b42:0:b0:57d:2138:d114 with SMTP id 4fb4d7f45d1cf-57d2148141cmr75401a12.15.1718830317200; Wed, 19 Jun 2024 13:51:57 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 19 Jun 2024 20:51:56 +0000 From: Stefan Kangas In-Reply-To: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> MIME-Version: 1.0 Date: Wed, 19 Jun 2024 20:51:56 +0000 Message-ID: Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box To: Stefan Monnier Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > Here's my current text: > > When both @file{.editorconfig} and @file{.dir-locals.el} files are > found, their settings are combined, and in case of a conflict, the > setting coming from the closest file takes precedence. > If they are equally close, @file{.dir-locals.el} takes precedence. Looks good to me, thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 20 12:33:39 2024 Received: (at 70105) by debbugs.gnu.org; 20 Jun 2024 16:33:40 +0000 Received: from localhost ([127.0.0.1]:35658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKKjD-00073A-KL for submit@debbugs.gnu.org; Thu, 20 Jun 2024 12:33:39 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKKjC-00072v-3a for 70105@debbugs.gnu.org; Thu, 20 Jun 2024 12:33:38 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8BFFC100043; Thu, 20 Jun 2024 12:33:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718901207; bh=ZMzQ7MoM4E6xENHuheimpx9ASFOZlLwqridLXLNigbE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Cd5iEzjEXUCbe3YtbNkLGqIATKDnRSOKGBMGGgZD2CwC5nX8lnUFoJXfKqz8o/DoE +wegh0ZFtiRa6IU96iSn1y9+VHEEEv1OvLtWbhLu5P0N32SIGiAbTsLdw9eBck4Ob3 isWLkNGZVbt/Zi1gIqBWRZ98Yklzx3oHbGfGJ6KtXRVy0TMXQ3yOj4KSkMp2GDQ0PY pjacSHnGqO8L9/v7Aa1TiM8YiE5tjPwA6dQxzay1Ipk3fPJkPzzJ+qbs8ED6KsU8IY oHl/GZJKPdmfGKjqnoKeJN+DZ+x5GgqgYrEX8Ob8Fdfy/jJIBgfry7S+4xo1gq73qC p45mC/g/LmL2A== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 79087100035; Thu, 20 Jun 2024 12:33:27 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 616C71203DF; Thu, 20 Jun 2024 12:33:27 -0400 (EDT) From: Stefan Monnier To: Ihor Radchenko Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: <878qz19bgi.fsf@localhost> (Ihor Radchenko's message of "Wed, 19 Jun 2024 15:52:29 +0000") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> <878qz19bgi.fsf@localhost> Date: Thu, 20 Jun 2024 12:33:26 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.122 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70105 Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Reading this as a major mode maintainer, I have not the slightest clue > about EditorConfig standard. So, I have no idea what indent_size is all > about and what I am supposed to do with it. I think in Org it's called `org-indent-indentation-per-level`. [ BTW, currently `editorconfig.el` comes with a list of 100 modes (including several I'd never heard of) with their corresponding "indent size variable(s)" but Org is not among those modes. ] Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 21 12:48:04 2024 Received: (at 70105-done) by debbugs.gnu.org; 21 Jun 2024 16:48:04 +0000 Received: from localhost ([127.0.0.1]:43187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKhQh-0001Bt-FN for submit@debbugs.gnu.org; Fri, 21 Jun 2024 12:48:03 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:61230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKhQd-0001BN-TN for 70105-done@debbugs.gnu.org; Fri, 21 Jun 2024 12:48:01 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 110C680136; Fri, 21 Jun 2024 10:19:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1718979575; bh=yLKyWSMz6vgZVDjFU20oV0Ms12uN0a/r83QSPiUpYqc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=prIYteUo7/S+iqclD7c6OHpIe41OnDE540FRyJiPVMXkexMMAv103aEBU1X6FyVDM mDaWzUbxWq7sDyoGWGqUvOALNTbzu0ZnZvHzBD8OJLuDUe6R5iDlg82hXYp7V0aXeZ cyUGidKe37hKBKYNdJg9uapPyKghJdmHE4xjZXnQbDTpGg2O+nFCT/EH9OmlrH3sN3 M6JUPbGlQjmisQ20Mg95+CfbXcYetmOQrBUUpAyQ8cLzxkTjar1eh5TQhbKE3a/RiS IhAxfglEPKPun9nLBdtztbbVFjywxQLToHJljQh7UDFjOQHuDWnhp6erLmbdtGV5+Q /jDneA+h8CwAw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 804D5801D8; Fri, 21 Jun 2024 10:19:35 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6AAAD120199; Fri, 21 Jun 2024 10:19:35 -0400 (EDT) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box In-Reply-To: (Stefan Kangas's message of "Wed, 19 Jun 2024 20:51:56 +0000") Message-ID: References: <867chibhqi.fsf@gnu.org> <86frtnd2e6.fsf@gnu.org> Date: Fri, 21 Jun 2024 10:19:32 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.101 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70105-done Cc: jcs090218@gmail.com, bjorn.bidar@thaodan.de, Eli Zaretskii , 8slashes+git@gmail.com, 70105-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Pushed to `master`, closing, Stefan From unknown Sun Jun 15 01:04:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Jul 2024 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator