dev: merge branch 'master' of into pr7339

This commit is contained in:
Matt Nish-Lapidus 2023-12-13 20:38:47 -05:00
commit 0e994050f0
363 changed files with 2603 additions and 3283 deletions

View file

@ -2,6 +2,7 @@
name: 📝 Bug Report name: 📝 Bug Report
description: Report something that isn't working as intended description: Report something that isn't working as intended
labels: ["is:bug", "needs-triage"] labels: ["is:bug", "needs-triage"]
projects: ["doomemacs/2"]
body: body:
- type: markdown - type: markdown
attributes: attributes:
@ -32,9 +33,8 @@ body:
Doom. Doom.
required: true required: true
- label: > - label: >
The issue can be reproduced on a stable release of Emacs, such as 27 The issue can be reproduced on a stable release of Emacs, such as 27,
or 28. *(Doom does not support development builds like 29+ or any 28, or 29. *(Unstable versions end in .50, .60, or .9x)*
version ending in .50 or .9x)*
required: true required: true
- type: markdown - type: markdown
attributes: attributes:

View file

@ -1,8 +0,0 @@
name: Add issues to project
on:
issues:
types: [opened]
jobs:
add-to-project:
uses: doomemacs/ci/.github/workflows/add-to-project.yml@legacy
secrets: inherit

3
.gitignore vendored
View file

@ -1,3 +1,6 @@
# generated by macOS
.DS_Store
# machine generated doom profiles or metadata # machine generated doom profiles or metadata
/profiles/*.el /profiles/*.el
/.local*/ /.local*/

View file

@ -98,20 +98,23 @@ Check out [the FAQ][FAQ] for answers to common questions about the project.
# Prerequisites # Prerequisites
+ Git 2.23+ - Git 2.23+
+ Emacs 27.129.1 (**Recommended: 29.1 + - Emacs 27.129.1 (**Recommended: 29.1 +
[native-comp](https://www.emacswiki.org/emacs/GccEmacs)**) [native-comp](https://www.emacswiki.org/emacs/GccEmacs)**)
> :warning: Unstable and pre-release builds of Emacs -- which end in `.50`, - [ripgrep] 11.0+
> `.60`, or `.9X` (e.g. `28.1.91`) -- **are not officially supported**. There - GNU `find`
> *is* some effort to support Emacs HEAD, however. [Follow this Discourse - *OPTIONAL:* [fd] 7.3.0+ (improves file indexing performance for some commands)
> post](https://discourse.doomemacs.org/t/3241) for details.
+ [ripgrep] 11.0+ > [!WARNING]
+ GNU `find` > Unstable and pre-release builds of Emacs -- which end in `.50`, `.60`, or
+ *OPTIONAL:* [fd] 7.3.0+ (improves file indexing performance for some commands) > `.9X` (e.g. `28.1.91`) -- **are not officially supported**. There *is* some
> effort to support Emacs HEAD, however. [Follow this Discourse
Doom is comprised of [~150 optional modules][Modules], some of which may have > post](https://discourse.doomemacs.org/t/3241) for details.
additional dependencies. [Visit their documentation][Modules] or run `bin/doom
doctor` to check for any that you may have missed. > [!IMPORTANT]
> Doom is comprised of [~150 optional modules][Modules], some of which may have
> additional dependencies. [Visit their documentation][Modules] or run `bin/doom
> doctor` to check for any that you may have missed.
# Install # Install

View file

@ -173,7 +173,7 @@
behaviour for known commands. behaviour for known commands.
#+begin_quote #+begin_quote
📌 Doom users with evil enabled will find the universal argument on [[kbd:][SPC u]] 󰐃 Doom users with evil enabled will find the universal argument on [[kbd:][SPC u]]
instead than [[kbd:][C-u]]. instead than [[kbd:][C-u]].
#+end_quote #+end_quote

View file

@ -5,6 +5,12 @@
#+subtitle: Samples of Emacs/Doom dotfiles, concepts, and sub-projects #+subtitle: Samples of Emacs/Doom dotfiles, concepts, and sub-projects
#+property: header-args:elisp :results pp #+property: header-args:elisp :results pp
#+begin_quote
󰐃 Our documentation was designed to be read in Doom Emacs ([[kbd:][M-x doom/help]]) or
online at https://docs.doomemacs.org. Avoid reading it elsewhere (like
Github), where it will be rendered incorrectly.
#+end_quote
* Introduction * Introduction
Examples speak louder than technical explanations, so this file exists to house Examples speak louder than technical explanations, so this file exists to house
examples of Doom's (and Emacs') concepts, libraries, dotfiles, and more, for examples of Doom's (and Emacs') concepts, libraries, dotfiles, and more, for

View file

@ -5,6 +5,12 @@
#+subtitle: Answers to common issues and questions #+subtitle: Answers to common issues and questions
#+startup: nonum show2levels* #+startup: nonum show2levels*
#+begin_quote
󰐃 Our documentation was designed to be read in Doom Emacs ([[kbd:][M-x doom/help]]) or
online at https://docs.doomemacs.org. Avoid reading it elsewhere (like
Github) where it will be rendered incorrectly.
#+end_quote
* General * General
:PROPERTIES: :PROPERTIES:
:ID: 3c17177d-8ba9-4d1a-a279-b6dea21c8a9a :ID: 3c17177d-8ba9-4d1a-a279-b6dea21c8a9a
@ -242,8 +248,9 @@ Doom exposes a couple variables for setting fonts. They are:
- [[var:doom-variable-pitch-font]]: used for non-monospace fonts (e.g. when using - [[var:doom-variable-pitch-font]]: used for non-monospace fonts (e.g. when using
variable-pitch-mode or mixed-pitch-mode). Popular for text modes, like Org or variable-pitch-mode or mixed-pitch-mode). Popular for text modes, like Org or
Markdown. Markdown.
- [[var:doom-unicode-font]]: used for rendering unicode glyphs. This is ~Symbola~ by - [[var:doom-emoji-font]]: used for rendering emoji. Only needed if you want to use
default. It is ignored if the [[doom-module::ui unicode]] module is enabled. a font other than your operating systems default.
- [[var:doom-symbol-font]]: used for rendering symbols.
- [[var:doom-serif-font]]: the sans-serif font to use wherever the [[face:fixed-pitch-serif]] - [[var:doom-serif-font]]: the sans-serif font to use wherever the [[face:fixed-pitch-serif]]
face is used. face is used.
- [[var:doom-big-font]]: the large font to use when [[fn:doom-big-font-mode]] is active. - [[var:doom-big-font]]: the large font to use when [[fn:doom-big-font-mode]] is active.
@ -261,12 +268,12 @@ For example:
;; in $DOOMDIR/config.el ;; in $DOOMDIR/config.el
(setq doom-font (font-spec :family "JetBrainsMono" :size 12 :weight 'light) (setq doom-font (font-spec :family "JetBrainsMono" :size 12 :weight 'light)
doom-variable-pitch-font (font-spec :family "DejaVu Sans" :size 13) doom-variable-pitch-font (font-spec :family "DejaVu Sans" :size 13)
doom-unicode-font (font-spec :family "Symbola") doom-symbol-font (font-spec :family "JuliaMono")
doom-big-font (font-spec :family "JetBrainsMono" :size 24)) doom-big-font (font-spec :family "JetBrainsMono" :size 24))
#+end_src #+end_src
#+begin_quote #+begin_quote
🚧 If you or Emacs can't find your font, use ~M-x describe-font~ to look them 󰐃 If you or Emacs can't find your font, use ~M-x describe-font~ to look them
up, or run ~$ fc-list~ to see all the available fonts on your system. *Font up, or run ~$ fc-list~ to see all the available fonts on your system. *Font
issues are /rarely/ Doom issues!* issues are /rarely/ Doom issues!*
#+end_quote #+end_quote
@ -518,7 +525,7 @@ Here are a few common causes for random crashes:
- Some fonts cause Emacs to crash when they lack support for a particular glyph - Some fonts cause Emacs to crash when they lack support for a particular glyph
(typically symbols). Try changing your font by changing ~doom-font~ or (typically symbols). Try changing your font by changing ~doom-font~ or
~doom-unicode-font~. ~doom-symbol-font~.
- Ligatures can cause Emacs to crash. Try a different [[doom-module::ui ligatures +fira][ligature font]] or disable - Ligatures can cause Emacs to crash. Try a different [[doom-module::ui ligatures +fira][ligature font]] or disable
the [[doom-module::ui ligatures]] module altogether. the [[doom-module::ui ligatures]] module altogether.
@ -618,7 +625,7 @@ keybinds to work:
#+end_src #+end_src
#+begin_quote #+begin_quote
📌 I use [C-left] because it is easier to type than "<C-left>", but they are 󰐃 I use [C-left] because it is easier to type than "<C-left>", but they are
equivalent; two different ways to refer to the same key. equivalent; two different ways to refer to the same key.
#+end_quote #+end_quote
** Recursive load error on startup ** Recursive load error on startup
@ -638,7 +645,7 @@ Then these are the three most common explanations:
- *GNU* =tar= and/or =gzip= are not installed on your system. - *GNU* =tar= and/or =gzip= are not installed on your system.
#+begin_quote #+begin_quote
🚧 *Warning macOS and *BSD distro users:* you likely have BSD variants of *Warning macOS and *BSD distro users:* you likely have BSD variants of
=tar= and =gzip= installed by default. Emacs requires the GNU variants! =tar= and =gzip= installed by default. Emacs requires the GNU variants!
#+end_quote #+end_quote
@ -833,13 +840,13 @@ There's more about quoting [[https://emacsdocs.org/docs/elisp/Quoting][in the Em
** TODO How does Doom Emacs start up so quickly? ** TODO How does Doom Emacs start up so quickly?
#+begin_quote #+begin_quote
🔨 *This post is a work in progress!* However, there's a post on our Discourse 󱌣 *This post is a work in progress!* However, there's a post on our Discourse
that outlines [[https://discourse.doomemacs.org/t/how-does-doom-start-up-so-quickly/163/1][some of our older techniques]]. that outlines [[https://discourse.doomemacs.org/t/how-does-doom-start-up-so-quickly/163/1][some of our older techniques]].
#+end_quote #+end_quote
** TODO How does Doom Emacs improve runtime performance? ** TODO How does Doom Emacs improve runtime performance?
#+begin_quote #+begin_quote
🔨 *This post is a work in progress!* 󱌣 *This post is a work in progress!*
#+end_quote #+end_quote
** Why does Doom not use dash, f, s, or similar libraries? ** Why does Doom not use dash, f, s, or similar libraries?
@ -911,7 +918,7 @@ you, a combination of [[kbd:][o]] (swaps your cursor between the two ends of the
and motion keys can adjust the ends of your selection. and motion keys can adjust the ends of your selection.
#+begin_quote #+begin_quote
📌 There are also text objects for xml tags ([[kbd:][x]]), C-style function arguments 󰐃 There are also text objects for xml tags ([[kbd:][x]]), C-style function arguments
([[kbd:][a]]), angle brackets, and single/double quotes. ([[kbd:][a]]), angle brackets, and single/double quotes.
#+end_quote #+end_quote

View file

@ -551,9 +551,7 @@ doom sync
doom env doom env
# Lastly, install the icon fonts Doom uses: # Lastly, install the icon fonts Doom uses:
emacs --batch -f all-the-icons-install-fonts emacs --batch -f nerd-icons-install-fonts
# On Windows, `all-the-icons-install-fonts` will only download the fonts, you'll
# have to install them by hand afterwards!
#+END_SRC #+END_SRC
To understand the purpose of the =~/.doom.d= directory and =~/.doom.d/init.el= To understand the purpose of the =~/.doom.d= directory and =~/.doom.d/init.el=

View file

@ -96,48 +96,86 @@ in."
(error! "Couldn't find the `rg' binary; this a hard dependecy for Doom, file searches may not work at all"))) (error! "Couldn't find the `rg' binary; this a hard dependecy for Doom, file searches may not work at all")))
(print! (start "Checking for Emacs config conflicts...")) (print! (start "Checking for Emacs config conflicts..."))
(when (file-exists-p "~/.emacs") (print-group!
(warn! "Detected an ~/.emacs file, which may prevent Doom from loading") (unless (or (file-equal-p doom-emacs-dir "~/.emacs.d")
(explain! "If Emacs finds an ~/.emacs file, it will ignore ~/.emacs.d, where Doom is " (file-equal-p doom-emacs-dir "~/.config/emacs"))
"typically installed. If you're seeing a vanilla Emacs splash screen, this " (print! (warn "Doom is installed in a non-standard location"))
"may explain why. If you use Chemacs, you may ignore this warning.")) (explain! "The standard locations are ~/.config/emacs or ~/.emacs.d. Emacs will fail "
"to load Doom if it is not explicitly told where to look for it. In Emacs 29+, "
"this is possible with the --init-directory option:\n\n"
" $ emacs --init-directory '" (abbreviate-file-name doom-emacs-dir) "'\n\n"
"However, Emacs 27-28 users have no choice but to move Doom to a standard "
"location.\n\n"
"Chemacs users may ignore this warning, however."))
(let (found?)
(dolist (file '("~/_emacs" "~/.emacs" "~/.emacs.el" "~/.emacs.d" "~/.config/emacs"))
(when (and (file-exists-p file)
(not (file-equal-p file doom-emacs-dir)))
(setq found? t)
(print! (warn "Found another Emacs config: %s (%s)")
file (if (file-directory-p file) "directory" "file"))))
(when found?
(explain! "Having multiple Emacs configs may prevent Doom from loading properly. Emacs "
"will load the first it finds and ignore the rest. If Doom isn't starting up "
"correctly (e.g. you get a vanilla splash screen), make sure that only one of "
"these exist.\n\n"
"Chemacs users may ignore this warning."))))
(print! (start "Checking for great Emacs features...")) (print! (start "Checking for missing Emacs features..."))
(unless (functionp 'json-serialize) (print-group!
(warn! "Emacs was not built with native JSON support") (unless (functionp 'json-serialize)
(explain! "Users will see a substantial performance gain by building Emacs with " (warn! "Emacs was not built with native JSON support")
"jansson support (i.e. a native JSON library), particularly LSP users. " (explain! "Users will see a substantial performance gain by building Emacs with "
"You must install a prebuilt Emacs binary with this included, or compile " "jansson support (i.e. a native JSON library), particularly LSP users. "
"Emacs with the --with-json option.")) "You must install a prebuilt Emacs binary with this included, or compile "
(unless (featurep 'native-compile) "Emacs with the --with-json option."))
(warn! "Emacs was not built with native compilation support") (unless (featurep 'native-compile)
(explain! "Users will see a substantial performance gain by building Emacs with " (warn! "Emacs was not built with native compilation support")
"native compilation support, availible in emacs 28+." (explain! "Users will see a substantial performance gain by building Emacs with "
"You must install a prebuilt Emacs binary with this included, or compile " "native compilation support, availible in emacs 28+."
"Emacs with the --with-native-compilation option.")) "You must install a prebuilt Emacs binary with this included, or compile "
"Emacs with the --with-native-compilation option.")))
(print! (start "Checking for private config conflicts...")) (print! (start "Checking for private config conflicts..."))
(let* ((xdg-dir (concat (or (getenv "XDG_CONFIG_HOME") (print-group!
"~/.config") (let* ((xdg-dir (concat (or (getenv "XDG_CONFIG_HOME")
"/doom/")) "~/.config")
(doom-dir (or (getenv "DOOMDIR") "/doom/"))
"~/.doom.d/")) (doom-dir (or (getenv "DOOMDIR")
(dir (if (file-directory-p xdg-dir) "~/.doom.d/"))
xdg-dir (dir (if (file-directory-p xdg-dir)
doom-dir))) xdg-dir
(when (file-equal-p dir doom-emacs-dir) doom-dir)))
(print! (error "Doom was cloned to %S, not ~/.emacs.d or ~/.config/emacs" (when (file-equal-p dir doom-emacs-dir)
(path dir))) (print! (error "Doom was cloned to %S, not ~/.emacs.d or ~/.config/emacs"
(explain! "Doom's source and your private Doom config have to live in separate directories. " (path dir)))
"Putting them in the same directory (without changing the DOOMDIR environment " (explain! "Doom's source and your private Doom config have to live in separate directories. "
"variable) will cause errors on startup.")) "Putting them in the same directory (without changing the DOOMDIR environment "
(when (and (not (file-equal-p xdg-dir doom-dir)) "variable) will cause errors on startup."))
(file-directory-p xdg-dir) (when (and (not (file-equal-p xdg-dir doom-dir))
(file-directory-p doom-dir)) (file-directory-p xdg-dir)
(print! (warn "Detected two private configs, in %s and %s") (file-directory-p doom-dir))
(abbreviate-file-name xdg-dir) (print! (warn "Detected two private configs, in %s and %s")
doom-dir) (abbreviate-file-name xdg-dir)
(explain! "The second directory will be ignored, as it has lower precedence."))) doom-dir)
(explain! "The second directory will be ignored, as it has lower precedence."))))
(print! (start "Checking for common environmental issues..."))
(when (string-match-p "/fish$" shell-file-name)
(print! (warn "Detected Fish as your $SHELL"))
(explain! "Fish (and possibly other non-POSIX shells) is known to inject garbage "
"output into some of the child processes that Emacs spawns. Many Emacs "
"packages/utilities will choke on this output, causing unpredictable issues. "
"To get around this, either:\n\n"
" - Add the following to $DOOMDIR/config.el:\n\n"
" (setq shell-file-name (executable-find \"bash\"))\n\n"
" - Or change your default shell to a POSIX shell (like bash or zsh) "
" and explicitly configure your terminal apps to use the shell you "
" want.\n\n"
"If you opt for option 1 and use one of Emacs' terminal emulators, you "
"will also need to configure them to use Fish, e.g.\n\n"
" (setq-default vterm-shell (executable-find \"fish\"))\n\n"
" (setq-default explicit-shell-file-name (executable-find \"fish\"))\n"))
(print! (start "Checking for stale elc files...")) (print! (start "Checking for stale elc files..."))
(elc-check-dir doom-core-dir) (elc-check-dir doom-core-dir)
@ -205,13 +243,13 @@ in."
;; Check for fonts ;; Check for fonts
(if (not (executable-find "fc-list")) (if (not (executable-find "fc-list"))
(warn! "Warning: unable to detect fonts because fontconfig isn't installed") (warn! "Warning: unable to detect fonts because fontconfig isn't installed")
;; all-the-icons fonts ;; nerd-icons fonts
(when (and (pcase system-type (when (and (pcase system-type
(`gnu/linux (concat (or (getenv "XDG_DATA_HOME") (`gnu/linux (concat (or (getenv "XDG_DATA_HOME")
"~/.local/share") "~/.local/share")
"/fonts/")) "/fonts/"))
(`darwin "~/Library/Fonts/")) (`darwin "~/Library/Fonts/"))
(require 'all-the-icons nil t)) (require 'nerd-icons nil t))
(with-temp-buffer (with-temp-buffer
(let ((errors 0)) (let ((errors 0))
(cl-destructuring-bind (status . output) (cl-destructuring-bind (status . output)
@ -219,15 +257,16 @@ in."
(if (not (zerop status)) (if (not (zerop status))
(print! (error "There was an error running `fc-list'. Is fontconfig installed correctly?")) (print! (error "There was an error running `fc-list'. Is fontconfig installed correctly?"))
(insert (cdr (doom-call-process "fc-list" "" "file"))) (insert (cdr (doom-call-process "fc-list" "" "file")))
(dolist (font all-the-icons-font-names) (dolist (font nerd-icons-font-names)
(if (save-excursion (re-search-backward font nil t)) (if (save-excursion (re-search-backward font nil t))
(success! "Found font %s" font) (success! "Found font %s" font)
(print! (warn "Warning: couldn't find %S font") font))) (print! (warn "%S font is not installed on your system") font)
(cl-incf errors)))
(when (> errors 0) (when (> errors 0)
(explain! "Some all-the-icons fonts were missing.\n\n" (explain! "Some needed fonts are not properly installed on your system. To download and "
"You can install them by running `M-x all-the-icons-install-fonts' within Emacs.\n" "install them, run `M-x nerd-icons-install-fonts' from within Doom Emacs. "
"This could also mean you've installed them in non-standard locations, in which " "However, on Windows this command will only download them; the fonts must "
"case feel free to ignore this warning."))))))))) "be installed manually afterwards.")))))))))
(print! (start "Checking for stale elc files in your DOOMDIR...")) (print! (start "Checking for stale elc files in your DOOMDIR..."))
(when (file-directory-p doom-user-dir) (when (file-directory-p doom-user-dir)

View file

@ -19,7 +19,7 @@
(config? ("--config" :yes) "Create `$DOOMDIR' or dummy files therein?") (config? ("--config" :yes) "Create `$DOOMDIR' or dummy files therein?")
(envfile? ("--env" :yes) "(Re)generate an envvars file? (see `$ doom help env`)") (envfile? ("--env" :yes) "(Re)generate an envvars file? (see `$ doom help env`)")
(install? ("--install" :yes) "Auto-install packages?") (install? ("--install" :yes) "Auto-install packages?")
(fonts? ("--fonts" :yes) "Install (or prompt to install) all-the-icons fonts?") (fonts? ("--fonts" :yes) "Install (or prompt to install) nerd-icons fonts?")
(hooks? ("--hooks" :yes) "Deploy Doom's git hooks to itself?") (hooks? ("--hooks" :yes) "Deploy Doom's git hooks to itself?")
&context context) &context context)
"Installs and sets up Doom Emacs for the first time. "Installs and sets up Doom Emacs for the first time.
@ -32,7 +32,7 @@ This command does the following:
3. Creates dummy files for `$DOOMDIR'/{config,packages}.el, 3. Creates dummy files for `$DOOMDIR'/{config,packages}.el,
4. Prompts you to generate an envvar file (same as `$ doom env`), 4. Prompts you to generate an envvar file (same as `$ doom env`),
5. Installs any dependencies of enabled modules (specified by `$DOOMDIR'/init.el), 5. Installs any dependencies of enabled modules (specified by `$DOOMDIR'/init.el),
6. And prompts to install all-the-icons' fonts 6. And prompts to install nerd-icons' fonts
This command is idempotent and safe to reuse. This command is idempotent and safe to reuse.
@ -110,22 +110,6 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g.
('user-error ('user-error
(print! (warn "%s") (error-message-string e)))))) (print! (warn "%s") (error-message-string e))))))
(cond ((eq fonts? :no))
(IS-WINDOWS
(print! (warn "Doom cannot install all-the-icons' fonts on Windows!\n"))
(print-group!
(print!
(concat "You'll have to do so manually:\n\n"
" 1. Launch Doom Emacs\n"
" 2. Execute 'M-x all-the-icons-install-fonts' to download the fonts\n"
" 3. Open the download location in windows explorer\n"
" 4. Open each font file to install them"))))
((or yes? (y-or-n-p "Download and install all-the-icon's fonts?"))
(require 'all-the-icons)
(let ((window-system (cond (IS-MAC 'ns)
(IS-LINUX 'x))))
(all-the-icons-install-fonts 'yes))))
(when (file-exists-p "~/.emacs") (when (file-exists-p "~/.emacs")
(print! (warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!"))) (print! (warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!")))

View file

@ -652,6 +652,7 @@ If ELPA-P, include packages installed with package.el (M-x package-install)."
(doom-initialize-packages) (doom-initialize-packages)
(doom-packages--barf-if-incomplete) (doom-packages--barf-if-incomplete)
(print! (start "Purging orphaned packages (for the emperor)...")) (print! (start "Purging orphaned packages (for the emperor)..."))
(quiet! (straight-prune-build-cache))
(cl-destructuring-bind (&optional builds-to-purge repos-to-purge repos-to-regraft) (cl-destructuring-bind (&optional builds-to-purge repos-to-purge repos-to-regraft)
(let ((rdirs (let ((rdirs
(and (or repos-p regraft-repos-p) (and (or repos-p regraft-repos-p)
@ -672,8 +673,7 @@ If ELPA-P, include packages installed with package.el (M-x package-install)."
nil (list nil (list
(if (not builds-p) (if (not builds-p)
(ignore (print! (item "Skipping builds"))) (ignore (print! (item "Skipping builds")))
(and (/= 0 (doom-packages--purge-builds builds-to-purge)) (/= 0 (doom-packages--purge-builds builds-to-purge)))
(quiet! (straight-prune-build-cache))))
(if (not elpa-p) (if (not elpa-p)
(ignore (print! (item "Skipping elpa packages"))) (ignore (print! (item "Skipping elpa packages")))
(/= 0 (doom-packages--purge-elpa))) (/= 0 (doom-packages--purge-elpa)))

View file

@ -130,7 +130,8 @@ or file path may exist now."
(let ((buffer (or (buffer-base-buffer) (current-buffer)))) (let ((buffer (or (buffer-base-buffer) (current-buffer))))
(and (buffer-file-name buffer) (and (buffer-file-name buffer)
(eq buffer (window-buffer (selected-window))) ; only visible buffers (eq buffer (window-buffer (selected-window))) ; only visible buffers
(set-auto-mode)))))) (set-auto-mode)
(not (eq major-mode 'fundamental-mode)))))))
(defadvice! doom--shut-up-autosave-a (fn &rest args) (defadvice! doom--shut-up-autosave-a (fn &rest args)
"If a file has autosaved data, `after-find-file' will pause for 1 second to "If a file has autosaved data, `after-find-file' will pause for 1 second to
@ -583,11 +584,9 @@ current buffer."
filename)) filename))
(prog1 (apply fn args) (prog1 (apply fn args)
(when (buffer-live-p buf) (when (buffer-live-p buf)
(with-current-buffer buf (goto-char pos))))))))) (with-current-buffer buf (goto-char pos))))))))
:config
(setq helpful-set-variable-function #'setq!))
;;;###package imenu
(add-hook 'imenu-after-jump-hook #'recenter)
(use-package! smartparens (use-package! smartparens

View file

@ -98,19 +98,20 @@ all hooks after it are ignored.")
(defun doom/escape (&optional interactive) (defun doom/escape (&optional interactive)
"Run `doom-escape-hook'." "Run `doom-escape-hook'."
(interactive (list 'interactive)) (interactive (list 'interactive))
(cond ((minibuffer-window-active-p (minibuffer-window)) (let ((inhibit-quit t))
;; quit the minibuffer if open. (cond ((minibuffer-window-active-p (minibuffer-window))
(when interactive ;; quit the minibuffer if open.
(setq this-command 'abort-recursive-edit))
(abort-recursive-edit))
;; Run all escape hooks. If any returns non-nil, then stop there.
((run-hook-with-args-until-success 'doom-escape-hook))
;; don't abort macros
((or defining-kbd-macro executing-kbd-macro) nil)
;; Back to the default
((unwind-protect (keyboard-quit)
(when interactive (when interactive
(setq this-command 'keyboard-quit)))))) (setq this-command 'abort-recursive-edit))
(abort-recursive-edit))
;; Run all escape hooks. If any returns non-nil, then stop there.
((run-hook-with-args-until-success 'doom-escape-hook))
;; don't abort macros
((or defining-kbd-macro executing-kbd-macro) nil)
;; Back to the default
((unwind-protect (keyboard-quit)
(when interactive
(setq this-command 'keyboard-quit)))))))
(global-set-key [remap keyboard-quit] #'doom/escape) (global-set-key [remap keyboard-quit] #'doom/escape)

View file

@ -119,11 +119,11 @@ uses a straight or package.el command directly).")
(append (apply fn args) ; lockfiles still take priority (append (apply fn args) ; lockfiles still take priority
(doom-package-pinned-list))) (doom-package-pinned-list)))
;; HACK: This fixes an issue present in recent builds of Emacs 29. See ;; HACK: This fixes an issue introduced in emacs-mirror/emacs@0d383b592c2f and
;; emacs-mirror/emacs@0d383b592c2f. Straight.el uses `loaddefs-generate' if it ;; is present in >=29: Straight.el uses `loaddefs-generate' if it is
;; is available, which activates `emacs-lisp-mode' to read autoloads files, ;; available, which activates `emacs-lisp-mode' to read autoloads files, but
;; but does so without suppressing its hooks. Some packages (like overseer) ;; does so without suppressing its hooks. Some packages (like overseer) add
;; add hooks to `emacs-lisp-mode-hook' in their autoloads, and once triggered, ;; hooks to `emacs-lisp-mode-hook' in their autoloads, and once triggered,
;; they will try to load their dependencies (like dash or pkg-info), causing ;; they will try to load their dependencies (like dash or pkg-info), causing
;; file errors. ;; file errors.
;; REVIEW: Report this upstream. ;; REVIEW: Report this upstream.

View file

@ -449,8 +449,8 @@ Defaults to the profile at `doom-profile-default'."
(defun doom-profile--generate-package-autoloads () (defun doom-profile--generate-package-autoloads ()
(doom-autoloads--scan (doom-autoloads--scan
(mapcar #'straight--autoloads-file (mapcar #'straight--autoloads-file
(seq-difference (hash-table-keys straight--build-cache) (nreverse (seq-difference (hash-table-keys straight--build-cache)
doom-autoloads-excluded-packages)) doom-autoloads-excluded-packages)))
doom-autoloads-excluded-files doom-autoloads-excluded-files
'literal)) 'literal))

View file

@ -5,13 +5,13 @@
;; ;;
;;; Variables ;;; Variables
(defvar doom-theme nil (defcustom doom-theme nil
"A symbol representing the Emacs theme to load at startup. "A symbol representing the Emacs theme to load at startup.
Set to `nil' to load no theme at all. This variable is changed by Set to `nil' to load no theme at all. This variable is changed by
`load-theme'.") `load-theme'.")
(defvar doom-font nil (defcustom doom-font nil
"The default font to use. "The default font to use.
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. Must be a `font-spec', a font object, an XFT font string, or an XLFD string.
@ -22,60 +22,72 @@ Examples:
(setq doom-font \"Terminus (TTF):pixelsize=12:antialias=off\") (setq doom-font \"Terminus (TTF):pixelsize=12:antialias=off\")
(setq doom-font \"Fira Code-14\")") (setq doom-font \"Fira Code-14\")")
(defvar doom-variable-pitch-font nil (defcustom doom-variable-pitch-font nil
"The default font to use for variable-pitch text. "The default font to use for variable-pitch text.
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
`doom-font' for examples. `doom-font' for examples.
An omitted font size means to inherit `doom-font''s size.") An omitted font size means to inherit `doom-font''s size.")
(defvar doom-serif-font nil (defcustom doom-serif-font nil
"The default font to use for the `fixed-pitch-serif' face. "The default font to use for the `fixed-pitch-serif' face.
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
`doom-font' for examples. `doom-font' for examples.
An omitted font size means to inherit `doom-font''s size.") An omitted font size means to inherit `doom-font''s size.")
(defvar doom-unicode-font nil (defcustom doom-symbol-font nil
"Fallback font for Unicode glyphs. "Fallback font for symbols.
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
`doom-font' for examples. `doom-font' for examples. Emacs defaults to Symbola.
The defaults on macOS and Linux are Apple Color Emoji and Symbola, respectively.
WARNING: if you specify a size for this font it will hard-lock any usage of this WARNING: if you specify a size for this font it will hard-lock any usage of this
font to that size. It's rarely a good idea to do so!") font to that size. It's rarely a good idea to do so!")
(defvar doom-emoji-fallback-font-families (define-obsolete-variable-alias 'doom-unicode-font 'doom-symbol-font "3.0.0")
(defcustom doom-emoji-font nil
"Fallback font for emoji.
Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See
`doom-font' for examples.
WARNING: if you specify a size for this font it will hard-lock any usage of this
font to that size. It's rarely a good idea to do so!")
(defconst doom-emoji-fallback-font-families
'("Apple Color Emoji" '("Apple Color Emoji"
"Segoe UI Emoji" "Segoe UI Emoji"
"Noto Color Emoji" "Noto Color Emoji"
"Noto Emoji") "Noto Emoji")
"A list of fallback font families to use for emojis.") "A list of fallback font families to use for emojis.
These are platform-specific fallbacks for internal use. If you
want to change your emoji font, use `doom-emoji-font'.")
(defvar doom-symbol-fallback-font-families (defconst doom-symbol-fallback-font-families
'("Segoe UI Symbol" '("Segoe UI Symbol"
"Apple Symbols") "Apple Symbols")
"A list of fallback font families for general symbol glyphs.") "A list of fallback font families for general symbol glyphs.
These are platform-specific fallbacks for internal use. If you
want to change your symbol font, use `doom-symbol-font'.")
;; ;;
;;; Custom hooks ;;; Custom hooks
(defvar doom-init-ui-hook nil (defcustom doom-init-ui-hook nil
"List of hooks to run when the UI has been initialized.") "List of hooks to run when the UI has been initialized.")
(defvar doom-load-theme-hook nil (defcustom doom-load-theme-hook nil
"Hook run after the theme is loaded with `load-theme' or reloaded with "Hook run after the theme is loaded with `load-theme' or reloaded with
`doom/reload-theme'.") `doom/reload-theme'.")
(defvar doom-switch-buffer-hook nil (defcustom doom-switch-buffer-hook nil
"A list of hooks run after changing the current buffer.") "A list of hooks run after changing the current buffer.")
(defvar doom-switch-window-hook nil (defcustom doom-switch-window-hook nil
"A list of hooks run after changing the focused windows.") "A list of hooks run after changing the focused windows.")
(defvar doom-switch-frame-hook nil (defcustom doom-switch-frame-hook nil
"A list of hooks run after changing the focused frame.") "A list of hooks run after changing the focused frame.")
(defun doom-run-switch-buffer-hooks-h (&optional _) (defun doom-run-switch-buffer-hooks-h (&optional _)
@ -156,8 +168,10 @@ or if the current buffer is read-only or not file-visiting."
;; cursor more than N lines past window edges (where N is the settings of ;; cursor more than N lines past window edges (where N is the settings of
;; `scroll-conservatively'). This is especially slow in larger files ;; `scroll-conservatively'). This is especially slow in larger files
;; during large-scale scrolling commands. If kept over 100, the window is ;; during large-scale scrolling commands. If kept over 100, the window is
;; never automatically recentered. ;; never automatically recentered. The default (0) triggers this too
scroll-conservatively 101 ;; aggressively, so I've set it to 10 to recenter if scrolling too far
;; off-screen.
scroll-conservatively 10
scroll-margin 0 scroll-margin 0
scroll-preserve-screen-position t scroll-preserve-screen-position t
;; Reduce cursor lag by a tiny bit by not auto-adjusting `window-vscroll' ;; Reduce cursor lag by a tiny bit by not auto-adjusting `window-vscroll'
@ -314,9 +328,10 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(setq compilation-always-kill t ; kill compilation process before starting another (setq compilation-always-kill t ; kill compilation process before starting another
compilation-ask-about-save nil ; save all buffers on `compile' compilation-ask-about-save nil ; save all buffers on `compile'
compilation-scroll-output 'first-error) compilation-scroll-output 'first-error)
;; Handle ansi codes in compilation buffer (add-hook 'compilation-filter-hook
;; DEPRECATED Use `ansi-color-compilation-filter' when dropping 27.x support (if (< emacs-major-version 28)
(add-hook 'compilation-filter-hook #'doom-apply-ansi-color-to-compilation-buffer-h) #'doom-apply-ansi-color-to-compilation-buffer-h
#'ansi-color-compilation-filter))
;; Automatically truncate compilation buffers so they don't accumulate too ;; Automatically truncate compilation buffers so they don't accumulate too
;; much data and bog down the rest of Emacs. ;; much data and bog down the rest of Emacs.
(autoload 'comint-truncate-buffer "comint" nil t) (autoload 'comint-truncate-buffer "comint" nil t)
@ -417,41 +432,17 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
;; ;;
;;; Third party packages ;;; Third party packages
(use-package! all-the-icons (use-package! nerd-icons
:commands (all-the-icons-octicon :commands (nerd-icons-octicon
all-the-icons-faicon nerd-icons-faicon
all-the-icons-fileicon nerd-icons-flicon
all-the-icons-wicon nerd-icons-wicon
all-the-icons-material nerd-icons-mdicon
all-the-icons-alltheicon) nerd-icons-codicon
:preface nerd-icons-devicon
(add-hook! 'after-setting-font-hook nerd-icons-ipsicon
(defun doom-init-all-the-icons-fonts-h () nerd-icons-pomicon
(when (fboundp 'set-fontset-font) nerd-icons-powerline))
(dolist (font (list "Weather Icons"
"github-octicons"
"FontAwesome"
"all-the-icons"
"file-icons"
"Material Icons"))
(set-fontset-font t 'unicode font nil 'append)))))
:config
(cond ((daemonp)
(defadvice! doom--disable-all-the-icons-in-tty-a (fn &rest args)
"Return a blank string in tty Emacs, which doesn't support multiple fonts."
:around '(all-the-icons-octicon all-the-icons-material
all-the-icons-faicon all-the-icons-fileicon
all-the-icons-wicon all-the-icons-alltheicon)
(if (or (not after-init-time) (display-multi-font-p))
(apply fn args)
"")))
((not (display-graphic-p))
(defadvice! doom--disable-all-the-icons-in-tty-a (&rest _)
"Return a blank string for tty users."
:override '(all-the-icons-octicon all-the-icons-material
all-the-icons-faicon all-the-icons-fileicon
all-the-icons-wicon all-the-icons-alltheicon)
""))))
;; Hide the mode line in completion popups and MAN pages because they serve ;; Hide the mode line in completion popups and MAN pages because they serve
;; little purpose there, and is better hidden. ;; little purpose there, and is better hidden.
@ -546,13 +537,24 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(custom-push-theme 'theme-face face 'user 'set new-specs) (custom-push-theme 'theme-face face 'user 'set new-specs)
(put face 'face-modified nil)))) (put face 'face-modified nil))))
(when (fboundp 'set-fontset-font) (when (fboundp 'set-fontset-font)
(let ((fn (doom-rpartial #'member (font-family-list)))) (let* ((fn (doom-rpartial #'member (font-family-list)))
(when-let (font (cl-find-if fn doom-symbol-fallback-font-families)) (symbol-font (or doom-symbol-font
(set-fontset-font t 'symbol font)) (cl-find-if fn doom-symbol-fallback-font-families)))
(when-let (font (cl-find-if fn doom-emoji-fallback-font-families)) (emoji-font (or doom-emoji-font
(set-fontset-font t 'unicode font)) (cl-find-if fn doom-emoji-fallback-font-families))))
(when doom-unicode-font (when symbol-font
(set-fontset-font t 'unicode doom-unicode-font)))) (dolist (script '(symbol mathematical))
(set-fontset-font t script symbol-font)))
(when emoji-font
;; DEPRECATED: make unconditional when we drop 27 support
(when (version<= "28.1" emacs-version)
(set-fontset-font t 'emoji emoji-font))
;; some characters in the Emacs symbol script are often covered by emoji
;; fonts
(set-fontset-font t 'symbol emoji-font nil 'append)))
;; Nerd Fonts use these Private Use Areas
(dolist (range '((#xe000 . #xf8ff) (#xf0000 . #xfffff)))
(set-fontset-font t range "Symbols Nerd Font Mono")))
;; Users should inject their own font logic in `after-setting-font-hook' ;; Users should inject their own font logic in `after-setting-font-hook'
(run-hooks 'after-setting-font-hook)) (run-hooks 'after-setting-font-hook))

View file

@ -119,9 +119,9 @@
(let ((inhibit-changing-match-data t)) (let ((inhibit-changing-match-data t))
(if (string-match "HARFBUZZ" system-configuration-features) ; no alternative (if (string-match "HARFBUZZ" system-configuration-features) ; no alternative
(push 'harfbuzz features))) (push 'harfbuzz features)))
;; `native-compile' exists whether or not it is functional (e.g. libgcc is ;; The `native-compile' feature exists whether or not it is functional (e.g.
;; available or not). This seems silly, so pretend it doesn't exist if it ;; libgcc is available or not). This seems silly, so pretend it doesn't exist if
;; isn't available. ;; it isn't functional.
(if (featurep 'native-compile) (if (featurep 'native-compile)
(if (not (native-comp-available-p)) (if (not (native-comp-available-p))
(delq 'native-compile features))) (delq 'native-compile features)))
@ -168,7 +168,7 @@
"Current version of Doom Emacs core.") "Current version of Doom Emacs core.")
;; DEPRECATED: Remove these when the modules are moved out of core. ;; DEPRECATED: Remove these when the modules are moved out of core.
(defconst doom-modules-version "23.08.0-pre" (defconst doom-modules-version "23.12.0-pre"
"Current version of Doom Emacs.") "Current version of Doom Emacs.")
(defvar doom-init-time nil (defvar doom-init-time nil
@ -607,7 +607,15 @@ Otherwise, `en/disable-command' (in novice.el.gz) is hardcoded to write them to
(and (null comp-num-cpus) (and (null comp-num-cpus)
(zerop native-comp-async-jobs-number) (zerop native-comp-async-jobs-number)
(setq comp-num-cpus (setq comp-num-cpus
(max 1 (/ (num-processors) (if noninteractive 1 4))))))) (max 1 (/ (num-processors) (if noninteractive 1 4))))))
(define-advice comp-run-async-workers (:around (fn &rest args) dont-litter-tmpdir)
"Normally, native-comp writes a ton to /tmp. This advice forces it to write
to `doom-cache-dir'/comp/ instead, so that Doom can safely clean it up as part
of 'doom sync' or 'doom gc'."
(let ((temporary-file-directory (expand-file-name "comp/" doom-profile-cache-dir)))
(make-directory temporary-file-directory t)
(apply fn args))))
;;; Suppress package.el ;;; Suppress package.el
;; Since Emacs 27, package initialization occurs before `user-init-file' is ;; Since Emacs 27, package initialization occurs before `user-init-file' is
@ -689,6 +697,16 @@ appropriately against `noninteractive' or the `cli' context."
;; ;;
;;; Last minute initialization ;;; Last minute initialization
(when (daemonp)
(message "Starting Doom Emacs in daemon mode!")
(unless doom-inhibit-log
(add-hook! 'doom-after-init-hook :depth 106
(unless doom-inhibit-log
(setq doom-inhibit-log (not (or noninteractive init-file-debug))))
(message "Disabling verbose mode. Have fun!"))
(add-hook! 'kill-emacs-hook :depth 110
(message "Killing Emacs. Sayonara!"))))
(add-hook! 'doom-before-init-hook :depth -105 (add-hook! 'doom-before-init-hook :depth -105
(defun doom--begin-init-h () (defun doom--begin-init-h ()
"Begin the startup process." "Begin the startup process."

View file

@ -19,24 +19,24 @@
(defvar doom-docs-header-specs (defvar doom-docs-header-specs
'(("/docs/index\\.org$" '(("/docs/index\\.org$"
(:label "FAQ" (:label "FAQ"
:icon "question_answer" :icon "nf-md-message_question_outline"
:link "doom-faq:" :link "doom-faq:"
:help-echo "Open the FAQ document")) :help-echo "Open the FAQ document"))
(("/docs/[^/]+\\.org$" "/modules/README\\.org$") (("/docs/[^/]+\\.org$" "/modules/README\\.org$")
(:label "Back to index" (:label "Back to index"
:icon "arrow_back" :icon "nf-md-arrow_left"
:link ("doom-index" . "") :link "doom-index"
:help-echo "Navigate to the root index")) :help-echo "Navigate to the root index"))
("/modules/[^/]+/README\\.org$" ("/modules/[^/]+/README\\.org$"
(:label "Back to module index" (:label "Back to module index"
:icon "arrow_back" :icon "nf-md-arrow_left"
:link "doom-module-index:")) :link "doom-module-index:"))
("/modules/[^/]+/[^/]+/README\\.org$" ("/modules/[^/]+/[^/]+/README\\.org$"
(:label "Back to module index" (:label "Back to module index"
:icon "arrow_back" :icon "nf-md-arrow_left"
:link "doom-module-index:") :link "doom-module-index:")
(:label "History" (:label "History"
:icon "history" :icon "nf-md-history"
:icon-face font-lock-variable-name-face :icon-face font-lock-variable-name-face
:link (lambda () :link (lambda ()
(cl-destructuring-bind (category . module) (doom-module-from-path (buffer-file-name)) (cl-destructuring-bind (category . module) (doom-module-from-path (buffer-file-name))
@ -44,7 +44,7 @@
:help-echo "View the module history" :help-echo "View the module history"
:align right) :align right)
(:label "Issues" (:label "Issues"
:icon "error_outline" :icon "nf-md-flag"
:icon-face error :icon-face error
:link (lambda () :link (lambda ()
(cl-destructuring-bind (category . module) (doom-module-from-path (buffer-file-name)) (cl-destructuring-bind (category . module) (doom-module-from-path (buffer-file-name))
@ -52,12 +52,12 @@
:align right)) :align right))
(t (t
(:label "Suggest edits" (:label "Suggest edits"
:icon "edit" :icon "nf-md-account_edit"
:icon-face warning :icon-face warning
:link "doom-suggest-edit" :link "doom-suggest-edit"
:align right) :align right)
(:label "Help" (:label "Help"
:icon "help_outline" :icon "nf-md-timeline_help_outline"
:icon-face font-lock-function-name-face :icon-face font-lock-function-name-face
:link (lambda () :link (lambda ()
(let ((title (cadar (org-collect-keywords '("TITLE"))))) (let ((title (cadar (org-collect-keywords '("TITLE")))))
@ -101,9 +101,10 @@
(defun doom-docs--make-header-link (spec) (defun doom-docs--make-header-link (spec)
"Create a header link according to SPEC." "Create a header link according to SPEC."
(let ((icon (and (plist-get spec :icon) (let ((icon (and (plist-get spec :icon)
(funcall (or (plist-get spec :icon-function) (with-demoted-errors "DOCS ERROR: %s"
#'all-the-icons-material) (funcall (or (plist-get spec :icon-function)
(plist-get spec :icon)))) #'nerd-icons-mdicon)
(plist-get spec :icon)))))
(label (pcase (plist-get spec :label) (label (pcase (plist-get spec :label)
((and (pred functionp) lab) ((and (pred functionp) lab)
(funcall lab)) (funcall lab))
@ -239,11 +240,9 @@
(beg (max (point-min) (1- (org-element-property :begin el)))) (beg (max (point-min) (1- (org-element-property :begin el))))
(end (org-element-property :end el)) (end (org-element-property :end el))
((memq (org-element-type el) '(drawer property-drawer)))) ((memq (org-element-type el) '(drawer property-drawer))))
(when (org-current-level) (when (org-element-property-inherited :level el)
(cl-decf end)) (cl-decf end))
(org-fold-core-region beg end doom-docs-mode 'doom-doc-hidden) (org-fold-core-region beg end doom-docs-mode 'doom-doc-hidden))))
(when doom-docs-mode
(org-fold-core-region beg end nil 'org-hide-drawer)))))
;; FIX: If the cursor remains within a newly folded region, that folk will ;; FIX: If the cursor remains within a newly folded region, that folk will
;; come undone, so we move it. ;; come undone, so we move it.
(if pt (goto-char pt)))) (if pt (goto-char pt))))
@ -373,7 +372,7 @@ depending.")
(defvar doom-docs--cookies nil) (defvar doom-docs--cookies nil)
;;;###autoload ;;;###autoload
(define-minor-mode doom-docs-mode (define-minor-mode doom-docs-mode
"Hides metadata, tags, & drawers and activates all org-mode pretiffications. "Hides metadata, tags, & drawers and activates all org-mode prettifications.
This primes `org-mode' for reading." This primes `org-mode' for reading."
:lighter " Doom Docs" :lighter " Doom Docs"
:after-hook (org-restart-font-lock) :after-hook (org-restart-font-lock)
@ -387,7 +386,7 @@ This primes `org-mode' for reading."
(if doom-docs-mode (if doom-docs-mode
(set (make-local-variable sym) t) (set (make-local-variable sym) t)
(kill-local-variable sym))) (kill-local-variable sym)))
`(org-pretty-entities '(org-pretty-entities
org-hide-emphasis-markers org-hide-emphasis-markers
org-hide-macro-markers)) org-hide-macro-markers))
(when doom-docs-mode (when doom-docs-mode
@ -428,13 +427,13 @@ This primes `org-mode' for reading."
(defvar doom-docs--id-locations nil) (defvar doom-docs--id-locations nil)
(defvar doom-docs--id-files nil) (defvar doom-docs--id-files nil)
(defvar doom-docs--id-location-file (file-name-concat doom-cache-dir "doom-docs-org-ids"))
;;;###autoload ;;;###autoload
(defun doom/reload-docs (&optional force) (defun doom/reload-docs (&optional force)
"Reload the ID locations in Doom's documentation and open docs buffers." "Reload the ID locations in Doom's documentation and open docs buffers."
(interactive (list 'interactive)) (interactive (list 'interactive))
(with-temp-buffer (with-temp-buffer
(let ((org-id-locations-file (let ((org-id-locations-file doom-docs--id-location-file)
(doom-path (file-truename doom-cache-dir) "doom-docs-org-ids"))
(org-id-track-globally t) (org-id-track-globally t)
org-agenda-files org-agenda-files
org-id-extra-files org-id-extra-files
@ -465,14 +464,26 @@ This primes `org-mode' for reading."
(let ((org-id-link-to-org-use-id t) (let ((org-id-link-to-org-use-id t)
(org-id-method 'uuid) (org-id-method 'uuid)
(org-id-track-globally t) (org-id-track-globally t)
(org-id-locations-file (doom-path doom-cache-dir "doom-docs-org-ids")) (org-id-locations-file doom-docs--id-location-file)
(org-id-locations doom-docs--id-locations) (org-id-locations doom-docs--id-locations)
(org-id-files doom-docs--id-files)) (org-id-files doom-docs--id-files))
(doom/reload-docs) (doom/reload-docs)
(let ((id (org-id-new))) (when-let (fname (buffer-file-name (buffer-base-buffer)))
(org-id-add-location (let ((id (org-id-new)))
id (buffer-file-name (buffer-base-buffer))) (org-id-add-location id fname)
id))) id))))
(defconst doom-docs-org-font-lock-keywords
'(("^\\( *\\)#\\+begin_quote\n\\1 \\([󰝗󱌣󰐃󰔓󰟶󰥔]\\) "
2 (pcase (match-string 2)
("󰝗" 'font-lock-comment-face)
("󱌣" 'font-lock-comment-face)
("󰐃" 'error)
("󰔓" 'success)
("󰟶" 'font-lock-keyword-face)
("󰥔" 'font-lock-constant-face)
("" 'warning))))
"Extra font-lock keywords for Doom documentation.")
;;;###autoload ;;;###autoload
(define-derived-mode doom-docs-org-mode org-mode "Doom Docs" (define-derived-mode doom-docs-org-mode org-mode "Doom Docs"
@ -481,6 +492,7 @@ This primes `org-mode' for reading."
Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when
`read-only-mode' is activated." `read-only-mode' is activated."
:after-hook (visual-line-mode -1) :after-hook (visual-line-mode -1)
(font-lock-add-keywords nil doom-docs-org-font-lock-keywords)
(let ((gc-cons-threshold most-positive-fixnum) (let ((gc-cons-threshold most-positive-fixnum)
(gc-cons-percentage 1.0)) (gc-cons-percentage 1.0))
(require 'org-id) (require 'org-id)
@ -488,7 +500,7 @@ Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when
(setq-local org-id-link-to-org-use-id t (setq-local org-id-link-to-org-use-id t
org-id-method 'uuid org-id-method 'uuid
org-id-track-globally t org-id-track-globally t
org-id-locations-file (doom-path doom-cache-dir "doom-docs-org-ids") org-id-locations-file doom-docs--id-location-file
org-id-locations doom-docs--id-locations org-id-locations doom-docs--id-locations
org-id-files doom-docs--id-files org-id-files doom-docs--id-files
org-num-max-level 3 org-num-max-level 3

View file

@ -168,7 +168,8 @@ selection of all minor-modes, active or not."
(location (location
(goto-char location))) (goto-char location)))
(ignore-errors (ignore-errors
(when (outline-invisible-p) (when (memq (get-char-property (point) 'invisible)
'(outline org-fold-outline))
(save-excursion (save-excursion
(outline-previous-visible-heading 1) (outline-previous-visible-heading 1)
(org-show-subtree)))))) (org-show-subtree))))))
@ -575,7 +576,10 @@ If prefix arg is present, refresh the cache."
(pp-to-string recipe)))) (pp-to-string recipe))))
(package--print-help-section "Homepage") (package--print-help-section "Homepage")
(doom--help-insert-button (doom-package-homepage package))) (let ((homepage (doom-package-homepage package)))
(if homepage
(doom--help-insert-button homepage)
(insert "n/a"))))
(`elpa (insert "[M]ELPA ") (`elpa (insert "[M]ELPA ")
(doom--help-insert-button (doom-package-homepage package)) (doom--help-insert-button (doom-package-homepage package))

View file

@ -239,13 +239,14 @@ Must be run from a magit diff buffer."
(unless (= (length before) (length after)) (unless (= (length before) (length after))
(user-error "Uneven number of packages being bumped")) (user-error "Uneven number of packages being bumped"))
(dolist (p1 before) (dolist (p1 before)
(cl-destructuring-bind (package &key plist _beg _end &allow-other-keys) p1 (when (and (listp p1) (eq (car p1) 'package!))
(let ((p2 (cdr (assq package after)))) (cl-destructuring-bind (package &key plist _beg _end &allow-other-keys) p1
(if (null p2) (let ((p2 (cdr (assq package after))))
(push package errors) (if (null p2)
(let ((bstr1 (doom--package-to-bump-string package plist)) (push package errors)
(bstr2 (doom--package-to-bump-string package (plist-get p2 :plist)))) (let ((bstr1 (doom--package-to-bump-string package plist))
(cl-pushnew (format "%s -> %s" bstr1 bstr2) lines :test #'equal)))))) (bstr2 (doom--package-to-bump-string package (plist-get p2 :plist))))
(cl-pushnew (format "%s -> %s" bstr1 bstr2) lines :test #'equal)))))))
(if (null lines) (if (null lines)
(user-error "No bumps to bumpify") (user-error "No bumps to bumpify")
(prog1 (funcall (if interactive #'kill-new #'identity) (prog1 (funcall (if interactive #'kill-new #'identity)

View file

@ -52,8 +52,8 @@
(with-memoization (get 'doom-system-distro-icon 'cached-value) (with-memoization (get 'doom-system-distro-icon 'cached-value)
(propertize (propertize
(pcase (doom-system-distro) (pcase (doom-system-distro)
(`windows (all-the-icons-faicon "windows")) (`windows (nerd-icons-faicon "nf-fa-windows"))
(`macos (all-the-icons-faicon "apple")) (`macos (nerd-icons-faicon "nf-fa-apple"))
(`arch "\uF303") (`arch "\uF303")
(`debian "\uF306") (`debian "\uF306")
(`raspbian "\uF315") (`raspbian "\uF315")
@ -74,7 +74,7 @@
(`devuan "\uF307") (`devuan "\uF307")
(`manjaro "\uF312") (`manjaro "\uF312")
((or `void `artix) "\uF17c") ((or `void `artix) "\uF17c")
(_ (all-the-icons-faicon "linux"))) (_ (nerd-icons-faicon "nf-fa-linux")))
'face '(:height 1) 'face '(:height 1)
'display '(raise 0)))) 'display '(raise 0))))

View file

@ -177,9 +177,13 @@ Use `winner-undo' to undo this. Alternatively, use
OPACITY is an integer between 0 to 100, inclusive." OPACITY is an integer between 0 to 100, inclusive."
(interactive (interactive
(list (read-number "Opacity (0-100): " (list (read-number "Opacity (0-100): "
(or (frame-parameter nil 'alpha) (or (frame-parameter
nil (if (> emacs-major-version 28)
'alpha-background 'alpha))
100)))) 100))))
(set-frame-parameter nil 'alpha opacity)) (set-frame-parameter nil (if (> emacs-major-version 28)
'alpha-background 'alpha)
opacity))
(defvar doom--narrowed-base-buffer nil) (defvar doom--narrowed-base-buffer nil)
;;;###autoload ;;;###autoload

View file

@ -17,21 +17,22 @@
:branch ,straight-repository-branch :branch ,straight-repository-branch
:local-repo "straight.el" :local-repo "straight.el"
:files ("straight*.el")) :files ("straight*.el"))
:pin "5e84c4e2cd8ca79560477782ee4c9e5187725def") :pin "b3760f5829dba37e855add7323304561eb57a3d4")
;; doom-ui.el ;; doom-ui.el
(package! all-the-icons :pin "f491f39c21336d354e85bdb4cca281e0a0c2f880") (package! all-the-icons :pin "be9d5dcda9c892e8ca1535e288620eec075eb0be")
(package! nerd-icons :pin "e109d09b95706bb93c821b1229ca09cf00195690")
(package! hide-mode-line :pin "bc5d293576c5e08c29e694078b96a5ed85631942") (package! hide-mode-line :pin "bc5d293576c5e08c29e694078b96a5ed85631942")
(package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307") (package! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307")
(package! rainbow-delimiters :pin "a32b39bdfe6c61c322c37226d66e1b6d4f107ed0") (package! rainbow-delimiters :pin "f40ece58df8b2f0fb6c8576b527755a552a5e763")
(package! restart-emacs :pin "1607da2bc657fe05ae01f7fdf26f716eafead02c") (package! restart-emacs :pin "1607da2bc657fe05ae01f7fdf26f716eafead02c")
;; doom-editor.el ;; doom-editor.el
(package! better-jumper :pin "47622213783ece37d5337dc28d33b530540fc319") (package! better-jumper :pin "47622213783ece37d5337dc28d33b530540fc319")
(package! dtrt-indent :pin "be07f4979a5b402a0cf5311c86c30b89ca0e1ee4") (package! dtrt-indent :pin "e0630f74f915c6cded05f76f66d66e540fcc37c3")
(package! helpful :pin "c57ff0d284b50ff430fe1f13fd48deaa0d1a910e") (package! helpful :pin "a32a5b3d959a7fccf09a71d97b3d7c888ac31c69")
(package! pcre2el :pin "b941ed8a96299868171fac625ecffec77de3e986") (package! pcre2el :pin "018531ba0cf8e2b28d1108136a0e031b6a45f1c1")
(package! smartparens :pin "79a338db115f441cd47bb91e6f75816c5e78a772") (package! smartparens :pin "0778a8a84064cf2bc3a9857bd0e7a4619cc1e5c3")
(package! ws-butler (package! ws-butler
;; Use my fork of ws-butler, which has a few choice improvements and ;; Use my fork of ws-butler, which has a few choice improvements and
;; optimizations (the original has been abandoned). ;; optimizations (the original has been abandoned).
@ -39,13 +40,13 @@
:pin "572a10c11b6cb88293de48acbb59a059d36f9ba5") :pin "572a10c11b6cb88293de48acbb59a059d36f9ba5")
;; doom-projects.el ;; doom-projects.el
(package! projectile :pin "971cd5c4f25ff1f84ab7e8337ffc7f89f67a1b52") (package! projectile :pin "9446ea92d28462aeb37846a8be0a0c97a7bc0cee")
(package! project :pin "6c41ad68edf1f44110abe478d17c36f57a517e66") (package! project :pin "f64bcf065c0731caecbdcff5ca1c7f2d711b5b1e")
;; doom-keybinds.el ;; doom-keybinds.el
(package! general :pin "833dea2c4a60e06fcd552b653dfc8960935c9fb4") (package! general :pin "833dea2c4a60e06fcd552b653dfc8960935c9fb4")
(package! which-key :pin "df6b0cb8449812e7fb200bc852107fa7eb708496") (package! which-key :pin "4d20bc852545a2e602f59084a630f888542052b1")
(package! compat (package! compat
:recipe (:host github :repo "emacs-compat/compat") :recipe (:host github :repo "emacs-compat/compat")
:pin "75d0b8527f51aae42d23eee4aeb263e19055747e") :pin "ea8de2ea18cf7c348aadb6eb2aeb2a9d840bd064")

View file

@ -330,7 +330,7 @@ Modules that turn Emacs in an email client.
This module makes Emacs an email client, using [[https://www.djcbsoftware.nl/code/mu/mu4e.html][mu4e]]. This module makes Emacs an email client, using [[https://www.djcbsoftware.nl/code/mu/mu4e.html][mu4e]].
- Tidied mu4e headers view, with flags from [[doom-package:all-the-icons]]. - Tidied mu4e headers view, with flags from [[doom-package:nerd-icons]].
- Consistent coloring of reply depths (across compose and gnus modes). - Consistent coloring of reply depths (across compose and gnus modes).
- Prettified =mu4e:main= view. - Prettified =mu4e:main= view.
- Cooperative locking of the =mu= process. Another Emacs instance may request - Cooperative locking of the =mu= process. Another Emacs instance may request
@ -1152,8 +1152,8 @@ you'd expect from IDEs, like code completion, realtime linting, language-aware
As of this writing, this is the state of LSP support in Doom Emacs: As of this writing, this is the state of LSP support in Doom Emacs:
| Module | Major modes | Default language server | | Module | Major modes | Default language server |
|------------------+---------------------------------------------------------+---------------------------------------------------------------| |----------------------------------+---------------------------------------------------------+---------------------------------------------------------------|
| [[doom-module::lang cc]] | c-mode, c++-mode, objc-mode | ccls, clangd | | [[doom-module::lang cc]] | c-mode, c++-mode, objc-mode | ccls, clangd |
| [[doom-module::lang clojure]] | clojure-mode | clojure-lsp | | [[doom-module::lang clojure]] | clojure-mode | clojure-lsp |
| [[doom-module::lang csharp]] | csharp-mode | omnisharp | | [[doom-module::lang csharp]] | csharp-mode | omnisharp |
@ -1417,12 +1417,12 @@ emacs fontset to cover as many unicode glyphs as possible by scanning all
available glyphs from all available fonts. available glyphs from all available fonts.
When this module is enabled: When this module is enabled:
- Emacs will prefer to use the ~doom-unicode-font~ font to display non-latin - Emacs will prefer to use the ~doom-symbol-font~ font to display non-latin
glyphs if it provides coverage for them. glyphs if it provides coverage for them.
- The first time you run Emacs a unicode cache will be generated -- this will - The first time you run Emacs a unicode cache will be generated -- this will
take a while! take a while!
- The cache will be regenerated every time Emacs is made aware of new fonts or - The cache will be regenerated every time Emacs is made aware of new fonts or
you change the font configuration e.g. by modifying ~doom-unicode-font~. you change the font configuration e.g. by modifying ~doom-symbol-font~.
- The cache will be stored and should not be regenerated unless font-related - The cache will be stored and should not be regenerated unless font-related
configuration or the versions of relevant packages changes. configuration or the versions of relevant packages changes.

View file

@ -34,12 +34,12 @@ This module requires:
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Changing calendar sources ** Changing calendar sources
@ -74,5 +74,5 @@ to link your calendar with Google calendars.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -34,7 +34,7 @@ These should be available through your OS package manager.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Keybinds ** Keybinds
@ -56,7 +56,7 @@ These should be available through your OS package manager.
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -70,5 +70,5 @@ Try [[kbd:][M-x +emms/mpd-restart-music-daemon]] then restart emacs.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -68,5 +68,5 @@ Most other behavior is implemented as hooks on ~emacs-everywhere-init-hooks~.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -20,7 +20,7 @@
(doom-modeline-spc) (doom-modeline-spc)
(when (emacs-everywhere-markdown-p) (when (emacs-everywhere-markdown-p)
(concat (concat
(all-the-icons-octicon "markdown" :face 'all-the-icons-green :v-adjust 0.02) (nerd-icons-octicon "nf-oct-markdown" :face 'nerd-icons-green :v-adjust 0.02)
(doom-modeline-spc))) (doom-modeline-spc)))
(propertize (emacs-everywhere-app-class emacs-everywhere-current-app) (propertize (emacs-everywhere-app-class emacs-everywhere-current-app)
'face 'doom-modeline-project-dir) 'face 'doom-modeline-project-dir)

View file

@ -52,7 +52,7 @@ environment.systemPackages = [ pkgs.gnutls ];
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
To connect to IRC use ~M-x =irc~. To connect to IRC use ~M-x =irc~.
@ -70,7 +70,7 @@ When in a circe buffer these keybindings will be available:
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
Use ~set-irc-server! SERVER PLIST~ to configure IRC servers. Its second argument Use ~set-irc-server! SERVER PLIST~ to configure IRC servers. Its second argument
@ -92,7 +92,7 @@ here are ways to avoid that:
** TODO Pass: the unix password manager ** TODO Pass: the unix password manager
#+begin_quote #+begin_quote
🔨 /This section is outdated and needs to be rewritten./ [[doom-contrib-module:][Rewrite it?]] 󱌣 /This section is outdated and needs to be rewritten./ [[doom-contrib-module:][Rewrite it?]]
#+end_quote #+end_quote
[[https://www.passwordstore.org/][Pass]] is my tool of choice. I use it to manage my passwords. If you activate the [[https://www.passwordstore.org/][Pass]] is my tool of choice. I use it to manage my passwords. If you activate the
@ -169,5 +169,5 @@ username: myusername
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -55,7 +55,8 @@ workspace for it."
circe-server-killed-confirmation) circe-server-killed-confirmation)
(when +irc--defer-timer (when +irc--defer-timer
(cancel-timer +irc--defer-timer)) (cancel-timer +irc--defer-timer))
(disable-circe-notifications) (when (fboundp #'disable-circe-notifications)
(disable-circe-notifications))
(mapc #'kill-buffer (doom-buffers-in-mode 'circe-mode (buffer-list) t)) (mapc #'kill-buffer (doom-buffers-in-mode 'circe-mode (buffer-list) t))
(when (modulep! :ui workspaces) (when (modulep! :ui workspaces)
(when (equal (+workspace-current-name) +irc--workspace-name) (when (equal (+workspace-current-name) +irc--workspace-name)

View file

@ -0,0 +1,5 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; app/irc/doctor.el
(when (memq 'circe-notifications doom-disabled-packages)
(warn! "Circe Notifications has been disabled, You will not receive desktop notifications from IRC channels."))

View file

@ -39,7 +39,7 @@ Read RSS feeds in the comfort of Emacs.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
- As there isn't currently binding for ~elfeed-update~ you can run it with ~M-x - As there isn't currently binding for ~elfeed-update~ you can run it with ~M-x
@ -47,7 +47,7 @@ Read RSS feeds in the comfort of Emacs.
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Without +org ** Without +org
@ -78,7 +78,7 @@ configure feeds to follow:
- You can "name" feeds as you please with ~org-mode~ ~org-insert-link~ ([[kbd:][C-c C-l]]) - You can "name" feeds as you please with ~org-mode~ ~org-insert-link~ ([[kbd:][C-c C-l]])
and put name as you want into ~description~. and put name as you want into ~description~.
- If you don't want to use ~org-directory/elfeed.org~ file you can specify it - If you don't want to use ~org-directory/elfeed.org~ file you can specify it
with ~(setq rmh-elfeed-org-files '("path/to/your/elfeed/file.org))~ with ~(setq rmh-elfeed-org-files '("path/to/your/elfeed/file.org"))~
** Keybindings ** Keybindings
+ General + General
@ -128,5 +128,5 @@ Hook ~elfeed-update~ to ~elfeed-search-mode-hook~:
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -14,8 +14,9 @@ easier to scroll through.")
(defvar +rss-workspace-name "*rss*" (defvar +rss-workspace-name "*rss*"
"Name of the workspace that contains the elfeed buffer.") "Name of the workspace that contains the elfeed buffer.")
;; ;;
;; Packages ;;; Packages
(use-package! elfeed (use-package! elfeed
:commands elfeed :commands elfeed
@ -83,6 +84,7 @@ easier to scroll through.")
(message "elfeed-org: ignoring %S because it can't be read" file)) (message "elfeed-org: ignoring %S because it can't be read" file))
(setq rmh-elfeed-org-files (cl-remove-if-not #'file-exists-p files)))))) (setq rmh-elfeed-org-files (cl-remove-if-not #'file-exists-p files))))))
(use-package! elfeed-goodies (use-package! elfeed-goodies
:after elfeed :after elfeed
:config :config

View file

@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; app/rss/packages.el ;;; app/rss/packages.el
(package! elfeed :pin "162d7d545ed41c27967d108c04aa31f5a61c8e16") (package! elfeed :pin "55fb162fa27e71b88effa59a83c57842e262b00f")
(package! elfeed-goodies :pin "544ef42ead011d960a0ad1c1d34df5d222461a6b") (package! elfeed-goodies :pin "544ef42ead011d960a0ad1c1d34df5d222461a6b")
(when (modulep! +org) (when (modulep! +org)
(package! elfeed-org :pin "3242ec0519800a58f20480c8a6e3b3337d137084")) (package! elfeed-org :pin "fe59a96969bd321f5f9ec7317a4bc80943b94c86"))

View file

@ -48,12 +48,12 @@ This module requires:
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Commands & Keybindings ** Commands & Keybindings
@ -96,6 +96,6 @@ key for evil users. To work around this issue you may use [[kbd:][M-SPC]] instea
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -41,7 +41,7 @@ will need to set ~langtool-language-tool-jar~ to its location.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Language Tool ** Language Tool
@ -49,7 +49,7 @@ will need to set ~langtool-language-tool-jar~ to its location.
stylistic issues in your writing. This requires Java 1.8+. stylistic issues in your writing. This requires Java 1.8+.
#+begin_quote #+begin_quote
🚧 This requires Java 1.8+ This requires Java 1.8+
#+end_quote #+end_quote
*** Commands *** Commands
@ -61,7 +61,7 @@ This minor mode highlights weasel words, duplication and passive voice.
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -72,5 +72,5 @@ This minor mode highlights weasel words, duplication and passive voice.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -1,5 +1,5 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; checkers/grammar/packages.el ;;; checkers/grammar/packages.el
(package! langtool :pin "8276eccc5587bc12fd205ee58a7a982f0a136e41") (package! langtool :pin "d86101eafe9a994eb0425e08e7c1795e9cb0cd42")
(package! writegood-mode :pin "ed42d918d98826ad88928b7af9f2597502afc6b0") (package! writegood-mode :pin "d54eadeedb8bf3aa0e0a584c0a7373c69644f4b8")

View file

@ -58,7 +58,7 @@ your system and in your =$PATH=. They also need dictionaries for your
language(s). language(s).
#+begin_quote #+begin_quote
🚧 If you *are not* using [[doom-module:+flyspell]], you will need =aspell= (and a dictionary) If you *are not* using [[doom-module:+flyspell]], you will need =aspell= (and a dictionary)
installed whether or not you have [[doom-module:+hunspell]] or [[doom-module:+enchant]] enabled. This is installed whether or not you have [[doom-module:+hunspell]] or [[doom-module:+enchant]] enabled. This is
because [[doom-package:spell-fu]] does not support generating the word list with anything because [[doom-package:spell-fu]] does not support generating the word list with anything
other than =aspell= yet. other than =aspell= yet.
@ -108,7 +108,7 @@ language(s).
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
When using [[doom-module:+everywhere]], spell checking is performed for as many major modes as When using [[doom-module:+everywhere]], spell checking is performed for as many major modes as
@ -117,7 +117,7 @@ major modes.
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
Dictionary is set by ~ispell-dictionary~ variable. Can be changed locally with Dictionary is set by ~ispell-dictionary~ variable. Can be changed locally with
@ -231,5 +231,5 @@ After the file is created, restart emacs and adding words should work.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -2,8 +2,8 @@
;;; checkers/spell/packages.el ;;; checkers/spell/packages.el
(if (not (modulep! +flyspell)) (if (not (modulep! +flyspell))
(package! spell-fu :pin "aed6e87aa31013534b7a6cbedb26e4f29ccea735") (package! spell-fu :pin "e4031935803c66eca2f076dce72b0a6a770d026c")
(package! flyspell-correct :pin "7d7b6b01188bd28e20a13736ac9f36c3367bd16e") (package! flyspell-correct :pin "1e7a5a56362dd875dddf848b9a9e25d1395b9d37")
(cond ((modulep! :completion ivy) (cond ((modulep! :completion ivy)
(package! flyspell-correct-ivy)) (package! flyspell-correct-ivy))
((modulep! :completion helm) ((modulep! :completion helm)

View file

@ -40,7 +40,7 @@ find out if you're missing any dependencies.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
Most of flycheck's features are under [[kbd:][C-c !]], regardless of whether evil mode is Most of flycheck's features are under [[kbd:][C-c !]], regardless of whether evil mode is
@ -67,7 +67,7 @@ Evil Specific:
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -81,5 +81,5 @@ Evil Specific:
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -2,10 +2,10 @@
;;; checkers/syntax/packages.el ;;; checkers/syntax/packages.el
(unless (modulep! +flymake) (unless (modulep! +flymake)
(package! flycheck :pin "784f184cdd9f9cb4e3dbb997c09d93e954142842") (package! flycheck :pin "e56e30d8c66ffc9776d07740658d3b542c1a8e21")
(package! flycheck-popup-tip :pin "ef86aad907f27ca076859d8d9416f4f7727619c6") (package! flycheck-popup-tip :pin "ef86aad907f27ca076859d8d9416f4f7727619c6")
(when (modulep! +childframe) (when (modulep! +childframe)
(package! flycheck-posframe :pin "8f60c9bf124ab9597d681504a73fdf116a0bde12"))) (package! flycheck-posframe :pin "19896b922c76a0f460bf3fe8d8ebc2f9ac9028d8")))
;; Flymake ;; Flymake
(when (modulep! +flymake) (when (modulep! +flymake)

View file

@ -44,7 +44,7 @@ find out if you're missing any dependencies.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Code completion ** Code completion
@ -87,7 +87,7 @@ More information can be found [[https://github.com/oantolin/orderless#company][h
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Enable company backend(s) in certain modes ** Enable company backend(s) in certain modes
@ -142,5 +142,5 @@ on changing what backends are available for that mode.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -97,47 +97,46 @@
:config :config
(setq company-box-show-single-candidate t (setq company-box-show-single-candidate t
company-box-backends-colors nil company-box-backends-colors nil
company-box-max-candidates 50 company-box-tooltip-limit 50
company-box-icons-alist 'company-box-icons-all-the-icons company-box-icons-alist 'company-box-icons-nerd-icons
;; Move company-box-icons--elisp to the end, because it has a catch-all ;; Move company-box-icons--elisp to the end, because it has a catch-all
;; clause that ruins icons from other backends in elisp buffers. ;; clause that ruins icons from other backends in elisp buffers.
company-box-icons-functions company-box-icons-functions
(cons #'+company-box-icons--elisp-fn (cons #'+company-box-icons--elisp-fn
(delq 'company-box-icons--elisp (delq 'company-box-icons--elisp
company-box-icons-functions)) company-box-icons-functions))
company-box-icons-all-the-icons company-box-icons-nerd-icons
(let ((all-the-icons-scale-factor 0.8)) `((Unknown . ,(nerd-icons-codicon "nf-cod-code" :face 'font-lock-warning-face))
`((Unknown . ,(all-the-icons-material "find_in_page" :face 'all-the-icons-purple)) (Text . ,(nerd-icons-codicon "nf-cod-text_size" :face 'font-lock-doc-face))
(Text . ,(all-the-icons-material "text_fields" :face 'all-the-icons-green)) (Method . ,(nerd-icons-codicon "nf-cod-symbol_method" :face 'font-lock-function-name-face))
(Method . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) (Function . ,(nerd-icons-codicon "nf-cod-symbol_method" :face 'font-lock-function-name-face))
(Function . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) (Constructor . ,(nerd-icons-codicon "nf-cod-triangle_right" :face 'font-lock-function-name-face))
(Constructor . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) (Field . ,(nerd-icons-codicon "nf-cod-symbol_field" :face 'font-lock-variable-name-face))
(Field . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) (Variable . ,(nerd-icons-codicon "nf-cod-symbol_variable" :face 'font-lock-variable-name-face))
(Variable . ,(all-the-icons-material "adjust" :face 'all-the-icons-blue)) (Class . ,(nerd-icons-codicon "nf-cod-symbol_class" :face 'font-lock-type-face))
(Class . ,(all-the-icons-material "class" :face 'all-the-icons-red)) (Interface . ,(nerd-icons-codicon "nf-cod-symbol_interface" :face 'font-lock-type-face))
(Interface . ,(all-the-icons-material "settings_input_component" :face 'all-the-icons-red)) (Module . ,(nerd-icons-codicon "nf-cod-file_submodule" :face 'font-lock-preprocessor-face))
(Module . ,(all-the-icons-material "view_module" :face 'all-the-icons-red)) (Property . ,(nerd-icons-codicon "nf-cod-symbol_property" :face 'font-lock-variable-name-face))
(Property . ,(all-the-icons-material "settings" :face 'all-the-icons-red)) (Unit . ,(nerd-icons-codicon "nf-cod-symbol_ruler" :face 'font-lock-constant-face))
(Unit . ,(all-the-icons-material "straighten" :face 'all-the-icons-red)) (Value . ,(nerd-icons-codicon "nf-cod-symbol_field" :face 'font-lock-builtin-face))
(Value . ,(all-the-icons-material "filter_1" :face 'all-the-icons-red)) (Enum . ,(nerd-icons-codicon "nf-cod-symbol_enum" :face 'font-lock-builtin-face))
(Enum . ,(all-the-icons-material "plus_one" :face 'all-the-icons-red)) (Keyword . ,(nerd-icons-codicon "nf-cod-symbol_keyword" :face 'font-lock-keyword-face))
(Keyword . ,(all-the-icons-material "filter_center_focus" :face 'all-the-icons-red)) (Snippet . ,(nerd-icons-codicon "nf-cod-symbol_snippet" :face 'font-lock-string-face))
(Snippet . ,(all-the-icons-material "short_text" :face 'all-the-icons-red)) (Color . ,(nerd-icons-codicon "nf-cod-symbol_color" :face 'success))
(Color . ,(all-the-icons-material "color_lens" :face 'all-the-icons-red)) (File . ,(nerd-icons-codicon "nf-cod-symbol_file" :face 'font-lock-string-face))
(File . ,(all-the-icons-material "insert_drive_file" :face 'all-the-icons-red)) (Reference . ,(nerd-icons-codicon "nf-cod-references" :face 'font-lock-variable-name-face))
(Reference . ,(all-the-icons-material "collections_bookmark" :face 'all-the-icons-red)) (Folder . ,(nerd-icons-codicon "nf-cod-folder" :face 'font-lock-variable-name-face))
(Folder . ,(all-the-icons-material "folder" :face 'all-the-icons-red)) (EnumMember . ,(nerd-icons-codicon "nf-cod-symbol_enum_member" :face 'font-lock-builtin-face))
(EnumMember . ,(all-the-icons-material "people" :face 'all-the-icons-red)) (Constant . ,(nerd-icons-codicon "nf-cod-symbol_constant" :face 'font-lock-constant-face))
(Constant . ,(all-the-icons-material "pause_circle_filled" :face 'all-the-icons-red)) (Struct . ,(nerd-icons-codicon "nf-cod-symbol_structure" :face 'font-lock-variable-name-face))
(Struct . ,(all-the-icons-material "streetview" :face 'all-the-icons-red)) (Event . ,(nerd-icons-codicon "nf-cod-symbol_event" :face 'font-lock-warning-face))
(Event . ,(all-the-icons-material "event" :face 'all-the-icons-red)) (Operator . ,(nerd-icons-codicon "nf-cod-symbol_operator" :face 'font-lock-comment-delimiter-face))
(Operator . ,(all-the-icons-material "control_point" :face 'all-the-icons-red)) (TypeParameter . ,(nerd-icons-codicon "nf-cod-list_unordered" :face 'font-lock-type-face))
(TypeParameter . ,(all-the-icons-material "class" :face 'all-the-icons-red)) (Template . ,(nerd-icons-codicon "nf-cod-symbol_snippet" :face 'font-lock-string-face))
(Template . ,(all-the-icons-material "short_text" :face 'all-the-icons-green)) (ElispFunction . ,(nerd-icons-codicon "nf-cod-symbol_method" :face 'font-lock-function-name-face))
(ElispFunction . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) (ElispVariable . ,(nerd-icons-codicon "nf-cod-symbol_variable" :face 'font-lock-variable-name-face))
(ElispVariable . ,(all-the-icons-material "check_circle" :face 'all-the-icons-blue)) (ElispFeature . ,(nerd-icons-codicon "nf-cod-globe" :face 'font-lock-builtin-face))
(ElispFeature . ,(all-the-icons-material "stars" :face 'all-the-icons-orange)) (ElispFace . ,(nerd-icons-codicon "nf-cod-symbol_color" :face 'success))))
(ElispFace . ,(all-the-icons-material "format_paint" :face 'all-the-icons-pink)))))
;; HACK Fix oversized scrollbar in some odd cases ;; HACK Fix oversized scrollbar in some odd cases
;; REVIEW `resize-mode' is deprecated and may stop working in the future. ;; REVIEW `resize-mode' is deprecated and may stop working in the future.

View file

@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; completion/company/packages.el ;;; completion/company/packages.el
(package! company :pin "2ca3e29abf87392714bc2b26e50e1c0f4b9f4e2c") (package! company :pin "ed46a616ab9906fd43a630479b6a6c3f79e606f0")
(package! company-dict :pin "cd7b8394f6014c57897f65d335d6b2bd65dab1f4") (package! company-dict :pin "cd7b8394f6014c57897f65d335d6b2bd65dab1f4")
(when (modulep! +childframe) (when (modulep! +childframe)
(package! company-box :pin "766546b2668b5ef4eb4abbde632c9acd370c7788")) (package! company-box :pin "b6f53e26adf948aca55c3ff6c22c21a6a6614253"))

View file

@ -22,7 +22,7 @@ For official documentation about Helm, see:
Enable fuzzy completion for Helm searches. Enable fuzzy completion for Helm searches.
- +icons :: - +icons ::
Display icons on completion results (where possible) using either Display icons on completion results (where possible) using either
[[doom-package:all-the-icons]] or [[doom-package:treemacs]] iconsets. [[doom-package:nerd-icons]] or [[doom-package:treemacs]] iconsets.
** Packages ** Packages
- [[doom-package:helm]] - [[doom-package:helm]]
@ -40,7 +40,7 @@ For official documentation about Helm, see:
** TODO Hacks ** TODO Hacks
#+begin_quote #+begin_quote
🔨 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]] 󱌣 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]]
#+end_quote #+end_quote
** TODO Changelog ** TODO Changelog
@ -74,18 +74,18 @@ its highlights will be covered here.
** Jump-to navigation ** Jump-to navigation
Similar to Ivy, this module provides an interface to navigate within a project Similar to Ivy, this module provides an interface to navigate within a project
using [[doom-package:projectile]]: using [[doom-package:projectile]]:
| Keybind | Description | | Keybind | Description |
|------------------+---------------------------------------------------------| |--------------------------------------+-------------------------------------------------------|
| [[kbd:][SPC p f]], [[kbd:][SPC SPC]] | Jump to file in project (~+helm/projectile-find-file~) | | [[kbd:][SPC p f]], [[kbd:][SPC SPC]] | Jump to file in project (~+helm/projectile-find-file~) |
| [[kbd:][SPC f f]], [[kbd:][SPC .]] | Jump to file from current directory (~helm-find-files~) | | [[kbd:][SPC f f]], [[kbd:][SPC .]] | Jump to file from current directory (~helm-find-files~) |
| [[kbd:][SPC s i]] | Jump to symbol in file (~helm-semantic-or-imenu~) | | [[kbd:][SPC s i]] | Jump to symbol in file (~helm-semantic-or-imenu~) |
** Project search & replace ** Project search & replace
This module also provides interactive text search and replace using [[https://github.com/BurntSushi/ripgrep][Ripgrep]]. This module also provides interactive text search and replace using [[https://github.com/BurntSushi/ripgrep][Ripgrep]].
*** Search *** Search
| Keybind | Description | | Keybind | Description |
|---------+-----------------------------------------------------------| |-------------------+---------------------------------------------------------|
| [[kbd:][SPC s p]] | Search project (~+default/search-project~) | | [[kbd:][SPC s p]] | Search project (~+default/search-project~) |
| [[kbd:][SPC s P]] | Search another project (~+default/search-other-project~) | | [[kbd:][SPC s P]] | Search another project (~+default/search-other-project~) |
| [[kbd:][SPC s d]] | Search this directory (~+default/search-cwd~) | | [[kbd:][SPC s d]] | Search this directory (~+default/search-cwd~) |
@ -96,8 +96,8 @@ otherwise) changes the behavior of these commands, instructing the underlying
search engine to include ignored files. search engine to include ignored files.
This module also provides Ex Commands for evil users: This module also provides Ex Commands for evil users:
| Ex command | Description | | Ex command | Description |
|------------------------+------------------------------------------------------------------| |----------------------+----------------------------------------------------------------|
| ~:pg[rep][!] [QUERY]~ | Search project (if ~!~, include hidden files) | | ~:pg[rep][!] [QUERY]~ | Search project (if ~!~, include hidden files) |
| ~:pg[rep]d[!] [QUERY]~ | Search from current directory (if ~!~, don't search recursively) | | ~:pg[rep]d[!] [QUERY]~ | Search from current directory (if ~!~, don't search recursively) |
@ -106,8 +106,8 @@ commands.
*** Replace *** Replace
These keybindings are available while a search is active: These keybindings are available while a search is active:
| Keybind | Description | | Keybind | Description |
|---------+-----------------------------------------------| |-------------------+-----------------------------------------------|
| [[kbd:][C-c C-o]] | Open a buffer with your search results | | [[kbd:][C-c C-o]] | Open a buffer with your search results |
| [[kbd:][C-c C-e]] | Open a writable buffer of your search results | | [[kbd:][C-c C-e]] | Open a writable buffer of your search results |
| [[kbd:][C-SPC]] | Preview the current candidate | | [[kbd:][C-SPC]] | Preview the current candidate |
@ -131,38 +131,38 @@ A [[doom-package:wgrep]] buffer can be opened from swiper with [[kbd:][C-c C-e]]
Helm also has a number of overrides for built-in functionality: Helm also has a number of overrides for built-in functionality:
*** General *** General
| Keybind | Description | | Keybind | Description |
|------------+---------------------------| |--------------------------------+---------------------------|
| [[kbd:][M-x]], [[kbd:][SPC :]] | Smarter, smex-powered M-x | | [[kbd:][M-x]], [[kbd:][SPC :]] | Smarter, smex-powered M-x |
| [[kbd:][SPC ']] | Resume last ivy session | | [[kbd:][SPC ']] | Resume last ivy session |
*** Jump to files, buffers or projects *** Jump to files, buffers or projects
| Keybind | Description | | Keybind | Description |
|---------+----------------------------------------------------------------------| |-------------------+--------------------------------------------------------------------|
| [[kbd:][SPC p t]] | List all TODO/FIXMEs in project | | [[kbd:][SPC p t]] | List all TODO/FIXMEs in project |
| [[kbd:][SPC s b]] | Search the current buffer (~+default/search-buffer~) | | [[kbd:][SPC s b]] | Search the current buffer (~+default/search-buffer~) |
| [[kbd:][SPC s d]] | Search this directory (~+default/search-cwd~) | | [[kbd:][SPC s d]] | Search this directory (~+default/search-cwd~) |
| [[kbd:][SPC s D]] | Search another directory (~+default/search-other-cwd~) | | [[kbd:][SPC s D]] | Search another directory (~+default/search-other-cwd~) |
| [[kbd:][SPC s i]] | Search for symbol in current buffer | | [[kbd:][SPC s i]] | Search for symbol in current buffer |
| [[kbd:][SPC s p]] | Search project (~+default/search-project~) | | [[kbd:][SPC s p]] | Search project (~+default/search-project~) |
| [[kbd:][SPC s P]] | Search another project (~+default/search-other-project~) | | [[kbd:][SPC s P]] | Search another project (~+default/search-other-project~) |
| [[kbd:][SPC s s]] | Search the current buffer (incrementally) (~+default/search-buffer~) | | [[kbd:][SPC s s]] | Search the current buffer (incrementally) (~+default/search-buffer~) |
*** Search *** Search
| Keybind | Description | | Keybind | Description |
|---------+----------------------------------------------------------------------| |-------------------+--------------------------------------------------------------------|
| [[kbd:][SPC p t]] | List all TODO/FIXMEs in project | | [[kbd:][SPC p t]] | List all TODO/FIXMEs in project |
| [[kbd:][SPC s b]] | Search the current buffer (~+default/search-buffer~) | | [[kbd:][SPC s b]] | Search the current buffer (~+default/search-buffer~) |
| [[kbd:][SPC s d]] | Search this directory (~+default/search-cwd~) | | [[kbd:][SPC s d]] | Search this directory (~+default/search-cwd~) |
| [[kbd:][SPC s D]] | Search another directory (~+default/search-other-cwd~) | | [[kbd:][SPC s D]] | Search another directory (~+default/search-other-cwd~) |
| [[kbd:][SPC s i]] | Search for symbol in current buffer | | [[kbd:][SPC s i]] | Search for symbol in current buffer |
| [[kbd:][SPC s p]] | Search project (~+default/search-project~) | | [[kbd:][SPC s p]] | Search project (~+default/search-project~) |
| [[kbd:][SPC s P]] | Search another project (~+default/search-other-project~) | | [[kbd:][SPC s P]] | Search another project (~+default/search-other-project~) |
| [[kbd:][SPC s s]] | Search the current buffer (incrementally) (~+default/search-buffer~) | | [[kbd:][SPC s s]] | Search the current buffer (incrementally) (~+default/search-buffer~) |
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** helm-mode ** helm-mode
@ -182,9 +182,9 @@ makes sense to exempt ~foo~ with the following:
** Icons ** Icons
There are two icon "themes" available for this module: There are two icon "themes" available for this module:
[[doom-package:all-the-icons]] and [[doom-package:treemacs]]. By default, and to [[doom-package:nerd-icons]] and [[doom-package:treemacs]]. By default, and to
maintain consistency with other icons across Doom's modules, maintain consistency with other icons across Doom's modules,
[[doom-package:all-the-icons]] is used. To change this: [[doom-package:nerd-icons]] is used. To change this:
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; add to $DOOMDIR/config.el ;; add to $DOOMDIR/config.el
(after! helm (after! helm
@ -202,5 +202,5 @@ See [[id:4f36ae11-1da8-4624-9c30-46b764e849fc][this answer]].
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -195,7 +195,4 @@ Can be negative.")
:when (modulep! +icons) :when (modulep! +icons)
:hook (helm-mode . helm-icons-enable) :hook (helm-mode . helm-icons-enable)
:init :init
(setq helm-icons-provider 'all-the-icons) (setq helm-icons-provider 'nerd-icons))
:config
(when (eq helm-icons-provider 'all-the-icons)
(setq helm-icons-mode->icon nil)))

View file

@ -0,0 +1,7 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; completion/helm/doctor.el
(dolist (module '(ivy ido vertico))
(when (doom-module-p :completion module)
(error! "This module is incompatible with :completion %s; disable one or the other"
module)))

View file

@ -1,20 +1,20 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; completion/helm/packages.el ;;; completion/helm/packages.el
(package! helm :pin "dfd6403947c5cd9f32afcd6bc92a1756cc958c82") (package! helm :pin "96aad023cb12e995e92763195086ccee3aa5a141")
(package! helm-company :pin "6eb5c2d730a60e394e005b47c1db018697094dde") (package! helm-company :pin "4622b82353220ee6cc33468f710fa5b6b253b7f1")
(package! helm-c-yasnippet :pin "e214eec8b2875d8a7cd09006dfb6a8e15e9e4079") (package! helm-c-yasnippet :pin "c5880e740da101fde7a995e94a7b16c330e57583")
(package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192") (package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192")
(package! helm-describe-modes :pin "11fb36af119b784539d31c6160002de1957408aa") (package! helm-describe-modes :pin "11fb36af119b784539d31c6160002de1957408aa")
(package! helm-projectile :pin "35a2111d00c0c0c9d8743280d3f1243bb217118a") (package! helm-projectile :pin "e2e38825c975269a4971df25e79b2ae98929624e")
(package! helm-rg :pin "ee0a3c09da0c843715344919400ab0a0190cc9dc") (package! helm-rg :pin "ee0a3c09da0c843715344919400ab0a0190cc9dc")
(package! swiper-helm :pin "93fb6db87bc6a5967898b5fd3286954cc72a0008") (package! swiper-helm :pin "93fb6db87bc6a5967898b5fd3286954cc72a0008")
(when (modulep! +childframe) (when (modulep! +childframe)
(package! helm-posframe :pin "87461b52b6f3f378c63642a33f584d4a4ba28351")) (package! helm-posframe :pin "0b6bb016f0ff4980860a9d00574de311748c40b0"))
(when (modulep! +fuzzy) (when (modulep! +fuzzy)
(package! helm-flx :pin "5220099e695a3586dba2d59640217fe378e66310")) (package! helm-flx :pin "5220099e695a3586dba2d59640217fe378e66310"))
(when (modulep! +icons) (when (modulep! +icons)
(package! helm-icons :pin "8d2f5e705c8b78a390677cf242024739c932fc95")) (package! helm-icons :pin "0d113719ee72cb7b6bb7db29f7200d667bd86607"))
(when (modulep! :lang org) (when (modulep! :lang org)
(package! helm-org :pin "d67186d3a64e610c03a5f3d583488f018fb032e4")) (package! helm-org :pin "c80e53315ce6b096e2d0e630702df924bf00bf6a"))

View file

@ -33,12 +33,12 @@ Interactive DO things. The completion engine that is /mostly/ built-into Emacs.
* Usage * Usage
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Configuration * Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -52,5 +52,5 @@ See [[id:4f36ae11-1da8-4624-9c30-46b764e849fc][this answer]].
* Appendix * Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -0,0 +1,7 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; completion/ido/doctor.el
(dolist (module '(helm ivy vertico))
(when (doom-module-p :completion module)
(error! "This module is incompatible with :completion %s; disable one or the other"
module)))

View file

@ -27,7 +27,7 @@ lighter, simpler and faster in many cases.
Enable prescient filtering and sorting for Ivy searches. Enable prescient filtering and sorting for Ivy searches.
** Packages ** Packages
- [[doom-package:all-the-icons-ivy]]* if [[doom-module:+icons]] - [[doom-package:nerd-icons-ivy]]* if [[doom-module:+icons]]
- [[doom-package:amx]] - [[doom-package:amx]]
- [[doom-package:counsel]] - [[doom-package:counsel]]
- [[doom-package:counsel-projectile]] - [[doom-package:counsel-projectile]]
@ -64,7 +64,7 @@ use their associated Helm command or plugin.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
[[doom-package:ivy]] is a /large/ framework for completing things. Covering all its features is [[doom-package:ivy]] is a /large/ framework for completing things. Covering all its features is
@ -169,7 +169,7 @@ A wgrep buffer can be opened from swiper with [[kbd:][C-c C-e]].
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** TODO Enable fuzzy/non-fuzzy search for specific commands ** TODO Enable fuzzy/non-fuzzy search for specific commands
@ -186,5 +186,5 @@ See [[id:4f36ae11-1da8-4624-9c30-46b764e849fc][this answer]].
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -34,22 +34,6 @@ Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with
(ivy-append-face candidate 'ivy-modified-buffer)) (ivy-append-face candidate 'ivy-modified-buffer))
(candidate)))) (candidate))))
;;;###autoload
(defun +ivy-rich-buffer-icon (candidate)
"Display the icon for CANDIDATE buffer."
;; NOTE This is inspired by `all-the-icons-ivy-buffer-transformer', minus the
;; buffer name and extra padding as those are handled by `ivy-rich'.
(propertize "\t" 'display
(if-let* ((buffer (get-buffer candidate))
(mode (buffer-local-value 'major-mode buffer)))
(or
(all-the-icons-ivy--icon-for-mode mode)
(all-the-icons-ivy--icon-for-mode (get mode 'derived-mode-parent))
(funcall
all-the-icons-ivy-family-fallback-for-buffer
all-the-icons-ivy-name-fallback-for-buffer))
(all-the-icons-icon-for-file candidate))))
;;;###autoload ;;;###autoload
(defun +ivy-rich-describe-variable-transformer (cand) (defun +ivy-rich-describe-variable-transformer (cand)
"Previews the value of the variable in the minibuffer" "Previews the value of the variable in the minibuffer"

View file

@ -116,12 +116,6 @@ results buffer.")
:config :config
(setq ivy-rich-parse-remote-buffer nil) (setq ivy-rich-parse-remote-buffer nil)
(when (modulep! +icons)
(cl-pushnew '(+ivy-rich-buffer-icon)
(cadr (plist-get ivy-rich-display-transformers-list
'ivy-switch-buffer))
:test #'equal))
(defun ivy-rich-bookmark-filename-or-empty (candidate) (defun ivy-rich-bookmark-filename-or-empty (candidate)
(let ((filename (ivy-rich-bookmark-filename candidate))) (let ((filename (ivy-rich-bookmark-filename candidate)))
(if (not filename) "" filename))) (if (not filename) "" filename)))
@ -155,25 +149,16 @@ results buffer.")
(switch-buffer-alist (assq 'ivy-rich-candidate (plist-get plist :columns)))) (switch-buffer-alist (assq 'ivy-rich-candidate (plist-get plist :columns))))
(setcar switch-buffer-alist '+ivy-rich-buffer-name)) (setcar switch-buffer-alist '+ivy-rich-buffer-name))
(when (modulep! +icons)
(nerd-icons-ivy-rich-mode +1))
(ivy-rich-mode +1) (ivy-rich-mode +1)
(ivy-rich-project-root-cache-mode +1)) (ivy-rich-project-root-cache-mode +1))
(use-package! all-the-icons-ivy (use-package! nerd-icons-ivy-rich
:when (modulep! +icons) :when (modulep! +icons)
:after ivy :commands (nerd-icons-ivy-rich-mode)
:config :after counsel-projectile)
;; `all-the-icons-ivy' is incompatible with ivy-rich's switch-buffer
;; modifications, so we disable them and merge them ourselves
(setq all-the-icons-ivy-buffer-commands nil)
(all-the-icons-ivy-setup)
(after! counsel-projectile
(let ((all-the-icons-ivy-file-commands
'(counsel-projectile
counsel-projectile-find-file
counsel-projectile-find-dir)))
(all-the-icons-ivy-setup))))
(use-package! counsel (use-package! counsel
@ -237,7 +222,6 @@ results buffer.")
;; Record in jumplist when opening files via counsel-{ag,rg,pt,git-grep} ;; Record in jumplist when opening files via counsel-{ag,rg,pt,git-grep}
(add-hook 'counsel-grep-post-action-hook #'better-jumper-set-jump) (add-hook 'counsel-grep-post-action-hook #'better-jumper-set-jump)
(add-hook 'counsel-grep-post-action-hook #'recenter)
(ivy-add-actions (ivy-add-actions
'counsel-rg ; also applies to `counsel-rg' 'counsel-rg ; also applies to `counsel-rg'
'(("O" +ivy-git-grep-other-window-action "open in other window"))) '(("O" +ivy-git-grep-other-window-action "open in other window")))
@ -315,7 +299,7 @@ results buffer.")
(use-package! counsel-projectile (use-package! counsel-projectile
:defer t :after ivy-rich
:init :init
(define-key! (define-key!
[remap projectile-find-file] #'+ivy/projectile-find-file [remap projectile-find-file] #'+ivy/projectile-find-file

View file

@ -1,3 +1,7 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*- ;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; completion/ivy/doctor.el ;;; completion/ivy/doctor.el
(dolist (module '(helm ido vertico))
(when (doom-module-p :completion module)
(error! "This module is incompatible with :completion %s; disable one or the other"
module)))

View file

@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; completion/ivy/packages.el ;;; completion/ivy/packages.el
(package! swiper :pin "9d630d800e856a2c984c5a62a6f0ad313a9d2228") (package! swiper :pin "8c30f4cab5948aa8d942a3b2bbf5fb6a94d9441d")
(package! ivy) (package! ivy)
(package! ivy-hydra) (package! ivy-hydra)
(package! ivy-avy) (package! ivy-avy)
@ -13,7 +13,7 @@
(package! wgrep :pin "3132abd3750b8c87cbcf6942db952acfab5edccd") (package! wgrep :pin "3132abd3750b8c87cbcf6942db952acfab5edccd")
(if (modulep! +prescient) (if (modulep! +prescient)
(package! ivy-prescient :pin "d7cc55dad453c465af9ececbab94426202b5b32b") (package! ivy-prescient :pin "707c25c947a9f17a1d43f97b3b28aba91ec9addb")
(when (modulep! +fuzzy) (when (modulep! +fuzzy)
(package! flx :pin "7b44a5abb254bbfbeca7a29336f7f4ebd8aabbf2"))) (package! flx :pin "7b44a5abb254bbfbeca7a29336f7f4ebd8aabbf2")))
@ -21,4 +21,4 @@
(package! ivy-posframe :pin "533a8e368fcabfd534761a5c685ce713376fa594")) (package! ivy-posframe :pin "533a8e368fcabfd534761a5c685ce713376fa594"))
(when (modulep! +icons) (when (modulep! +icons)
(package! all-the-icons-ivy :pin "a70cbfa1effe36efc946a823a580cec686d5e88d")) (package! nerd-icons-ivy-rich :pin "7197614b27fd562e64b11c91d41bed4443aded90"))

View file

@ -31,7 +31,7 @@ like [[doom-package:ivy]] and [[doom-package:helm]] do. The primary packages are
Add icons to =file= and =buffer= category completion selections. Add icons to =file= and =buffer= category completion selections.
** Packages ** Packages
- [[doom-package:all-the-icons-completion]] if [[doom-module:+icons]] - [[doom-package:nerd-icons-completion]] if [[doom-module:+icons]]
- [[doom-package:consult]] - [[doom-package:consult]]
- [[doom-package:consult-flycheck]] if [[doom-module::checkers syntax]] - [[doom-package:consult-flycheck]] if [[doom-module::checkers syntax]]
- [[doom-package:embark]] - [[doom-package:embark]]
@ -63,7 +63,7 @@ intend to use their associated Helm command or plugin.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
The packages in this module modify and use the built-in ~completing-read~ The packages in this module modify and use the built-in ~completing-read~
@ -76,16 +76,16 @@ Doom-specific additions:
When in an active Vertico completion session, the following doom added When in an active Vertico completion session, the following doom added
keybindings are available: keybindings are available:
| Keybind | Description | | Keybind | Description |
|-------------------+----------------------------------------------------------------| |---------------------------------------+--------------------------------------------------------------|
| [[kbd:][C-k]] | (evil) Go to previous candidate | | [[kbd:][C-k]] | (evil) Go to previous candidate |
| [[kbd:][C-j]] | (evil) Go to next candidate | | [[kbd:][C-j]] | (evil) Go to next candidate |
| [[kbd:][C-M-k]] | (evil) Go to previous group | | [[kbd:][C-M-k]] | (evil) Go to previous group |
| [[kbd:][C-M-j]] | (evil) Go to next group | | [[kbd:][C-M-j]] | (evil) Go to next group |
| [[kbd:][C-;]] or [[kbd:][<leader> a]] | Open an ~embark-act~ menu to chose a useful action | | [[kbd:][C-;]] or [[kbd:][<leader> a]] | Open an ~embark-act~ menu to chose a useful action |
| [[kbd:][C-c C-;]] | export the current candidate list to a buffer | | [[kbd:][C-c C-;]] | export the current candidate list to a buffer |
| [[kbd:][C-c C-l]] | ~embark-collect~ the current candidate list (collect verbatim) | | [[kbd:][C-c C-l]] | ~embark-collect~ the current candidate list (collect verbatim) |
| [[kbd:][C-SPC]] | Preview the current candidate | | [[kbd:][C-SPC]] | Preview the current candidate |
~embark-act~ will prompt you with a =which-key= menu with useful commands on the ~embark-act~ will prompt you with a =which-key= menu with useful commands on the
selected candidate or candidate list, depending on the completion category. Note selected candidate or candidate list, depending on the completion category. Note
@ -99,17 +99,17 @@ This module provides an interface to navigate within a project using
https://assets.doomemacs.org/completion/vertico/projectile.png https://assets.doomemacs.org/completion/vertico/projectile.png
| Keybind | Description | | Keybind | Description |
|------------------+-------------------------------------| |--------------------------------------+-------------------------------------|
| [[kbd:][SPC p f]], [[kbd:][SPC SPC]] | Jump to file in project | | [[kbd:][SPC p f]], [[kbd:][SPC SPC]] | Jump to file in project |
| [[kbd:][SPC f f]], [[kbd:][SPC .]] | Jump to file from current directory | | [[kbd:][SPC f f]], [[kbd:][SPC .]] | Jump to file from current directory |
| [[kbd:][SPC s i]] | Jump to symbol in file | | [[kbd:][SPC s i]] | Jump to symbol in file |
** Project search & replace ** Project search & replace
This module provides interactive text search and replace using ripgrep. This module provides interactive text search and replace using ripgrep.
| Keybind | Description | | Keybind | Description |
|---------+--------------------------| |------------------------+--------------------------|
| [[kbd:][<leader> s p]] | Search project | | [[kbd:][<leader> s p]] | Search project |
| [[kbd:][<leader> s P]] | Search another project | | [[kbd:][<leader> s P]] | Search another project |
| [[kbd:][<leader> s d]] | Search this directory | | [[kbd:][<leader> s d]] | Search this directory |
@ -153,19 +153,19 @@ An ~occur-edit~ buffer can be opened from ~consult-line~ with [[kbd:][C-c C-e]].
** Vertico integration for various completing commands ** Vertico integration for various completing commands
*** General *** General
| Keybind | Description | | Keybind | Description |
|------------+-----------------------------| |--------------------------------+-----------------------------|
| [[kbd:][M-x]], [[kbd:][SPC :]] | Enhanced M-x | | [[kbd:][M-x]], [[kbd:][SPC :]] | Enhanced M-x |
| [[kbd:][SPC ']] | Resume last Vertico session | | [[kbd:][SPC ']] | Resume last Vertico session |
*** Jump to files, buffers or projects *** Jump to files, buffers or projects
| Keybind | Description | | Keybind | Description |
|------------------+---------------------------------------| |--------------------------------------+---------------------------------------|
| [[kbd:][SPC RET]] | Find bookmark | | [[kbd:][SPC RET]] | Find bookmark |
| [[kbd:][SPC f f]], [[kbd:][SPC .]] | Browse from current directory | | [[kbd:][SPC f f]], [[kbd:][SPC .]] | Browse from current directory |
| [[kbd:][SPC p f]], [[kbd:][SPC SPC]] | Find file in project | | [[kbd:][SPC p f]], [[kbd:][SPC SPC]] | Find file in project |
| [[kbd:][SPC f r]] | Find recently opened file | | [[kbd:][SPC f r]] | Find recently opened file |
| [[kbd:][SPC p p]] | Open another project | | [[kbd:][SPC p p]] | Open another project |
| [[kbd:][SPC b b]], [[kbd:][SPC ,]] | Switch to buffer in current workspace | | [[kbd:][SPC b b]], [[kbd:][SPC ,]] | Switch to buffer in current workspace |
| [[kbd:][SPC b B]], [[kbd:][SPC <]] | Switch to buffer | | [[kbd:][SPC b B]], [[kbd:][SPC <]] | Switch to buffer |
@ -177,8 +177,8 @@ the last workspace by typing [[kbd:][0 SPC]].
[[kbd:][SPC f f]] and [[kbd:][SPC .]] support exporting to a [[kbd:][wdired]] buffer using [[kbd:][C-c C-e]]. [[kbd:][SPC f f]] and [[kbd:][SPC .]] support exporting to a [[kbd:][wdired]] buffer using [[kbd:][C-c C-e]].
*** Search *** Search
| Keybind | Description | | Keybind | Description |
|---------+-------------------------------------------| |-------------------+-------------------------------------------|
| [[kbd:][SPC p t]] | List all TODO/FIXMEs in project | | [[kbd:][SPC p t]] | List all TODO/FIXMEs in project |
| [[kbd:][SPC s b]] | Search the current buffer | | [[kbd:][SPC s b]] | Search the current buffer |
| [[kbd:][SPC s d]] | Search this directory | | [[kbd:][SPC s d]] | Search this directory |
@ -200,10 +200,10 @@ to =~/=.
*** Multiple candidate search *** Multiple candidate search
This module modifies the default keybindings used in This module modifies the default keybindings used in
~consult-completing-read-multiple~: ~consult-completing-read-multiple~:
| Keybind | Description | | Keybind | Description |
|---------+-------------------------------------------------------------| |---------------+-------------------------------------------------------------|
| [[kbd:][TAB]] | Select or deselect current candidate | | [[kbd:][TAB]] | Select or deselect current candidate |
| [[kbd:][RET]] | Enters selected candidates (also toggles current candidate) | | [[kbd:][RET]] | Enters selected candidates (also toggles current candidate) |
*** Async search commands *** Async search commands
:PROPERTIES: :PROPERTIES:
@ -226,9 +226,9 @@ filtering should be done after a second =#=.
For more information [[https://github.com/minad/consult#asynchronous-search][see here]]. For more information [[https://github.com/minad/consult#asynchronous-search][see here]].
** Marginalia ** Marginalia
| Keybind | Description | | Keybind | Description |
|---------+---------------------------------| |---------------+---------------------------------|
| [[kbd:][M-A]] | Cycle between annotation levels | | [[kbd:][M-A]] | Cycle between annotation levels |
Marginalia annotations for symbols (e.g. [[kbd:][SPC h f]] and [[kbd:][SPC h v]]) come with extra Marginalia annotations for symbols (e.g. [[kbd:][SPC h f]] and [[kbd:][SPC h v]]) come with extra
information the nature of the symbol. For the meaning of the annotations see information the nature of the symbol. For the meaning of the annotations see
@ -260,7 +260,7 @@ you can use to further specify each space separated input in the following ways:
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
If you want to further configure this module, here are some good places to If you want to further configure this module, here are some good places to
@ -302,5 +302,5 @@ See [[id:4f36ae11-1da8-4624-9c30-46b764e849fc][this answer]].
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -86,8 +86,8 @@ buffer will be opened in the current workspace instead."
(funcall consult--buffer-display (car buffer))))))) (funcall consult--buffer-display (car buffer)))))))
;;;###autoload ;;;###autoload
(defun +vertico/embark-open-in-new-workspace (x) (defun +vertico/embark-open-in-new-workspace (file)
"Open X (a file) in a new workspace." "Open file in a new workspace."
(interactive) (interactive "GFile:")
(+workspace/new) (+workspace/new)
(find-file x)) (find-file file))

View file

@ -10,6 +10,12 @@ overrides `completion-styles' during company completion sessions.")
(defvar +vertico-consult-fd-args nil (defvar +vertico-consult-fd-args nil
"Shell command and arguments the vertico module uses for fd.") "Shell command and arguments the vertico module uses for fd.")
(defvar +vertico-consult-dir-container-executable "docker"
"Command to call for listing container hosts.")
(defvar +vertico-consult-dir-container-args nil
"Command to call for listing container hosts.")
;; ;;
;;; Packages ;;; Packages
@ -130,9 +136,10 @@ orderless."
[remap yank-pop] #'consult-yank-pop [remap yank-pop] #'consult-yank-pop
[remap persp-switch-to-buffer] #'+vertico/switch-workspace-buffer) [remap persp-switch-to-buffer] #'+vertico/switch-workspace-buffer)
:config :config
(defadvice! +vertico--consult-recent-file-a (&rest _args) (defadvice! +vertico--consult-recentf-a (&rest _args)
"`consult-recent-file' needs to have `recentf-mode' on to work correctly" "`consult-recent-file' needs to have `recentf-mode' on to work correctly.
:before #'consult-recent-file `consult-buffer' needs `recentf-mode' to show file candidates."
:before (list #'consult-recent-file #'consult-buffer)
(recentf-mode +1)) (recentf-mode +1))
(setq consult-project-root-function #'doom-project-root (setq consult-project-root-function #'doom-project-root
@ -197,22 +204,35 @@ orderless."
("C-x C-j" . consult-dir-jump-file)) ("C-x C-j" . consult-dir-jump-file))
:config :config
(when (modulep! :tools docker) (when (modulep! :tools docker)
;; TODO Replace with `tramp-container--completion-function' when we drop support for <29
(defun +vertico--consult-dir-container-hosts (host)
"Get a list of hosts from HOST."
(cl-loop for line in (cdr
(ignore-errors
(apply #'process-lines +vertico-consult-dir-container-executable
(append +vertico-consult-dir-container-args (list "ps")))))
for cand = (split-string line "[[:space:]]+" t)
collect (let ((user (unless (string-empty-p (car cand))
(concat (car cand) "@")))
(hostname (car (last cand))))
(format "/%s:%s%s:/" host user hostname))))
(defun +vertico--consult-dir-podman-hosts ()
(let ((+vertico-consult-dir-container-executable "podman"))
(+vertico--consult-dir-container-hosts "podman")))
(defun +vertico--consult-dir-docker-hosts () (defun +vertico--consult-dir-docker-hosts ()
"Get a list of hosts from docker." (let ((+vertico-consult-dir-container-executable "docker"))
(when (if (>= emacs-major-version 29) (+vertico--consult-dir-container-hosts "docker")))
(require 'tramp-container nil t)
(setq-local docker-tramp-use-names t) (defvar +vertico--consult-dir-source-tramp-podman
(require 'docker-tramp nil t)) `(:name "Podman"
(let ((hosts) :narrow ?p
(docker-query-fn #'docker-tramp--parse-running-containers)) :category file
(when (>= emacs-major-version 29) :face consult-file
(setq docker-query-fn #'tramp-docker--completion-function)) :history file-name-history
(dolist (cand (funcall docker-query-fn)) :items ,#'+vertico--consult-dir-podman-hosts)
(let ((user (unless (string-empty-p (car cand)) "Podman candiadate source for `consult-dir'.")
(concat (car cand) "@")))
(host (car (cdr cand))))
(push (concat "/docker:" user host ":/") hosts)))
hosts)))
(defvar +vertico--consult-dir-source-tramp-docker (defvar +vertico--consult-dir-source-tramp-docker
`(:name "Docker" `(:name "Docker"
@ -223,6 +243,7 @@ orderless."
:items ,#'+vertico--consult-dir-docker-hosts) :items ,#'+vertico--consult-dir-docker-hosts)
"Docker candiadate source for `consult-dir'.") "Docker candiadate source for `consult-dir'.")
(add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-podman t)
(add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-docker t)) (add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-docker t))
(add-to-list 'consult-dir-sources 'consult-dir--source-tramp-ssh t) (add-to-list 'consult-dir-sources 'consult-dir--source-tramp-ssh t)
@ -253,14 +274,16 @@ orderless."
(set-popup-rule! "^\\*Embark Export:" :size 0.35 :ttl 0 :quit nil) (set-popup-rule! "^\\*Embark Export:" :size 0.35 :ttl 0 :quit nil)
(defadvice! +vertico--embark-which-key-prompt-a (fn &rest args) (after! which-key
"Hide the which-key indicator immediately when using the completing-read prompter." (defadvice! +vertico--embark-which-key-prompt-a (fn &rest args)
:around #'embark-completing-read-prompter "Hide the which-key indicator immediately when using the completing-read prompter."
(which-key--hide-popup-ignore-command) :around #'embark-completing-read-prompter
(let ((embark-indicators (which-key--hide-popup-ignore-command)
(remq #'embark-which-key-indicator embark-indicators))) (let ((embark-indicators
(apply fn args))) (remq #'embark-which-key-indicator embark-indicators)))
(cl-nsubstitute #'+vertico-embark-which-key-indicator #'embark-mixed-indicator embark-indicators) (apply fn args)))
(cl-nsubstitute #'+vertico-embark-which-key-indicator #'embark-mixed-indicator embark-indicators))
;; add the package! target finder before the file target finder, ;; add the package! target finder before the file target finder,
;; so we don't get a false positive match. ;; so we don't get a false positive match.
(let ((pos (or (cl-position (let ((pos (or (cl-position
@ -294,7 +317,7 @@ orderless."
:desc "Cycle marginalia views" "M-A" #'marginalia-cycle) :desc "Cycle marginalia views" "M-A" #'marginalia-cycle)
:config :config
(when (modulep! +icons) (when (modulep! +icons)
(add-hook 'marginalia-mode-hook #'all-the-icons-completion-marginalia-setup)) (add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup))
(advice-add #'marginalia--project-root :override #'doom-project-root) (advice-add #'marginalia--project-root :override #'doom-project-root)
(pushnew! marginalia-command-categories (pushnew! marginalia-command-categories
'(+default/find-file-under-here . file) '(+default/find-file-under-here . file)

View file

@ -1,4 +1,10 @@
;;; completion/vertico/doctor.el -*- lexical-binding: t; -*- ;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; completion/vertico/doctor.el
(dolist (module '(ivy helm ido))
(when (doom-module-p :completion module)
(error! "This module is incompatible with :completion %s; disable one or the other"
module)))
(when (require 'consult nil t) (when (require 'consult nil t)
;; FIXME: This throws an error if grep is missing. ;; FIXME: This throws an error if grep is missing.

View file

@ -21,7 +21,7 @@
(package! wgrep :pin "3132abd3750b8c87cbcf6942db952acfab5edccd") (package! wgrep :pin "3132abd3750b8c87cbcf6942db952acfab5edccd")
(when (modulep! +icons) (when (modulep! +icons)
(package! all-the-icons-completion :pin "8eb3e410d63f5d0657b41829e7898793e81f31c0")) (package! nerd-icons-completion :pin "c2db8557a3c1a9588d111f8c8e91cae96ee85010"))
(when (modulep! +childframe) (when (modulep! +childframe)
(package! vertico-posframe (package! vertico-posframe

View file

@ -126,6 +126,9 @@
:desc "Search .emacs.d" "e" #'+default/search-emacsd :desc "Search .emacs.d" "e" #'+default/search-emacsd
:desc "Locate file" "f" #'+lookup/file :desc "Locate file" "f" #'+lookup/file
:desc "Jump to symbol" "i" #'imenu :desc "Jump to symbol" "i" #'imenu
:desc "Jump to symbol in open buffers" "I"
(cond ((modulep! :completion vertico) #'consult-imenu-multi)
((modulep! :completion helm) #'helm-imenu-in-all-buffers))
:desc "Jump to visible link" "l" #'link-hint-open-link :desc "Jump to visible link" "l" #'link-hint-open-link
:desc "Jump to link" "L" #'ffap-menu :desc "Jump to link" "L" #'ffap-menu
:desc "Jump to bookmark" "m" #'bookmark-jump :desc "Jump to bookmark" "m" #'bookmark-jump
@ -145,7 +148,10 @@
;;; <leader> i --- insert ;;; <leader> i --- insert
(:prefix-map ("i" . "insert") (:prefix-map ("i" . "insert")
:desc "Emoji" "e" #'emojify-insert-emoji (:when (> emacs-major-version 28)
:desc "Emoji" "e" #'emoji-search)
(:when (modulep! :ui emoji)
:desc "Emoji" "e" #'emojify-insert-emoji)
:desc "Current file name" "f" #'+default/insert-file-path :desc "Current file name" "f" #'+default/insert-file-path
:desc "Current file path" "F" (cmd!! #'+default/insert-file-path t) :desc "Current file path" "F" (cmd!! #'+default/insert-file-path t)
:desc "Snippet" "s" #'yas-insert-snippet :desc "Snippet" "s" #'yas-insert-snippet

View file

@ -496,7 +496,10 @@
;;; <leader> i --- insert ;;; <leader> i --- insert
(:prefix-map ("i" . "insert") (:prefix-map ("i" . "insert")
:desc "Emoji" "e" #'emojify-insert-emoji (:when (> emacs-major-version 28)
:desc "Emoji" "e" #'emoji-search)
(:when (modulep! :ui emoji)
:desc "Emoji" "e" #'emojify-insert-emoji)
:desc "Current file name" "f" #'+default/insert-file-path :desc "Current file name" "f" #'+default/insert-file-path
:desc "Current file path" "F" (cmd!! #'+default/insert-file-path t) :desc "Current file path" "F" (cmd!! #'+default/insert-file-path t)
:desc "Evil ex path" "p" (cmd! (evil-ex "R!echo ")) :desc "Evil ex path" "p" (cmd! (evil-ex "R!echo "))
@ -736,6 +739,9 @@
:desc "Search .emacs.d" "e" #'+default/search-emacsd :desc "Search .emacs.d" "e" #'+default/search-emacsd
:desc "Locate file" "f" #'locate :desc "Locate file" "f" #'locate
:desc "Jump to symbol" "i" #'imenu :desc "Jump to symbol" "i" #'imenu
:desc "Jump to symbol in open buffers" "I"
(cond ((modulep! :completion vertico) #'consult-imenu-multi)
((modulep! :completion helm) #'helm-imenu-in-all-buffers))
:desc "Jump to visible link" "l" #'link-hint-open-link :desc "Jump to visible link" "l" #'link-hint-open-link
:desc "Jump to link" "L" #'ffap-menu :desc "Jump to link" "L" #'ffap-menu
:desc "Jump list" "j" #'evil-show-jumps :desc "Jump list" "j" #'evil-show-jumps
@ -754,8 +760,9 @@
((modulep! :completion helm) #'swiper-isearch-thing-at-point)) ((modulep! :completion helm) #'swiper-isearch-thing-at-point))
:desc "Dictionary" "t" #'+lookup/dictionary-definition :desc "Dictionary" "t" #'+lookup/dictionary-definition
:desc "Thesaurus" "T" #'+lookup/synonyms :desc "Thesaurus" "T" #'+lookup/synonyms
(:when (fboundp 'vundo) :desc "Undo history" "u"
:desc "Undo history" "u" #'vundo)) (cond ((modulep! :emacs undo +tree) #'undo-tree-visualize)
((modulep! :emacs undo) #'vundo)))
;;; <leader> t --- toggle ;;; <leader> t --- toggle
(:prefix-map ("t" . "toggle") (:prefix-map ("t" . "toggle")

View file

@ -43,12 +43,12 @@ This module provides a set of reasonable defaults, including:
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -59,7 +59,7 @@ This module provides a set of reasonable defaults, including:
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 /This module's appendix is incomplete./ [[doom-contrib-module:][Write more?]] 󱌣 /This module's appendix is incomplete./ [[doom-contrib-module:][Write more?]]
#+end_quote #+end_quote
** Commands ** Commands

View file

@ -25,7 +25,8 @@ generate `completing-read' candidates."
(interactive) (interactive)
(call-interactively (call-interactively
(if (and (not IS-MAC) (executable-find "man")) (if (and (not IS-MAC) (executable-find "man"))
#'man (or (command-remapping #'man)
#'man)
#'woman))) #'woman)))
;;;###autoload ;;;###autoload

View file

@ -32,13 +32,13 @@ This module only requires a =$DOOMDIR/config.org=, which will be tangled into
=$DOOMDIR/config.el= when you run ~$ doom sync~. =$DOOMDIR/config.el= when you run ~$ doom sync~.
#+begin_quote #+begin_quote
🚧 *Be careful!* Enabling this module will overwrite =$DOOMDIR/config.el=! If *Be careful!* Enabling this module will overwrite =$DOOMDIR/config.el=! If
you are only trying out the module, *back up this file first!* you are only trying out the module, *back up this file first!*
#+end_quote #+end_quote
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
- Automatically tangles =$DOOMDIR/config.org= to =$DOOMDIR/config.el= when - Automatically tangles =$DOOMDIR/config.org= to =$DOOMDIR/config.el= when
@ -46,7 +46,7 @@ This module only requires a =$DOOMDIR/config.org=, which will be tangled into
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Change the location of config.org ** Change the location of config.org
@ -120,5 +120,5 @@ your =$DOOMDIR=). This behavior can be disabled with:
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -58,7 +58,7 @@ This holy module brings the Vim editing model to Emacs.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Ported vim plugins ** Ported vim plugins
@ -138,7 +138,7 @@ And these are text objects added by this module:
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -193,7 +193,7 @@ If you prefer the old behavior, it can be reversed with:
are bound to [[kbd:][C-c]] and [[kbd:][C-c l]] by default. are bound to [[kbd:][C-c]] and [[kbd:][C-c l]] by default.
#+begin_quote #+begin_quote
🚧 Ignore ~doom-leader-key~ and ~doom-localleader-key~, they don't apply to Ignore ~doom-leader-key~ and ~doom-localleader-key~, they don't apply to
non-evil sessions. non-evil sessions.
#+end_quote #+end_quote
@ -241,5 +241,5 @@ Like in vim, the clipboard can still be accessed by using the [[kbd:][+]] regist
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -48,7 +48,7 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
(user-error "Cannot swap a dedicated window")) (user-error "Cannot swap a dedicated window"))
(let* ((this-window (selected-window)) (let* ((this-window (selected-window))
(this-buffer (current-buffer)) (this-buffer (current-buffer))
(that-window (windmove-find-other-window direction nil this-window)) (that-window (window-in-direction direction nil this-window))
(that-buffer (window-buffer that-window))) (that-buffer (window-buffer that-window)))
(when (or (minibufferp that-buffer) (when (or (minibufferp that-buffer)
(window-dedicated-p this-window)) (window-dedicated-p this-window))

View file

@ -245,9 +245,7 @@ directives. By default, this only recognizes C directives.")
:hook (org-mode . embrace-org-mode-hook) :hook (org-mode . embrace-org-mode-hook)
:hook (ruby-mode . embrace-ruby-mode-hook) :hook (ruby-mode . embrace-ruby-mode-hook)
:hook (emacs-lisp-mode . embrace-emacs-lisp-mode-hook) :hook (emacs-lisp-mode . embrace-emacs-lisp-mode-hook)
:hook ((lisp-mode emacs-lisp-mode clojure-mode racket-mode hy-mode) :hook ((c++-mode c++-ts-mode rustic-mode csharp-mode java-mode swift-mode typescript-mode)
. +evil-embrace-lisp-mode-hook-h)
:hook ((c++-mode rustic-mode csharp-mode java-mode swift-mode typescript-mode)
. +evil-embrace-angle-bracket-modes-hook-h) . +evil-embrace-angle-bracket-modes-hook-h)
:hook (scala-mode . +evil-embrace-scala-mode-hook-h) :hook (scala-mode . +evil-embrace-scala-mode-hook-h)
:init :init
@ -284,16 +282,6 @@ directives. By default, this only recognizes C directives.")
embrace--pairs-list)) embrace--pairs-list))
(embrace-add-pair-regexp ?l "\\[a-z]+{" "}" #'+evil--embrace-latex)) (embrace-add-pair-regexp ?l "\\[a-z]+{" "}" #'+evil--embrace-latex))
(defun +evil-embrace-lisp-mode-hook-h ()
;; Avoid `embrace-add-pair-regexp' because it would overwrite the default
;; `f' rule, which we want for other modes
(push (cons ?f (make-embrace-pair-struct
:key ?f
:read-function #'+evil--embrace-elisp-fn
:left-regexp "([^ ]+ "
:right-regexp ")"))
embrace--pairs-list))
(defun +evil-embrace-angle-bracket-modes-hook-h () (defun +evil-embrace-angle-bracket-modes-hook-h ()
(let ((var (make-local-variable 'evil-embrace-evil-surround-keys))) (let ((var (make-local-variable 'evil-embrace-evil-surround-keys)))
(set var (delq ?< evil-embrace-evil-surround-keys)) (set var (delq ?< evil-embrace-evil-surround-keys))

View file

@ -40,15 +40,16 @@
free-keys free-keys
helm helm
help help
indent
image image
indent
kotlin-mode kotlin-mode
lispy
outline outline
replace replace
shortdoc shortdoc
simple simple
slime slime
lispy) tab-bar)
"A list of `evil-collection' modules to ignore. See the definition of this "A list of `evil-collection' modules to ignore. See the definition of this
variable for an explanation of the defaults (in comments). See variable for an explanation of the defaults (in comments). See
`evil-collection-mode-list' for a list of available options.") `evil-collection-mode-list' for a list of available options.")
@ -123,6 +124,7 @@ variable for an explanation of the defaults (in comments). See
dired dired
dired-sidebar dired-sidebar
disk-usage disk-usage
distel
doc-view doc-view
docker docker
ebib ebib
@ -131,9 +133,11 @@ variable for an explanation of the defaults (in comments). See
edebug edebug
ediff ediff
eglot eglot
elpaca
ement
explain-pause-mode explain-pause-mode
elfeed
eldoc eldoc
elfeed
elisp-mode elisp-mode
elisp-refs elisp-refs
elisp-slime-nav elisp-slime-nav
@ -167,7 +171,7 @@ variable for an explanation of the defaults (in comments). See
hg-histedit hg-histedit
hungry-delete hungry-delete
ibuffer ibuffer
image (image image-mode)
image-dired image-dired
image+ image+
imenu imenu
@ -179,6 +183,7 @@ variable for an explanation of the defaults (in comments). See
js2-mode js2-mode
leetcode leetcode
lispy lispy
lms
log-edit log-edit
log-view log-view
lsp-ui-imenu lsp-ui-imenu
@ -238,6 +243,7 @@ variable for an explanation of the defaults (in comments). See
snake snake
so-long so-long
speedbar speedbar
tab-bar
tablist tablist
tar-mode tar-mode
telega telega

View file

@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; editor/evil/packages.el ;;; editor/evil/packages.el
(package! evil :pin "9eb69b7f5b3c72cfc66f69b3242e935015780654") (package! evil :pin "5fc16776c5eb00c956ec7e9d83facb6a38dd868d")
(package! evil-args :pin "2671071a4a57eaee7cc8c27b9e4b6fc60fd2ccd3") (package! evil-args :pin "2671071a4a57eaee7cc8c27b9e4b6fc60fd2ccd3")
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9") (package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
(package! evil-embrace :pin "3081d37811b6a3dfaaf01d578c7ab7a746c6064d") (package! evil-embrace :pin "3081d37811b6a3dfaaf01d578c7ab7a746c6064d")
@ -35,4 +35,4 @@
(package! neotree) (package! neotree)
(autoload 'neotree-make-executor "neotree" nil nil 'macro)) (autoload 'neotree-make-executor "neotree" nil nil 'macro))
(package! evil-collection :pin "1ad283f5b7ac9320ac3d41bccfc71a52f714563a")) (package! evil-collection :pin "8be4b75c86bc637dbcd14be7522d6da06df1747e"))

View file

@ -31,7 +31,7 @@ This module adds file templates for blank files, powered by [[doom-package:yasni
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
File templates are automatically expanded when opening empty files who match one File templates are automatically expanded when opening empty files who match one
@ -47,13 +47,13 @@ A special command is available for inserting software licenses: ~M-x
+file-templates/insert-license~. +file-templates/insert-license~.
#+begin_quote #+begin_quote
📌 Licenses with a ~-bp~ suffix are boilerplate templates; i.e. shorter 󰐃 Licenses with a ~-bp~ suffix are boilerplate templates; i.e. shorter
versions intended for comment headers in code files. versions intended for comment headers in code files.
#+end_quote #+end_quote
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Adding new or changing existing file templates ** Adding new or changing existing file templates
@ -79,7 +79,7 @@ prefix and [[fn:+file-templates/insert-license]] will recognize them. E.g.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 /This module's appendix is incomplete./ [[doom-contrib-module:][Write more?]] 󱌣 /This module's appendix is incomplete./ [[doom-contrib-module:][Write more?]]
#+end_quote #+end_quote
** API ** API

View file

@ -15,9 +15,9 @@ PRED can either be a regexp string or a major mode symbol. PLIST may contain
these properties: these properties:
:when FUNCTION :when FUNCTION
Provides a secondary predicate. This function takes no arguments and is Provides a secondary predicate. This function takes the filename as an
executed from within the target buffer. If it returns nil, this rule will be argument and is executed from within the target buffer. If it returns nil,
skipped over. this rule will be skipped over.
:trigger STRING|FUNCTION :trigger STRING|FUNCTION
If a string, this is the yasnippet trigger keyword used to trigger the If a string, this is the yasnippet trigger keyword used to trigger the
target snippet. target snippet.

View file

@ -4,9 +4,7 @@
# -- # --
#include <iostream> #include <iostream>
using namespace std; auto main(int argc, char *argv[]) -> int {
int main(int argc, char *argv[]) {
$0 $0
return 0; return 0;

View file

@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# group: file templates
# contributor: Lorenzo Ravaglia
# --
#include <stdio.h>
int main(int argc, char *argv[]) {
$0
return 0;
}

View file

@ -48,7 +48,7 @@ the purpose of the module and the features/technology(ies) it provides.
# If this module has flags but you can't document them now, add a TODO to the # If this module has flags but you can't document them now, add a TODO to the
# heading and use: # heading and use:
#+begin_quote #+begin_quote
🔨 This module has flags, but they aren't documented yet. [[doom-contrib-module:][Document them?]] 󱌣 This module has flags, but they aren't documented yet. [[doom-contrib-module:][Document them?]]
#+end_quote #+end_quote
** Packages ** Packages
@ -66,7 +66,7 @@ the purpose of the module and the features/technology(ies) it provides.
# If this module installs packages, but you can't document them now, add a TODO # If this module installs packages, but you can't document them now, add a TODO
# to the heading and use: # to the heading and use:
#+begin_quote #+begin_quote
🔨 This module installs packages, but they aren't documented yet. [[doom-contrib-module:][Document 󱌣 This module installs packages, but they aren't documented yet. [[doom-contrib-module:][Document
them?]] them?]]
#+end_quote #+end_quote
@ -83,7 +83,7 @@ the purpose of the module and the features/technology(ies) it provides.
# If this module contains hacks, but you can't document them now, add a TODO to # If this module contains hacks, but you can't document them now, add a TODO to
# the heading and use: # the heading and use:
#+begin_quote #+begin_quote
🔨 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]] 󱌣 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]]
#+end_quote #+end_quote
** TODO Changelog ** TODO Changelog
@ -122,7 +122,7 @@ This module requires:
# If there are prerequisites but you can't document them yet, add TODO to the # If there are prerequisites but you can't document them yet, add TODO to the
# heading and use: # heading and use:
#+begin_quote #+begin_quote
🔨 /No installation steps have been documented./ [[doom-contrib-module:][Document them?]] 󱌣 /No installation steps have been documented./ [[doom-contrib-module:][Document them?]]
#+end_quote #+end_quote
* Usage * Usage
@ -130,12 +130,12 @@ This module requires:
# If this is left empty, add TODO to the heading and use: # If this is left empty, add TODO to the heading and use:
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
# If this section has incomplete content, add TODO to the heading and use: # If this section has incomplete content, add TODO to the heading and use:
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
* TODO Configuration * TODO Configuration
@ -144,12 +144,12 @@ This module requires:
# If this is left empty, add TODO to the heading and use: # If this is left empty, add TODO to the heading and use:
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
# If this section has incomplete content, add TODO to the heading and use: # If this section has incomplete content, add TODO to the heading and use:
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -188,10 +188,10 @@ Answer
# If this is left empty, add TODO to the heading and use: # If this is left empty, add TODO to the heading and use:
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote
# If this section has incomplete content, add TODO to the heading and use: # If this section has incomplete content, add TODO to the heading and use:
#+begin_quote #+begin_quote
🔨 /This module's appendix is incomplete./ [[doom-contrib-module:][Write more?]] 󱌣 /This module's appendix is incomplete./ [[doom-contrib-module:][Write more?]]
#+end_quote #+end_quote

View file

@ -23,7 +23,7 @@ marker, indent and syntax-based code folding for as many languages as possible.
** TODO Hacks ** TODO Hacks
#+begin_quote #+begin_quote
🔨 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]] 󱌣 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]]
#+end_quote #+end_quote
** TODO Changelog ** TODO Changelog
@ -37,7 +37,7 @@ marker, indent and syntax-based code folding for as many languages as possible.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
Emacs keybinds when [[doom-module::editor evil +everywhere]] is disabled: Emacs keybinds when [[doom-module::editor evil +everywhere]] is disabled:
@ -52,7 +52,7 @@ Emacs keybinds when [[doom-module::editor evil +everywhere]] is disabled:
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -65,5 +65,5 @@ Emacs keybinds when [[doom-module::editor evil +everywhere]] is disabled:
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -7,5 +7,5 @@
(when (modulep! :editor evil) (when (modulep! :editor evil)
(package! evil-vimish-fold :pin "b6e0e6b91b8cd047e80debef1a536d9d49eef31a")) (package! evil-vimish-fold :pin "b6e0e6b91b8cd047e80debef1a536d9d49eef31a"))
(when (modulep! :tools tree-sitter) (when (modulep! :tools tree-sitter)
(package! ts-fold :pin "9d9e0c5cf7b5397e06571bb6bf497598dc8796a8" (package! ts-fold :pin "75e72c658ad8d8aac3af554a6b51b3c5c22dd0aa"
:recipe (:host github :repo "emacs-tree-sitter/ts-fold"))) :recipe (:host github :repo "emacs-tree-sitter/ts-fold")))

View file

@ -3,44 +3,41 @@
#+created: July 26, 2020 #+created: July 26, 2020
#+since: 21.12.0 #+since: 21.12.0
#+begin_quote
🔨 This module has been scheduled for a rewrite. Its documentation will remain
incomplete and edge cases left unpatched in the meantime. A preview of this
rewrite can be found [[https://github.com/hlissner/doom-emacs-private/tree/master/modules/editor/format][in my private config]].
#+end_quote
* Description :unfold: * Description :unfold:
This module integrates code formatters into Emacs. Here are some of the Code style is something that's hotly debated since the beginning of time.
formatters that it currently supports:
#+begin_quote Tabs or spaces?
asmfmt, black, brittany, cabal-fmt, clang-format, cmake-format, dartfmt, dfmt, 2-width or 4-width indentation?
dhall format, dockfmt, elm-format, emacs, fish_indent, fprettify, gleam format,
gofmt, iStyle, jsonnetfmt, ktlint, latexindent, ledger-mode, lua-fmt, mix Which is right? Doom doesn't care, but we will try and make it easy for you to
format, nixfmt, node-cljfmt, ocp-indent, perltidy, prettier, purty, rufo, format code within the safety of Emacs.
rustfmt, scalafmt, script shfmt, snakefmt, sqlformat, styler, swiftformat, tidy
#+end_quote At present, the module wraps [[https://github.com/radian-software/apheleia/][apheleia]], which includes some more detail on the
internals of the package; but the long and short of it is on-save your code will
be formatted and returned to the buffer using
[[https://tools.ietf.org/doc/tcllib/html/rcs.html#section4][RCS patching]].
** Maintainers ** Maintainers
/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]] - [[doom-user:][@elken]]
[[doom-contrib-maintainer:][Become a maintainer?]]
** Module flags ** Module flags
- +onsave :: - +onsave ::
Enable reformatting of a buffer when it is saved. See Enable reformatting of a buffer when it is saved. See
[[var:+format-on-save-enabled-modes]] to control what major modes to (or not to) [[var:+format-on-save-disabled-modes]] to disable format on save for certain
format on save. major modes.
** Packages ** Packages
- [[doom-package:format-all]] - [[doom-package:apheleia]]
** Hacks ** Hacks
- format-all has been heavily modified to suit Doom's goals for this module: As of writing this, apheleia doesn't /yet/ support regions or similar kinds of
- Reformatted text is applied to the buffer by RCS patch, as to reduce its buffers, so there are a couple of hacks to attempt to rectify this.
affect on cursor position.
- Adds partial formatting, i.e. you can now reformat a subset of the buffer. For the most part, things should work as expected. However, because the
- Adds the ability to use any arbitrary formatter on the current buffer if you formatting occurs on an isolated version of the buffer; lisp/scheme or similarly
pass the universal argument to [[fn:+format/buffer]] or [[fn:+format/region]] (i.e. indentation-based languages may produce poor results.
removes the major-mode lock on formatters).
** TODO Changelog ** TODO Changelog
# This section will be machine generated. Don't edit it by hand. # This section will be machine generated. Don't edit it by hand.
@ -51,130 +48,112 @@ rustfmt, scalafmt, script shfmt, snakefmt, sqlformat, styler, swiftformat, tidy
This module has no direct requirements, but each language will need one of their This module has no direct requirements, but each language will need one of their
supported formatter programs in order for this to work. In their absence, supported formatter programs in order for this to work. In their absence,
[[doom-package:format-all]] will fail silently. [[doom-package:apheleia]] will fail silently.
Supported formatters: To see if a particular mode has a configured formatter, check for the mode in
- Angular/Vue (prettier) [[var:apheleia-mode-alist]] which corresponds to the list of formatters defined in
- Assembly (asmfmt) [[var:apheleia-formatters]]
- Bazel Starlark (buildifier)
- BibTeX (emacs)
- C/C++/Objective-C (clang-format)
- Cabal (cabal-fmt)
- Clojure/ClojureScript (node-cljfmt)
- CMake (cmake-format)
- Crystal (crystal tool format)
- CSS/Less/SCSS (prettier)
- D (dfmt)
- Dart (dartfmt)
- Dhall (dhall format)
- Dockerfile (dockfmt)
- Elixir (mix format)
- Elm (elm-format)
- Emacs Lisp (emacs)
- Fish Shell (fish_indent)
- Fortran 90 (fprettify)
- Gleam (gleam format)
- Go (gofmt)
- GraphQL (prettier)
- Haskell (brittany)
- HTML/XHTML/XML (tidy)
- Java (clang-format)
- JavaScript/JSON/JSX (prettier)
- Jsonnet (jsonnetfmt)
- Kotlin (ktlint)
- LaTeX (latexindent)
- Ledger (ledger-mode)
- Lua (lua-fmt)
- Markdown (prettier)
- Nix (nixfmt)
- OCaml (ocp-indent)
- Perl (perltidy)
- PHP (prettier plugin-php)
- Protocol Buffers (clang-format)
- PureScript (purty)
- Python (black)
- R (styler)
- Ruby (rufo)
- Rust (rustfmt)
- Scala (scalafmt)
- Shell script (shfmt)
- Snakemake (snakefmt)
- Solidity (prettier-plugin-solidity)
- SQL (sqlformat)
- Swift (swiftformat)
- Terraform (terraform fmt)
- TOML (prettier-plugin-toml)
- TypeScript/TSX (prettier)
- Verilog (iStyle)
- YAML (prettier)
* TODO Usage * Usage
#+begin_quote ** With +onsave
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] When this flag is enabled, you shouldn't need to do anything other than write
#+end_quote code and save it.
* TODO Configuration ** Without +onsave
#+begin_quote Without the flag, formatting will only occur when either =+format/buffer=
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] or =apheleia-format-buffer= is called. The difference between them is
#+end_quote =+format/buffer= will use a LSP server if configured and available.
** Automatic reformatting when saving buffers * Configuration
There are two ways to achieve this. Either through the =+onsave= flag, or by
adding ~format-all-mode~ to the hook of each major mode you want this behavior Detailed configuration can be found [[https://github.com/radian-software/apheleia/#user-guide][upstream]], but for most purposes here we
enabled in. provide a simple macro that looks like the below:
If you choose the former, what modes it applies to can be changed by modifying
~+format-on-save-enabled-modes~, which contains a list of major modes. If the
first item in the list is the symbol ~not~, the list is negated. This is its
default value:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq +format-on-save-enabled-modes (set-formatter! 'unique-name '("command" "line" "here") :modes '(name-of-major-mode))
'(not emacs-lisp-mode ; elisp's mechanisms are good enough
sql-mode ; sqlformat is currently broken
tex-mode ; latexindent is broken
latex-mode))
#+end_src #+end_src
If you want to format code when you save a buffer, but want more granular If you're trying to override a formatter that has previously been defined by
control over which major modes this behavior is enabled in, there is an Doom, you will need to ensure that the call in your config is contained within
alternative. Make sure [[doom-module:+onsave]] is disabled before you try this: an =after!= form, eg below to override Clojure's with =zprint=:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-hook 'python-mode-hook #'format-all-mode) (after! clojure-mode
(add-hook 'js2-mode-hook #'format-all-mode) (set-formatter! 'zprint '("zprint" "-") :modes '(clojure-mode)))
#+end_src #+end_src
There are a few bonus symbols that apheleia uses (for example =npx= will be
replaced by a correct path to npx) which are all documented in the link above.
** Disabling formatters
*** Permanently
To permanently disable a particular formatter with no provided alternative
#+begin_src emacs-lisp
(setq apheleia-formatters (delq (assoc 'csharpier apheleia-formatters) apheleia-formatters))
#+end_src
*** Per-buffer
If you want to save without formatting, this is done by first passing the
universal argument thus; =SPC u SPC f s= for evil users, =C-u C-x C-s= for non-evil
users.
If you want to save more than a handful of time, you can set
[[var:apheleia-inhibit]] to disable even if =apheleia-global-mode= is on.
*** Onsave only
This behaviour is controlled via [[var:+format-on-save-disabled-modes]] thus;
#+begin_src emacs-lisp
(setq +format-on-save-disabled-modes
'(emacs-lisp-mode ; elisp's mechanisms are good enough
sql-mode ; sqlformat is currently broken
tex-mode ; latexindent is broken
latex-mode))
#+end_src
In this case, =emacs-lisp-mode=, =sql-mode=, =tex-mode= and =latex-mode= will not be
formatted on save, but can still be formatted by manually invoking the commands
=+format/buffer= or =apheleia-format-buffer=.
** Disabling the LSP formatter ** Disabling the LSP formatter
If you are in a buffer with ~lsp-mode~ enabled and a server that supports If you are in a buffer with ~lsp-mode~ enabled and a server that supports
=textDocument/formatting=, it will be used instead of [[doom-package:format-all]]'s formatter. =textDocument/formatting=, it will be used instead of [[doom-package:apheleia]]'s formatter.
+ To disable this behavior universally use: ~(setq +format-with-lsp nil)~ + To disable this behavior universally use: ~(setq +format-with-lsp nil)~
+ To disable this behavior in one mode: ~(setq-hook! 'python-mode-hook + To disable this behavior in one mode: ~(setq-hook! 'python-mode-hook
+format-with-lsp nil)~ +format-with-lsp nil)~
** TODO Defining your own formatters ** Selecting a specific formatter for a particular buffer
See the ~set-formatter!~ function.
** TODO Selecting a specific formatter for a particular buffer
Set the buffer-local variable ~+format-with~ to the name of the formatter to Set the buffer-local variable ~+format-with~ to the name of the formatter to
use. e.g. use. e.g.
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; Overrides `apheleia-mode-alist`
(setq-hook! 'python-mode-hook +format-with 'html-tidy) (setq-hook! 'python-mode-hook +format-with 'html-tidy)
;; Or set it to `:none' to disable formatting ;; Or set it to `nil' to fallback to `apheleia-mode-alist`
(setq-hook! 'python-mode-hook +format-with :none) (setq-hook! 'python-mode-hook +format-with nil)
#+end_src #+end_src
Formatters are referred to by the name they were defined with. They can be Formatters are referred to by the name they were defined with. They can be
looked up in the ~format-all-mode-table~ hash table or in format-all's [[https://github.com/lassik/emacs-format-all-the-code/blob/master/format-all.el#L512][source looked up in the ~apheleia-mode-alist~ hash table.
code]].
* Troubleshooting * Troubleshooting
/There are no known problems with this module./ [[doom-report:][Report one?]] There are a few fail-safes apheleia has to prevent accidental code wipe,
included silently failing if the command errors or doesn't exist.
Check that the command you've specified runs fine in a terminal first before
reporting this as an issue.
If any errors are reported from the command, run =apheleia-goto-error= to jump to
the error buffer and handle any problems raised there.
Any issues specific to apheleia should most often be reported upstream [[https://github.com/radian-software/apheleia/issues][here]].
* Frequently asked questions * Frequently asked questions
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]] /This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -1,276 +1,86 @@
;;; editor/format/autoload.el -*- lexical-binding: t; -*- ;;; editor/format/autoload.el -*- lexical-binding: t; -*-
(defvar +format-region-p nil
"Is non-nil if currently reformatting a selected region, rather than the whole
buffer.")
;;;###autoload
(autoload 'format-all--probe "format-all")
(defun +format--delete-whole-line (&optional arg)
"Delete the current line without putting it in the `kill-ring'.
Derived from function `kill-whole-line'. ARG is defined as for that
function.
Stolen shamelessly from go-mode"
(setq arg (or arg 1))
(if (and (> arg 0)
(eobp)
(save-excursion (forward-visible-line 0) (eobp)))
(signal 'end-of-buffer nil))
(if (and (< arg 0)
(bobp)
(save-excursion (end-of-visible-line) (bobp)))
(signal 'beginning-of-buffer nil))
(cond ((zerop arg)
(delete-region (progn (forward-visible-line 0) (point))
(progn (end-of-visible-line) (point))))
((< arg 0)
(delete-region (progn (end-of-visible-line) (point))
(progn (forward-visible-line (1+ arg))
(unless (bobp)
(backward-char))
(point))))
((delete-region (progn (forward-visible-line 0) (point))
(progn (forward-visible-line arg) (point))))))
;;;###autoload
(defun +format--apply-rcs-patch (patch-buffer)
"Apply an RCS-formatted diff from PATCH-BUFFER to the current buffer.
Stolen shamelessly from go-mode"
(let ((target-buffer (current-buffer))
;; Relative offset between buffer line numbers and line numbers
;; in patch.
;;
;; Line numbers in the patch are based on the source file, so
;; we have to keep an offset when making changes to the
;; buffer.
;;
;; Appending lines decrements the offset (possibly making it
;; negative), deleting lines increments it. This order
;; simplifies the forward-line invocations.
(line-offset 0)
(column (current-column)))
(save-excursion
(with-current-buffer patch-buffer
(goto-char (point-min))
(while (not (eobp))
(unless (looking-at "^\\([ad]\\)\\([0-9]+\\) \\([0-9]+\\)")
(error "Invalid rcs patch or internal error in +format--apply-rcs-patch"))
(forward-line)
(let ((action (match-string 1))
(from (string-to-number (match-string 2)))
(len (string-to-number (match-string 3))))
(cond
((equal action "a")
(let ((start (point)))
(forward-line len)
(let ((text (buffer-substring start (point))))
(with-current-buffer target-buffer
(cl-decf line-offset len)
(goto-char (point-min))
(forward-line (- from len line-offset))
(insert text)))))
((equal action "d")
(with-current-buffer target-buffer
(goto-char (point-min))
(forward-line (1- (- from line-offset)))
(cl-incf line-offset len)
(+format--delete-whole-line len)))
((error "Invalid rcs patch or internal error in +format--apply-rcs-patch")))))))
(move-to-column column)))
(defun +format--current-indentation () (defun +format--current-indentation ()
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(skip-chars-forward " \t\n") (skip-chars-forward " \t\n")
(current-indentation))) (current-indentation)))
(defun +format-region (start end &optional callback)
;; "Format from START to END with `apheleia'."
;; Public library (when-let* ((command (apheleia--get-formatters
(if current-prefix-arg
(defun +format-completing-read () 'prompt
"TODO" 'interactive)))
(require 'format-all) (cur-buffer (current-buffer))
(let* ((fmtlist (mapcar #'symbol-name (hash-table-keys format-all--format-table))) (formatted-buffer (get-buffer-create " *apheleia-formatted*"))
(fmt (completing-read "Formatter: " fmtlist))) (indent 0))
(if fmt (intern fmt)))) (with-current-buffer formatted-buffer
(erase-buffer)
;;;###autoload (unless IS-WINDOWS
(defun +format-probe-a (fn) (setq-local coding-system-for-read 'utf-8)
"Use `+format-with' instead, if it is set. (setq-local coding-system-for-write 'utf-8))
Prompts for a formatter if universal arg is set." ;; Ensure this temp buffer seems as much like the origin buffer as
(cond ((or buffer-read-only (eq +format-with :none)) ;; possible, in case the formatter is an elisp function, like `gofmt'.
(list nil nil)) (cl-loop for (var . val)
(current-prefix-arg in (cl-remove-if-not #'listp (buffer-local-variables cur-buffer))
(list (or (+format-completing-read) ;; Making enable-multibyte-characters buffer-local causes an
(user-error "Aborted")) ;; error.
t)) unless (eq var 'enable-multibyte-characters)
(+format-with ;; Using setq-local would quote var.
(list +format-with t)) do (set (make-local-variable var) val))
((and +format-with-lsp ;;
(bound-and-true-p lsp-managed-mode) (insert-buffer-substring-no-properties cur-buffer start end)
(lsp-feature? "textDocument/formatting")) ;; Since we're piping a region of text to the formatter, remove any
(list 'lsp nil)) ;; leading indentation to make it look like a file.
((and +format-with-lsp (setq indent (+format--current-indentation))
(bound-and-true-p eglot--managed-mode) (when (> indent 0)
(eglot--server-capable :documentFormattingProvider)) (indent-rigidly (point-min) (point-max) (- indent)))
(list 'eglot nil)) ;;
((funcall fn)))) (apheleia-format-buffer
command
;;;###autoload (lambda ()
(defun +format-buffer-a (formatter mode-result) (with-current-buffer formatted-buffer
"Advice that extends `format-all-buffer--with' to: (when (> indent 0)
;; restore indentation without affecting new
1. Enable partial/region reformatting, while preserving leading indentation, ;; indentation
2. Applies changes via RCS patch, line by line, to protect buffer markers and (indent-rigidly (point-min) (point-max)
reduce cursor movement or window scrolling. (max 0 (- indent (+format--current-indentation)))))
(set-buffer-modified-p nil))
See `+format/buffer' for the interactive version of this function, and (with-current-buffer cur-buffer
`+format-buffer-h' to use as a `before-save-hook' hook." (delete-region start end)
(cond (insert-buffer-substring-no-properties formatted-buffer)
((eq formatter 'lsp) (when callback (funcall callback))
(call-interactively (kill-buffer formatted-buffer)))))))
(if +format-region-p #'lsp-format-region #'lsp-format-buffer)))
((eq formatter 'eglot)
(call-interactively
(if +format-region-p #'eglot-format #'eglot-format-buffer)))
((let ((f-function (gethash formatter format-all--format-table))
(executable (format-all--formatter-executable formatter))
(indent 0)
(old-line-number (line-number-at-pos))
(old-column (current-column)))
(pcase-let*
((`(,output ,errput)
;; To reliably format regions, rather than the whole buffer, and
;; `format-all' (and various formatting functions, like `gofmt') widen
;; the buffer, we must copy the region first.
(let ((output (buffer-substring-no-properties (point-min) (point-max)))
(origin-buffer (or (buffer-base-buffer) (current-buffer)))
;; Fixes #5133: some packages (like lsp-mode) can do a bunch
;; of complicated stuff in these hooks. Better to not have to
;; deal with any of them at all.
write-file-functions
before-save-hook
after-save-hook
kill-buffer-query-functions
kill-buffer-hook)
(with-temp-buffer
(with-silent-modifications
(insert output)
;; Ensure this temp buffer seems as much like the origin
;; buffer as possible, in case the formatter is an elisp
;; function, like `gofmt'.
(cl-loop for (var . val)
in (cl-remove-if-not #'listp (buffer-local-variables origin-buffer))
;; Making enable-multibyte-characters buffer-local
;; causes an error.
unless (eq var 'enable-multibyte-characters)
;; Fixes #5133: don't deal with complicated hook
;; functionality! This isn't a real buffer anyway.
unless (string-match-p (symbol-name var) "-\\(hook\\|functions\\)$")
;; Using setq-local would quote var.
do (set (make-local-variable var) val))
;; Since we're piping a region of text to the formatter, remove
;; any leading indentation to make it look like a file.
(setq indent (+format--current-indentation))
(when (> indent 0)
(indent-rigidly (point-min) (point-max) (- indent)))
(funcall f-function executable mode-result)))))
(`,status
(cond ((null output) :error)
((eq output t) :already-formatted)
(t :reformatted))))
(unwind-protect
(when (eq status :reformatted)
(let ((tmpfile (make-temp-file "doom-format"))
(patchbuf (get-buffer-create " *doom format patch*"))
(coding-system-for-read coding-system-for-read)
(coding-system-for-write coding-system-for-write))
(unless IS-WINDOWS
(setq coding-system-for-read 'utf-8
coding-system-for-write 'utf-8))
(unwind-protect
(progn
(with-current-buffer patchbuf
(erase-buffer))
(with-temp-file tmpfile
(erase-buffer)
(insert output)
(when (> indent 0)
;; restore indentation without affecting new
;; indentation
(indent-rigidly (point-min) (point-max)
(max 0 (- indent (+format--current-indentation))))))
(if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile))
(setq status :already-formatted)
(+format--apply-rcs-patch patchbuf)
(list output errput)))
(kill-buffer patchbuf)
(delete-file tmpfile))))
(format-all--show-or-hide-errors errput)
(goto-char (point-min))
(forward-line (1- old-line-number))
(let ((line-length (- (point-at-eol) (point-at-bol))))
(goto-char (+ (point) (min old-column line-length))))
(run-hook-with-args 'format-all-after-format-functions formatter status)
(message (pcase status
(:error "Formatting error")
(:already-formatted "Already formatted")
(:reformatted (format "Reformatted with %s" formatter))))))))))
;; ;;
;;; Commands ;;; Commands
(defun +format--org-region (beg end)
"Reformat the region within BEG and END.
If nil, BEG and/or END will default to the boundaries of the src block at point."
(let ((element (org-element-at-point)))
(save-excursion
(let* ((block-beg (save-excursion
(goto-char (org-babel-where-is-src-block-head element))
(line-beginning-position 2)))
(block-end (save-excursion
(goto-char (org-element-property :end element))
(skip-chars-backward " \t\n")
(line-beginning-position)))
(beg (if beg (max beg block-beg) block-beg))
(end (if end (min end block-end) block-end))
(lang (org-element-property :language element))
(major-mode (org-src-get-lang-mode lang)))
(if (eq major-mode 'org-mode)
(user-error "Cannot reformat an org src block in org-mode")
(+format/region beg end))))))
(defun +format--buffer ()
(if (and (eq major-mode 'org-mode)
(org-in-src-block-p t))
(+format--org-region (point-min) (point-max))
(if (called-interactively-p 'any)
(format-all-buffer)
(ignore-errors (format-all-buffer)))))
;;;###autoload ;;;###autoload
(defun +format/buffer () (defun +format/buffer (&optional arg)
"Reformat the current buffer using LSP or `format-all-buffer'." "Reformat the current buffer using LSP or `format-all-buffer'."
(interactive) (interactive "P")
(+format--buffer)) (call-interactively
(if (and +format-with-lsp
(bound-and-true-p lsp-mode)
(lsp-feature? "textDocument/formatting"))
#'lsp-format-buffer
#'apheleia-format-buffer)))
;;;###autoload ;;;###autoload
(defun +format/region (beg end) (defun +format/region (beg end &optional arg)
"Runs the active formatter on the lines within BEG and END. "Runs the active formatter on the lines within BEG and END.
WARNING: this may not work everywhere. It will throw errors if the region WARNING: this may not work everywhere. It will throw errors if the region
contains a syntax error in isolation. It is mostly useful for formatting contains a syntax error in isolation. It is mostly useful for formatting
snippets or single lines." snippets or single lines."
(interactive "rP") (interactive "rP")
(let ((+format-region-p t)) (if (and +format-with-lsp
(save-restriction (bound-and-true-p lsp-mode)
(narrow-to-region beg end) (lsp-feature? "textDocument/rangeFormatting"))
(+format--buffer)))) (call-interactively #'lsp-format-region)
(+format-region beg end)))
;;;###autoload ;;;###autoload
(defun +format/region-or-buffer () (defun +format/region-or-buffer ()
@ -281,13 +91,3 @@ is selected)."
(if (doom-region-active-p) (if (doom-region-active-p)
#'+format/region #'+format/region
#'+format/buffer))) #'+format/buffer)))
;;
;; Hooks
;;;###autoload
(defalias '+format-buffer-h #'+format/buffer
"Format the source code in the current buffer with minimal feedback.
Meant for `before-save-hook'.")

View file

@ -1,97 +1,10 @@
;;; editor/format/autoload/settings.el -*- lexical-binding: t; -*- ;;; editor/format/autoload/settings.el -*- lexical-binding: t; -*-
;; This must be redefined here because `format-all' only makes it available at
;; compile time.
(defconst +format-system-type
(cl-case system-type
(windows-nt 'windows)
(cygwin 'windows)
(darwin 'macos)
(gnu/linux 'linux)
(berkeley-unix
(save-match-data
(let ((case-fold-search t))
(cond ((string-match "freebsd" system-configuration) 'freebsd)
((string-match "openbsd" system-configuration) 'openbsd)
((string-match "netbsd" system-configuration) 'netbsd))))))
"Current operating system according to the format-all package.")
(defun +format--resolve-system (choices)
"Get first choice matching `format-all-system-type' from CHOICES."
(cl-loop for choice in choices
if (atom choice) return choice
else if (eql +format-system-type (car choice))
return (cadr choice)))
(defun +format--make-command (formatter &rest _)
`(format-all--buffer-thunk
(lambda (input)
(with-silent-modifications
(setq buffer-file-name ,(buffer-file-name (buffer-base-buffer))
default-directory ,default-directory)
(delay-mode-hooks (funcall ',major-mode))
(insert input)
(condition-case e
(progn
(doom-log "formatter (commandp) %s" #',formatter)
(call-interactively #',formatter)
(list nil ""))
(error (list t (error-message-string e))))))))
(defun +format--make-function (formatter &rest _)
`(progn
(doom-log "formatter (functionp) %s" #',formatter)
(format-all--buffer-thunk #',formatter)))
(defun +format--make-shell-command (command ok-statuses error-regexp)
(+format--make-shell-command-list (split-string command " " t)
ok-statuses error-regexp))
(defun +format--make-shell-command-list (command-list ok-statuses error-regexp)
`(let (args)
(dolist (arg ',command-list)
(cond ((stringp arg)
(push arg args))
((listp arg)
(catch 'skip
(let (subargs this)
(while (setq this (pop arg))
(cond ((not (stringp (car arg)))
(let ((val (eval (pop arg) t)))
(unless val (throw 'skip nil))
(push (format this val) subargs)))
((stringp this)
(push this subargs))))
(setq args (append subargs args)))))))
(doom-log "formatter (arglist) %s" args)
(if ,(and (or ok-statuses error-regexp) t)
(apply #'format-all--buffer-hard
',ok-statuses ,error-regexp nil
(reverse args))
(apply #'format-all--buffer-easy (reverse args)))))
(cl-defun +format--set (name &key function modes unset)
(declare (indent defun))
(when (and unset (not (gethash name format-all--format-table)))
(error "'%s' formatter does not exist to be unset" name))
(puthash name function format-all--format-table)
(dolist (mode (ensure-list modes))
(cl-destructuring-bind (m &optional probe)
(ensure-list mode)
(if unset
(puthash m (assq-delete-all name (gethash key format-all-mode-table))
format-all-mode-table)
(format-all--pushhash
m (cons name (if probe `(lambda () ,probe)))
format-all--mode-table)))))
;;;###autodef ;;;###autodef
(cl-defun set-formatter! (cl-defun set-formatter! (name args &key modes)
(name formatter &key modes filter ok-statuses error-regexp)
"Define (or modify) a formatter named NAME. "Define (or modify) a formatter named NAME.
Supported keywords: :modes :filter :ok-statuses :error-regexp Supported keywords: :modes
NAME is a symbol that identifies this formatter. NAME is a symbol that identifies this formatter.
@ -99,7 +12,7 @@ FORMATTER can be a symbol referring to another formatter, a function, string or
nested list. nested list.
If a function, it should be a formatter function that If a function, it should be a formatter function that
`format-all--buffer-thunk' will accept. `apheleia--run-formatter-function' will accept.
If a string, it is assumed to be a shell command that the buffer's text will If a string, it is assumed to be a shell command that the buffer's text will
be piped to (through stdin). be piped to (through stdin).
If a list, it should represent a shell command as a list of arguments. Each If a list, it should represent a shell command as a list of arguments. Each
@ -107,6 +20,13 @@ nested list.
string and ARG is both a predicate and argument for STRING. If ARG is nil, string and ARG is both a predicate and argument for STRING. If ARG is nil,
STRING will be omitted from the vector. STRING will be omitted from the vector.
If you're trying to override this, ensure that you wrap the call in `after!' and
whichever package sets the initial formatter. See the ':editor format' README
for more.
For more information on how to structure the list to be compatible, see
`apheleia--run-formatter-function'.
MODES is a major mode, a list thereof, or a list of two-element sublists with MODES is a major mode, a list thereof, or a list of two-element sublists with
the structure: (MAJOR-MODE FORM). FORM is evaluated when the buffer is formatted the structure: (MAJOR-MODE FORM). FORM is evaluated when the buffer is formatted
and its return value serves two purposes: and its return value serves two purposes:
@ -116,88 +36,56 @@ and its return value serves two purposes:
2. It's return value is made available to FORMATTER if it is a function or 2. It's return value is made available to FORMATTER if it is a function or
list of shell arguments via the `mode-result' variable. list of shell arguments via the `mode-result' variable.
FILTER is a function that takes three arguments: the formatted output, any error
output and the position of the first change. This function must return these
three after making whatever changes you like to them. This might be useful if
the output contains ANSI color codes that need to be stripped out (as is the
case with elm-format).
OK-STATUSES and ERROR-REGEXP are ignored if FORMATTER is not a shell command.
OK-STATUSES is a list of integer exit codes that should be treated as success
codes. However, if ERROR-REGEXP is given, and the program's stderr contains that
regexp, then the formatting is considered failed even if the exit status is in
OK-STATUSES.
Basic examples: Basic examples:
(set-formatter! \\='asmfmt \"asmfmt\" :modes \\='(asm-mode nasm-mode))
(set-formatter! 'asmfmt \"asmfmt\" :modes '(asm-mode nasm-mode)) (set-formatter! \\='black \"black -q -\")
(set-formatter! 'black \"black -q -\") (set-formatter! \\='html-tidy \"tidy -q -indent\" :modes \\='(html-mode web-mode))
(set-formatter! 'html-tidy \"tidy -q -indent\" :modes '(html-mode web-mode))
Advanced examples: Advanced examples:
(set-formatter! (set-formatter!
'clang-format \\='clang-format
'(\"clang-format\" \\='(\"clang-format\"
(\"-assume-filename=%S\" (or buffer-file-name mode-result \"\"))) (\"-assume-filename=%S\" (or buffer-file-name mode-result \"\")))
:modes :modes
'((c-mode \".c\") \\='((c-mode \".c\")
(c++-mode \".cpp\") (c++-mode \".cpp\")
(java-mode \".java\") (java-mode \".java\")
(objc-mode \".m\") (objc-mode \".m\")
(protobuf-mode \".proto\"))) (protobuf-mode \".proto\")))
(set-formatter! 'html-tidy (set-formatter! \\='html-tidy
'(\"tidy\" \"-q\" \"-indent\" \\='(\"tidy\" \"-q\" \"-indent\"
(\"-xml\" (memq major-mode '(nxml-mode xml-mode)))) (\"-xml\" (memq major-mode \\='(nxml-mode xml-mode))))
:modes :modes
'(html-mode \\='(html-mode
(web-mode (and (equal \"none\" web-mode-engine) (web-mode (and (equal \"none\" web-mode-engine)
(car (member web-mode-content-type '(\"xml\" \"html\")))))) (car (member web-mode-content-type \\='(\"xml\" \"html\")))))))
:ok-statuses '(0 1)
:executable \"tidy\")
(set-formatter! 'html-tidy ; overwrite predefined html-tidy formatter (set-formatter! \\='html-tidy ; overwrite predefined html-tidy formatter
'(\"tidy\" \"-q\" \"-indent\" \\='(\"tidy\" \"-q\" \"-indent\"
\"--tidy-mark\" \"no\" \"--tidy-mark\" \"no\"
\"--drop-empty-elements\" \"no\" \"--drop-empty-elements\" \"no\"
\"--show-body-only\" \"auto\" \"--show-body-only\" \"auto\"
(\"--indent-spaces\" \"%d\" tab-width) (\"--indent-spaces\" \"%d\" tab-width)
(\"--indent-with-tabs\" \"%s\" (if indent-tabs-mode \"yes\" \"no\")) (\"--indent-with-tabs\" \"%s\" (if indent-tabs-mode \"yes\" \"no\"))
(\"-xml\" (memq major-mode '(nxml-mode xml-mode)))) (\"-xml\" (memq major-mode \\='(nxml-mode xml-mode)))))
:ok-statuses '(0 1)))
(set-formatter! 'elm-format (set-formatter! \\='elm-format
\"elm-format --yes --stdin\" \"elm-format --yes --stdin\")"
:filter
(lambda (output errput first-diff)
(list output
(format-all--remove-ansi-color errput)
first-diff)))"
(declare (indent defun)) (declare (indent defun))
(cl-check-type name symbol) (cl-check-type name symbol)
(after! format-all (after! apheleia
(if (null formatter) (if (null args)
(+format--set name (progn
:unset t (setq apheleia-formatters
:modes modes) (assq-delete-all name apheleia-formatters))
(let ((fn (funcall (cond ((stringp formatter) (while (rassoc name apheleia-mode-alist)
#'+format--make-shell-command) (setq apheleia-mode-alist
((listp formatter) (assq-delete-all (car (rassoc name apheleia-mode-alist)) apheleia-mode-alist))))
#'+format--make-shell-command-list) (let ((formatter (cond
((and (commandp formatter) ((listp args) `(,@args))
(not (stringp formatter))) (t args))))
#'+format--make-command) (setf (alist-get name apheleia-formatters) formatter))
((functionp formatter) (when modes
#'+format--make-function)) (dolist (mode modes)
formatter (setf (alist-get mode apheleia-mode-alist) name))))))
ok-statuses
error-regexp)))
(cl-check-type filter (or function null))
(+format--set name
:function
`(lambda (executable mode-result)
,(if filter `(apply #',filter ,fn) fn))
:modes modes)
name))))

View file

@ -1,18 +1,14 @@
;;; editor/format/config.el -*- lexical-binding: t; -*- ;;; editor/format/config.el -*- lexical-binding: t; -*-
(defvar +format-on-save-enabled-modes (defvar +format-on-save-disabled-modes
'(not emacs-lisp-mode ; elisp's mechanisms are good enough '(sql-mode ; sqlformat is currently broken
sql-mode ; sqlformat is currently broken tex-mode ; latexindent is broken
tex-mode ; latexindent is broken latex-mode
latex-mode org-msg-edit-mode) ; doesn't need a formatter
org-msg-edit-mode) ; doesn't need a formatter "A list of major modes in which to not reformat the buffer upon saving.
"A list of major modes in which to reformat the buffer upon saving. If it is t, it is disabled in all modes, the same as if the +onsave flag
wasn't used at all.
If this list begins with `not', then it negates the list. If nil, formatting is enabled in all modes.
If it is `t', it is enabled in all modes.
If nil, it is disabled in all modes, the same as if the +onsave flag wasn't
used at all.
Irrelevant if you do not have the +onsave flag enabled for this module.") Irrelevant if you do not have the +onsave flag enabled for this module.")
(defvar +format-preserve-indentation t (defvar +format-preserve-indentation t
@ -21,69 +17,59 @@ buffer. This is particularly useful for partials.
Indentation is always preserved when formatting regions.") Indentation is always preserved when formatting regions.")
(defvar-local +format-with nil
"Set this to explicitly use a certain formatter for the current buffer.")
(defvar +format-with-lsp t (defvar +format-with-lsp t
"If non-nil, format with LSP formatter if it's available. "If non-nil, format with LSP formatter if it's available.
This can be set buffer-locally with `setq-hook!' to disable LSP formatting in This can be set buffer-locally with `setq-hook!' to disable LSP formatting in
select buffers.") select buffers.
This has no effect on the +onsave flag, apheleia will always be used there.")
(defvaralias '+format-with 'apheleia-formatter
"Set this to explicitly use a certain formatter for the current buffer.")
;; ;;
;;; Bootstrap ;;; Bootstrap
(add-to-list 'doom-debug-variables 'format-all-debug)
(defun +format-enable-on-save-maybe-h ()
"Enable formatting on save in certain major modes.
This is controlled by `+format-on-save-enabled-modes'."
(or (cond ((eq major-mode 'fundamental-mode))
((string-prefix-p " " (buffer-name)))
((and (booleanp +format-on-save-enabled-modes)
(not +format-on-save-enabled-modes)))
((and (listp +format-on-save-enabled-modes)
(if (eq (car +format-on-save-enabled-modes) 'not)
(memq major-mode (cdr +format-on-save-enabled-modes))
(not (memq major-mode +format-on-save-enabled-modes)))))
((not (require 'format-all nil t))))
(format-all-mode +1)))
(when (modulep! +onsave) (when (modulep! +onsave)
(add-hook 'after-change-major-mode-hook #'+format-enable-on-save-maybe-h)) (add-hook 'doom-first-file-hook #'apheleia-global-mode))
(defun +format-maybe-inhibit-h ()
"Check if formatting should be disabled for current buffer.
This is controlled by `+format-on-save-disabled-modes'."
(or (eq major-mode 'fundamental-mode)
(string-blank-p (buffer-name))
(eq +format-on-save-disabled-modes t)
(not (null (memq major-mode +format-on-save-disabled-modes)))))
(after! apheleia
(add-to-list 'doom-debug-variables '(apheleia-log-only-errors . nil))
(when (modulep! +onsave)
(add-to-list 'apheleia-inhibit-functions #'+format-maybe-inhibit-h)))
;; ;;
;;; Hacks ;;; Hacks
;; Allow a specific formatter to be used by setting `+format-with', either (defadvice! +format--inhibit-reformat-on-prefix-arg-a (orig-fn &optional arg)
;; buffer-locally or let-bound. "Make it so \\[save-buffer] with prefix arg inhibits reformatting."
(advice-add #'format-all--probe :around #'+format-probe-a) :around #'save-buffer
(let ((apheleia-mode (and apheleia-mode (memq arg '(nil 1)))))
(funcall orig-fn)))
;; Doom uses a modded `format-all-buffer', which (add-hook!
;; 1. Enables partial reformatting (while preserving leading indentation), 'apheleia-post-format-hook
;; 2. Applies changes via RCS patch, line by line, to protect buffer markers ;; HACK `web-mode' doesn't update syntax highlighting after arbitrary buffer
;; and avoid any jarring cursor+window scrolling. ;; modifications, so we must trigger refontification manually.
(advice-add #'format-all-buffer--with :override #'+format-buffer-a) (defun +format--fix-web-mode-fontification-h ()
(when (eq major-mode 'web-mode)
(setq web-mode-fontification-off nil)
(when (and web-mode-scan-beg web-mode-scan-end global-font-lock-mode)
(save-excursion
(font-lock-fontify-region web-mode-scan-beg web-mode-scan-end)))))
;; format-all-mode "helpfully" raises an error when it doesn't know how to (defun +format--refresh-git-gutter-h ()
;; format a buffer. (when (fboundp '+vc-gutter-update-h)
(add-to-list 'debug-ignored-errors "^Don't know how to format ") (+vc-gutter-update-h))))
;; Don't pop up imposing warnings about missing formatters, but still log it in
;; to *Messages*.
(defadvice! +format--all-buffer-from-hook-a (fn &rest args)
:around #'format-all-buffer--from-hook
(letf! (defun format-all-buffer--with (formatter mode-result)
(when (or (eq formatter 'lsp)
(eq formatter 'eglot)
(condition-case-unless-debug e
(format-all--formatter-executable formatter)
(error
(message "Warning: cannot reformat buffer because %S isn't installed"
(gethash formatter format-all--executable-table))
nil)))
(funcall format-all-buffer--with formatter mode-result)))
(apply fn args)))

View file

@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; editor/format/packages.el ;;; editor/format/packages.el
(package! format-all :pin "47d862d40a088ca089c92cd393c6dca4628f87d3") (package! apheleia :pin "56651724ad22f2769bbdaccf54cbe75c1cb35c91")

View file

@ -1,103 +0,0 @@
;; -*- no-byte-compile: t; -*-
;;; editor/format/test/test-format.el
(load! "../autoload/settings")
(load! "../autoload/format")
(require! :editor format)
(require 'format-all)
;;
(describe "editor/format"
:var (format-all--format-table
format-all--mode-table)
(before-each
(setq format-all--format-table (make-hash-table)
format-all--mode-table (make-hash-table)))
(describe "set-formatter!"
(before-each
(set-formatter! 'test (lambda () (interactive))))
(it "defines a formatter"
(set-formatter! 'new (lambda () (interactive)))
(expect (gethash 'new format-all--mode-table) :to-equal nil)
(expect (functionp (gethash 'new format-all--format-table))))
(it "defines a formatter with modes"
(set-formatter! 'new (lambda () (interactive))
:modes '(a-mode (b-mode "x")))
(expect (gethash 'a-mode format-all--mode-table)
:to-equal '((new)))
(expect (gethash 'b-mode format-all--mode-table)
:to-equal '((new . (lambda () "x")))))
(it "replaces a pre-existing formatter"
(let ((old-fn (gethash 'test format-all--format-table)))
(set-formatter! 'test "echo")
(expect (gethash 'test format-all--format-table) :not :to-equal old-fn)))
(it "unsets a pre-existing formatter"
(set-formatter! 'test nil)
(expect (gethash 'test format-all--format-table) :to-be nil))
(it "errors when unsetting non-existent formatter"
(expect (set-formatter! 'doesnt-exist nil) :to-throw)))
;; TODO
(xdescribe "hooks"
(describe "format|enable-on-save-maybe")
(describe "format|enable-on-save"))
;; TODO
(xdescribe "formatting"
(before-each
(set-formatter! 'command
(lambda ()
(interactive)
(let ((first-line (car (split-string (buffer-string) "\n"))))
(erase-buffer)
(insert first-line)))
:modes '(text-mode))
(set-formatter! 'faulty-command
(lambda ()
(interactive)
(error "This is a test"))
:modes '(text-mode))
(set-formatter! 'function
(lambda (input)
(insert (car (split-string input "\n")))
(list nil nil))
:modes '(text-mode))
(set-formatter! 'shellcmd "head -n 1"
:modes '(text-mode))
(set-formatter! 'cmdlist '("head" "-n" "1")
:modes '(text-mode)))
(describe "with an interactive command"
(it "formats a buffer" )
(it "formats a region" )
(it "no-ops if no change" )
(it "doesn't modify the buffer in case of errors" )
(it "preserves indentation" ))
(describe "with a function"
(it "formats a buffer" )
(it "formats a region" )
(it "no-ops if no change" )
(it "doesn't modify the buffer in case of errors" )
(it "preserves indentation" ))
(describe "with a shell command")
(describe "with a shell command list"
(it "formats a buffer" )
(it "formats a region" )
(it "no-ops if no change" )
(it "doesn't modify the buffer in case of errors" )
(it "preserves indentation" )
(it "interpolates non-strings into format strings" )
(it "conditionally appends sublisted options" ))))

View file

@ -4,7 +4,7 @@
#+since: 21.12.0 #+since: 21.12.0
#+begin_quote #+begin_quote
🚧 *This module is deprecated.* ~god-mode~ is EOL and no longer maintained. *This module is deprecated.* ~god-mode~ is EOL and no longer maintained.
#+end_quote #+end_quote
* Description :unfold: * Description :unfold:
@ -35,12 +35,12 @@ mode.
* Usage * Usage
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Configuration * Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -51,5 +51,5 @@ mode.
* Appendix * Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -41,7 +41,7 @@ languages:
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
If [[doom-module::editor evil]] is enabled, [[doom-package:lispyville]] would also be activated for every mode If [[doom-module::editor evil]] is enabled, [[doom-package:lispyville]] would also be activated for every mode
@ -49,7 +49,7 @@ where [[doom-package:lispy]] is active.
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
The default key themes that are set are as follows: The default key themes that are set are as follows:
@ -102,5 +102,5 @@ Emacs receives when you scroll with your mouse wheel.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -1,6 +1,6 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; editor/lispyville/packages.el ;;; editor/lispyville/packages.el
(package! lispy :pin "097dd66e662c3eee90d112d88bac5345d26e508f") (package! lispy :pin "fe44efd21573868638ca86fc8313241148fabbe3")
(when (modulep! :editor evil) (when (modulep! :editor evil)
(package! lispyville :pin "14ee8711d58b649aeac03581d22b10ab077f06bd")) (package! lispyville :pin "14ee8711d58b649aeac03581d22b10ab077f06bd"))

View file

@ -39,7 +39,7 @@ evil) that loosely take after multi-cursors in Atom or Sublime Text.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** evil-mc ** evil-mc
@ -63,7 +63,7 @@ Designates "interactive edit" regions. Only the textual changes to them are mirr
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -74,5 +74,5 @@ Designates "interactive edit" regions. Only the textual changes to them are mirr
* Appendix * Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -4,6 +4,6 @@
(cond (cond
((modulep! :editor evil) ((modulep! :editor evil)
(package! evil-multiedit :pin "23b53bc8743fb82a8854ba907b1d277374c93a79") (package! evil-multiedit :pin "23b53bc8743fb82a8854ba907b1d277374c93a79")
(package! evil-mc :pin "63fd2fe0c213a4cc31c464d246f92931c4cb720f")) (package! evil-mc :pin "bdf893ea6f52fd0f10bece8ddae813658e17bbb4"))
((package! multiple-cursors :pin "16223efc2d6dece2d43bbccc189d7a4bab6de571"))) ((package! multiple-cursors :pin "234806c832994cadedb42596fe235e91bbd59e8c")))

View file

@ -34,18 +34,18 @@ or Kakoune and tries to align them with regular Emacs conventions.
/This module has no external requirements./ /This module has no external requirements./
#+begin_quote #+begin_quote
🚧 This module is incompatible with [[doom-module::editor evil]]. Do not enable them both at This module is incompatible with [[doom-module::editor evil]]. Do not enable them both at
the same time or you will get errors. the same time or you will get errors.
#+end_quote #+end_quote
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -56,5 +56,5 @@ or Kakoune and tries to align them with regular Emacs conventions.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -31,7 +31,7 @@ This module requires [[https://github.com/justinbarclay/parinfer-rust-mode#parin
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Keybindings ** Keybindings
@ -42,7 +42,7 @@ This module requires [[https://github.com/justinbarclay/parinfer-rust-mode#parin
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -53,5 +53,5 @@ This module requires [[https://github.com/justinbarclay/parinfer-rust-mode#parin
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; editor/parinfer/packages.el ;;; editor/parinfer/packages.el
(package! parinfer-rust-mode :pin "332c7f47426f0519dc5c24dda82afdb1aa8b61ee") (package! parinfer-rust-mode :pin "6e6bdeeba32534acca5928fe4201ce013094988d")

View file

@ -33,7 +33,7 @@ keywords or text patterns at point, like ~true~ and ~false~, or ~public~,
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
For evil users: [[kbd:][[r]] and [[kbd:][]r]] will cycle back and forward (respectively) through For evil users: [[kbd:][[r]] and [[kbd:][]r]] will cycle back and forward (respectively) through
@ -42,7 +42,7 @@ through them.
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
To enable a set of items to cycle through globally: To enable a set of items to cycle through globally:
@ -73,5 +73,5 @@ described above.
* Appendix * Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -21,7 +21,7 @@ This module adds snippet expansions to Emacs, powered by [[doom-package:yasnippe
** TODO Hacks ** TODO Hacks
#+begin_quote #+begin_quote
🔨 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]] 󱌣 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]]
#+end_quote #+end_quote
** TODO Changelog ** TODO Changelog
@ -35,12 +35,12 @@ This module adds snippet expansions to Emacs, powered by [[doom-package:yasnippe
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Disabling the built-in snippets ** Disabling the built-in snippets
@ -62,5 +62,5 @@ Custom snippets should be added under =$DOOMDIR/snippets/= directory. Refer to [
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -33,7 +33,13 @@ ignored. This makes it easy to override built-in snippets with private ones."
(unless (file-directory-p dir) (unless (file-directory-p dir)
(if (y-or-n-p (format "%S doesn't exist. Create it?" (abbreviate-file-name dir))) (if (y-or-n-p (format "%S doesn't exist. Create it?" (abbreviate-file-name dir)))
(make-directory dir t) (make-directory dir t)
(error "%S doesn't exist" (abbreviate-file-name dir))))) (error "%S doesn't exist" (abbreviate-file-name dir))))
dir)
(defun +snippets--use-snippet-file-name-p (snippet-file-name)
(or (not (file-exists-p snippet-file-name))
(y-or-n-p (format "%s exists. Overwrite it?"
(abbreviate-file-name snippet-file-name)))))
(defun +snippet--get-template-by-uuid (uuid &optional mode) (defun +snippet--get-template-by-uuid (uuid &optional mode)
"Look up the template by uuid in child-most to parent-most mode order. "Look up the template by uuid in child-most to parent-most mode order.
@ -45,25 +51,30 @@ Finds correctly active snippets from parent modes (based on Yas' logic)."
return it)) return it))
(defun +snippet--completing-read-uuid (prompt all-snippets &rest args) (defun +snippet--completing-read-uuid (prompt all-snippets &rest args)
(plist-get (let* ((completion-uuid-alist
(text-properties-at (cl-loop for (_ . tpl) in (mapcan #'yas--table-templates
0 (apply #'completing-read prompt (if all-snippets
(cl-loop for (_ . tpl) in (mapcan #'yas--table-templates (if all-snippets (hash-table-values yas--tables)
(hash-table-values yas--tables) (yas--get-snippet-tables)))
(yas--get-snippet-tables)))
for txt = (format "%-25s%-30s%s" for txt = (format "%-25s%-30s%s"
(yas--template-key tpl) (yas--template-key tpl)
(yas--template-name tpl) (yas--template-name tpl)
(abbreviate-file-name (yas--template-load-file tpl))) (abbreviate-file-name (yas--template-load-file tpl)))
collect collect
(progn (cons txt (yas--template-uuid tpl))))
(set-text-properties 0 (length txt) `(uuid ,(yas--template-uuid tpl) (completion (apply #'completing-read prompt completion-uuid-alist args)))
path ,(yas--template-load-file tpl)) (alist-get completion completion-uuid-alist nil nil #'string=)))
txt)
txt)) (defun +snippets--snippet-mode-name-completing-read (&optional all-modes)
args)) (cond (all-modes (completing-read
'uuid)) "Select snippet mode: "
obarray
(lambda (sym)
(string-match-p "-mode\\'" (symbol-name sym)))))
((not (null yas--extra-modes)) (completing-read "Select snippet mode: "
(cons major-mode yas--extra-modes)))
(t (symbol-name major-mode))))
(defun +snippet--abort () (defun +snippet--abort ()
(interactive) (interactive)
@ -193,25 +204,30 @@ buggy behavior when <delete> is pressed in an empty field."
(user-error "Cannot find template with UUID %S" template-uuid))) (user-error "Cannot find template with UUID %S" template-uuid)))
;;;###autoload ;;;###autoload
(defun +snippets/new () (defun +snippets/new (&optional all-modes)
"Create a new snippet in `+snippets-dir'." "Create a new snippet in `+snippets-dir'.
(interactive)
(let ((default-directory If there are extra yasnippet modes active, or if ALL-MODES is non-nil, you will
(expand-file-name (symbol-name major-mode) be prompted for the mode for which to create the snippet."
+snippets-dir))) (interactive "P")
(+snippet--ensure-dir default-directory) (let* ((mode (+snippets--snippet-mode-name-completing-read all-modes))
(with-current-buffer (switch-to-buffer "untitled-snippet") (default-directory (+snippet--ensure-dir (expand-file-name mode +snippets-dir)))
(snippet-mode) (snippet-key (read-string "Enter a key for the snippet: "))
(erase-buffer) (snippet-file-name (expand-file-name snippet-key)))
(yas-expand-snippet (concat "# -*- mode: snippet -*-\n" (when (+snippets--use-snippet-file-name-p snippet-file-name)
"# name: $1\n" (with-current-buffer (switch-to-buffer snippet-key)
"# uuid: $2\n" (snippet-mode)
"# key: ${3:trigger-key}${4:\n" (erase-buffer)
"# condition: t}\n" (set-visited-file-name snippet-file-name)
"# --\n" (yas-expand-snippet (concat "# -*- mode: snippet -*-\n"
"$0")) "# name: $1\n"
(when (bound-and-true-p evil-local-mode) "# uuid: $2\n"
(evil-insert-state))))) "# key: ${3:" snippet-key "}${4:\n"
"# condition: t}\n"
"# --\n"
"$0"))
(when (bound-and-true-p evil-local-mode)
(evil-insert-state))))))
;;;###autoload ;;;###autoload
(defun +snippets/new-alias (template-uuid) (defun +snippets/new-alias (template-uuid)
@ -224,21 +240,26 @@ You will be prompted for a snippet to alias."
current-prefix-arg))) current-prefix-arg)))
(unless (require 'doom-snippets nil t) (unless (require 'doom-snippets nil t)
(user-error "This command requires the `doom-snippets' library bundled with Doom Emacs")) (user-error "This command requires the `doom-snippets' library bundled with Doom Emacs"))
(let ((default-directory (expand-file-name (symbol-name major-mode) +snippets-dir))) (let* ((default-directory (+snippet--ensure-dir (expand-file-name
(+snippet--ensure-dir default-directory) (symbol-name major-mode)
(with-current-buffer (switch-to-buffer "untitled-snippet") +snippets-dir)))
(snippet-mode) (alias-key (read-string "Enter a key for the alias: "))
(erase-buffer) (alias-file-name (expand-file-name alias-key)))
(yas-expand-snippet (when (+snippets--use-snippet-file-name-p alias-file-name)
(concat "# -*- mode: snippet -*-\n" (with-current-buffer (switch-to-buffer alias-key)
"# name: $1\n" (snippet-mode)
"# key: ${2:trigger-key}${3:\n" (erase-buffer)
"# condition: t}\n" (set-visited-file-name alias-file-name)
"# type: command\n" (yas-expand-snippet
"# --\n" (concat "# -*- mode: snippet -*-\n"
"(%alias \"${4:" (or template-uuid "uuid") "}\")")) "# name: $1\n"
(when (bound-and-true-p evil-local-mode) "# key: ${2:" alias-key "}${3:\n"
(evil-insert-state))))) "# condition: t}\n"
"# type: command\n"
"# --\n"
"(doom-snippets-expand :uuid \"${4:" (or template-uuid "uuid") "}\")"))
(when (bound-and-true-p evil-local-mode)
(evil-insert-state))))))
;;;###autoload ;;;###autoload
(defun +snippets/edit (template-uuid) (defun +snippets/edit (template-uuid)

View file

@ -1,10 +1,10 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; editor/snippets/packages.el ;;; editor/snippets/packages.el
(package! yasnippet :pin "5cbdbf0d2015540c59ed8ee0fcf4788effdf75b6") (package! yasnippet :pin "76e1eee654ea9479ba1441f9c17567694e6a2096")
(package! auto-yasnippet :pin "6a9e406d0d7f9dfd6dff7647f358cb05a0b1637e") (package! auto-yasnippet :pin "6a9e406d0d7f9dfd6dff7647f358cb05a0b1637e")
(package! doom-snippets (package! doom-snippets
:recipe (:host github :recipe (:host github
:repo "doomemacs/snippets" :repo "doomemacs/snippets"
:files (:defaults "*")) :files (:defaults "*"))
:pin "fe4003014ae00b866f117cb193f711fd9d72fd11") :pin "d490cba6d762e69b483be308bc387c1f785742f0")

View file

@ -33,12 +33,12 @@ lines in the buffer without modifying the buffer content.
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
** Activation ** Activation
@ -116,5 +116,5 @@ modes like ~org-mode~ which handle prefix indentation themselves.
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -1,5 +1,5 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; editor/word-wrap/packages.el ;;; editor/word-wrap/packages.el
(package! adaptive-wrap :pin "0d5b4a07de76d87dd64333a566a8a0a845f2b9f0") (package! adaptive-wrap :pin "fc9f0306f14c3859c9903b0a0336478bf070c943")
(package! visual-fill-column :pin "695a59789209c42fa08a5bce92963ee32f4455be") (package! visual-fill-column :pin "695a59789209c42fa08a5bce92963ee32f4455be")

View file

@ -16,7 +16,7 @@ This module provides reasonable defaults and augmentations for dired.
Enables dired to be more like [[https://github.com/ranger/ranger][ranger]]. Enables dired to be more like [[https://github.com/ranger/ranger][ranger]].
** Packages ** Packages
- [[doom-package:all-the-icons-dired]] if [[doom-module:+icons]] - [[doom-package:nerd-icons-dired]] if [[doom-module:+icons]]
- [[doom-package:diff-hl]] - [[doom-package:diff-hl]]
- [[doom-package:diredfl]] - [[doom-package:diredfl]]
- [[doom-package:dired-rsync]] - [[doom-package:dired-rsync]]
@ -25,7 +25,7 @@ This module provides reasonable defaults and augmentations for dired.
** TODO Hacks ** TODO Hacks
#+begin_quote #+begin_quote
🔨 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]] 󱌣 This module's hacks haven't been documented yet. [[doom-contrib-module:][Document them?]]
#+end_quote #+end_quote
** TODO Changelog ** TODO Changelog
@ -40,13 +40,13 @@ This module has no requirements *except on BSDs* like MacOS or FreeBSD, where
* TODO Usage * TODO Usage
#+begin_quote #+begin_quote
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]] 󱌣 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
#+end_quote #+end_quote
| Keybind | Description | | Keybind | Description |
|---------+----------------------------| |-------------------+---------------------------------------------|
| [[kbd:][SPC f d]] | Find directory with dired | | [[kbd:][SPC f d]] | Find directory with dired |
| [[kbd:][q]] | Exit dired buffer | | [[kbd:][q]] | Exit dired buffer |
| [[kbd:][C-c C-r]] | Run [[doom-package:dired-rsync]] | | [[kbd:][C-c C-r]] | Run [[doom-package:dired-rsync]] |
| [[kbd:][C-c C-e]] | Rename entries with [[doom-package:wdired]] | | [[kbd:][C-c C-e]] | Rename entries with [[doom-package:wdired]] |
@ -59,7 +59,7 @@ If [[doom-module:+ranger]] is enabled often a buffer will be opened in minimal r
* TODO Configuration * TODO Configuration
#+begin_quote #+begin_quote
🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] 󱌣 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
#+end_quote #+end_quote
* Troubleshooting * Troubleshooting
@ -70,5 +70,5 @@ If [[doom-module:+ranger]] is enabled often a buffer will be opened in minimal r
* TODO Appendix * TODO Appendix
#+begin_quote #+begin_quote
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]] 󱌣 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
#+end_quote #+end_quote

View file

@ -1,5 +1,8 @@
;;; tools/dired/config.el -*- lexical-binding: t; -*- ;;; tools/dired/config.el -*- lexical-binding: t; -*-
(defvar +dired-dirvish-icon-provider 'nerd-icons
"Icon provider to use for dirvish when the module is enabled.")
(use-package! dired (use-package! dired
:commands dired-jump :commands dired-jump
:init :init
@ -139,7 +142,7 @@ we have to clean it up ourselves."
dirvish-attributes '(git-msg) dirvish-attributes '(git-msg)
dired-omit-files (concat dired-omit-files "\\|^\\..*$")) dired-omit-files (concat dired-omit-files "\\|^\\..*$"))
(when (modulep! +icons) (when (modulep! +icons)
(push 'all-the-icons dirvish-attributes)) (push +dired-dirvish-icon-provider dirvish-attributes))
(map! :map dirvish-mode-map (map! :map dirvish-mode-map
:n "b" #'dirvish-goto-bookmark :n "b" #'dirvish-goto-bookmark
:n "z" #'dirvish-show-history :n "z" #'dirvish-show-history
@ -151,28 +154,20 @@ we have to clean it up ourselves."
"h" #'dired-omit-mode)) "h" #'dired-omit-mode))
(use-package! all-the-icons-dired (use-package! nerd-icons-dired
:when (modulep! +icons) :when (modulep! +icons)
:unless (modulep! +dirvish) :unless (modulep! +dirvish)
:hook (dired-mode . all-the-icons-dired-mode) :hook (dired-mode . nerd-icons-dired-mode)
:config :config
;; HACK Fixes #1929: icons break file renaming in Emacs 27+, because the icon
;; is considered part of the filename, so we disable icons while we're in
;; wdired-mode.
(defvar +wdired-icons-enabled -1)
;; display icons with colors
(setq all-the-icons-dired-monochrome nil)
(defadvice! +dired-disable-icons-in-wdired-mode-a (&rest _) (defadvice! +dired-disable-icons-in-wdired-mode-a (&rest _)
:before #'wdired-change-to-wdired-mode :before #'wdired-change-to-wdired-mode
(setq-local +wdired-icons-enabled (if all-the-icons-dired-mode 1 -1)) (setq-local +wdired-icons-enabled (if nerd-icons-dired-mode 1 -1))
(when all-the-icons-dired-mode (when nerd-icons-dired-mode
(all-the-icons-dired-mode -1))) (nerd-icons-dired-mode -1)))
(defadvice! +dired-restore-icons-after-wdired-mode-a (&rest _) (defadvice! +dired-restore-icons-after-wdired-mode-a (&rest _)
:after #'wdired-change-to-dired-mode :after #'wdired-change-to-dired-mode
(all-the-icons-dired-mode +wdired-icons-enabled))) (nerd-icons-dired-mode +wdired-icons-enabled)))
(use-package! dired-x (use-package! dired-x

View file

@ -10,5 +10,5 @@
(package! dirvish :pin "4fe9c00894304e99aca22ae4b6b656fe94b8f927")) (package! dirvish :pin "4fe9c00894304e99aca22ae4b6b656fe94b8f927"))
(when (and (modulep! +icons) (when (and (modulep! +icons)
(not (modulep! +dirvish))) (not (modulep! +dirvish)))
(package! all-the-icons-dired :pin "5e9b097f9950cc9f86de922b07903a4e5fefc733")) (package! nerd-icons-dired :pin "4a068884bf86647d242c3adc8320cd603e15dac3"))
(package! fd-dired :pin "458464771bb220b6eb87ccfd4c985c436e57dc7e") (package! fd-dired :pin "458464771bb220b6eb87ccfd4c985c436e57dc7e")

Some files were not shown because too many files have changed in this diff Show more