Compare commits

...

6 commits

Author SHA1 Message Date
Henrik Lissner
f3b4314dda
docs(editorconfig): revise usage section 2025-09-18 00:24:21 -04:00
Henrik Lissner
64b085b381
fix(editorconfig): default to native binary, if available
The default editorconfig implementation was changed upstream to the
elisp one, but — for the principle of least surprise — I believe it
should be the other way around: if the user has the native binary
installed, they're likely expecting it to be used; it will fall back to
the elisp implementation otherwise.

Also updates documentation to reflect these changes and removes the
doctor warning about a missing binary.

Ref: editorconfig/editorconfig-emacs#209
2025-09-18 00:24:04 -04:00
Henrik Lissner
09a80927f3
docs(editorconfig): remove obsolete hack
The hack was removed in 41e81f6.

Amend: 41e81f67a7
2025-09-18 00:17:31 -04:00
Henrik Lissner
a72c865c35
tweak(org): don't configure ob-python
More recent versions of ob-python (Org 9.7+) calculates the python
command from `python-shell-interpreter` and
`python-shell-interpreter-args`, effectively rendering this block
(mostly) redundant. It still leaves
`org-babel-python-command-nonsession` to be changed, but I think I'll
leave that to users to set, for simplicity's sake.

What's more, users who repin Org to an older version (predating
bzg/org-mode@9239b0e8d1) will see void-variable errors for this new
variable.

Fix: #8509
2025-09-17 23:28:46 -04:00
Henrik Lissner
4c9dee2c78
fix(tree-sitter): treesit-extra-load-path: use file-name-concat
In case doom-profile-data-dir doesn't end with a slash (which is a
stipulation I won't be enforcing for Doom's dir variables in v3 and
beyond).

Fix: #8511
2025-09-17 17:49:22 -04:00
Henrik Lissner
4159a4f7da
refactor(default): remove defunct taskrunner keybinds
The taskrunner module was removed in 27539e2.

Amend: 27539e225e
2025-09-17 16:18:50 -04:00
7 changed files with 21 additions and 40 deletions

View file

@ -303,10 +303,6 @@
:desc "Search project" "s" #'+default/search-project
:desc "Open project scratch buffer" "x" #'doom/open-project-scratch-buffer
:desc "Switch to project scratch buffer" "X" #'doom/switch-to-project-scratch-buffer
(:when (and (modulep! :tools taskrunner)
(or (modulep! :completion ivy)
(modulep! :completion helm)))
:desc "List project tasks" "z" #'+taskrunner/project-tasks)
;; later expanded by projectile
(:prefix ("4" . "in other window"))
(:prefix ("5" . "in other frame")))

View file

@ -785,11 +785,7 @@
:desc "Save project files" "s" #'projectile-save-project-buffers
:desc "Test project" "T" #'projectile-test-project
:desc "Pop up scratch buffer" "x" #'doom/open-project-scratch-buffer
:desc "Switch to scratch buffer" "X" #'doom/switch-to-project-scratch-buffer
(:when (and (modulep! :tools taskrunner)
(or (modulep! :completion ivy)
(modulep! :completion helm)))
:desc "List project tasks" "z" #'+taskrunner/project-tasks))
:desc "Switch to scratch buffer" "X" #'doom/switch-to-project-scratch-buffer)
;;; <leader> q --- quit/session
(:prefix-map ("q" . "quit/session")

View file

@ -284,17 +284,7 @@ Also adds support for a `:sync' parameter to override `:async'."
(save-excursion
(when-let ((beg (org-babel-where-is-src-block-result))
(end (progn (goto-char beg) (forward-line) (org-babel-result-end))))
(org-display-inline-images nil nil (min beg end) (max beg end)))))))
(after! ob-python
(when (equal org-babel-python-command-nonsession "python")
(setq org-babel-python-command-nonsession
(string-trim
(concat python-shell-interpreter " "
(if (string-match-p "\\<i?python[23]?$" python-shell-interpreter)
(replace-regexp-in-string
"\\(^\\| \\)-i\\( \\|$\\)" " " python-shell-interpreter-args)
python-shell-interpreter-args)))))))
(org-display-inline-images nil nil (min beg end) (max beg end))))))))
(defun +org-init-babel-lazy-loader-h ()

View file

@ -4,9 +4,9 @@
#+since: 0.9
* Description :unfold:
This module integrates [[https://editorconfig.org/][EditorConfig]] into Emacs, allowing users to dictate code
style on a per-project basis with an =.editorconfig= file ([[https://editorconfig-specification.readthedocs.io/][formal
specification]]).
This module adds [[https://editorconfig.org/][EditorConfig]] support to Emacs, allowing users to dictate code
style on a per-project basis with =.editorconfig= files ([[https://editorconfig-specification.readthedocs.io/][formal specification]]),
with or without the native editorconfig binary.
** Maintainers
- [[doom-user:][@hlissner]]
@ -20,10 +20,6 @@ specification]]).
- [[doom-package:editorconfig-emacs]]
** Hacks
- Added logic to guess an extension-less file's type from its shebang line. For
example, editorconfig rules for =*.py= files will apply to =bin/myscript=
assuming its first line is ~#!/usr/bin/env python~. See
~+editorconfig-mode-alist~ for adding support for more languages.
- *Special integration for =dtrt-indent=:* If the local editorconfig file
specifies ~indent_style~ or ~indent_size~, the [[doom-package:dtrt-indent]] (which tries to
guess your indent settings by analyzing your text file) will bow out.
@ -37,16 +33,17 @@ specification]]).
* Installation
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
This module has one optional dependency: the ~editorconfig~ native binary.
Without it, a built-in elisp implementation will be used, but it has fewer
features and can be a bit slower.
This module has one optional dependency: the native ~editorconfig~ binary.
Without it, a built-in elisp implementation will be used, which is claimed to be
faster and more secure.
The editorconfig binary has [[https://github.com/editorconfig#contributing][many implementations]] you can choose from, typically
available through your OS package manager (or build it yourself).
If you choose to install the binary, [[https://github.com/editorconfig#contributing][many implementations]] are available, usually
through your OS package manager (if not built from source yourself).
* Usage
You will need to write an ~.editorconfig~ file in your project (this is usually
in the root of your project) you can find out about all the properties [[https://editorconfig.org/#example-file][here]].
A ~.editorconfig~ file in your project (usually in the root directory of the
project) is needed to configure code style for files in the same directory or
below. Documentation on editorconfig's properties can be found [[https://editorconfig.org/#example-file][here]].
* TODO Configuration
#+begin_quote

View file

@ -6,6 +6,13 @@
(use-package! editorconfig
:hook (doom-first-buffer . editorconfig-mode)
:config
;; The elisp implementation is the default (rather than the external,
;; editorconfig binary), because upstream claims it's "faster and more
;; secure". Whether that's true or not, I argue the principle of least
;; surprise: if the user has the editorconfig binary installed, they're likely
;; expecting it to be used.
(setq editorconfig-get-properties-function #'editorconfig-get-properties)
(when (require 'ws-butler nil t)
(setq editorconfig-trim-whitespaces-mode 'ws-butler-mode))

View file

@ -1,5 +0,0 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; tools/editorconfig/doctor.el
(unless (executable-find "editorconfig")
(warn! "Couldn't find the editorconfig binary. Using native elisp version (slower)"))

View file

@ -100,7 +100,7 @@
:config
;; HACK: Keep $EMACSDIR clean by installing grammars to the active profile.
(add-to-list 'treesit-extra-load-path (concat doom-profile-data-dir "tree-sitter"))
(add-to-list 'treesit-extra-load-path (file-name-concat doom-profile-data-dir "tree-sitter"))
(defadvice! +tree-sitter--install-grammar-to-local-dir-a (fn &rest args)
"Write grammars to `doom-profile-data-dir'."
:around #'treesit-install-language-grammar