diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index f31efa7e5..44154a9bb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -2,6 +2,7 @@ name: 📝 Bug Report description: Report something that isn't working as intended labels: ["is:bug", "needs-triage"] +projects: ["doomemacs/2"] body: - type: markdown attributes: @@ -32,9 +33,8 @@ body: Doom. required: true - label: > - 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 - version ending in .50 or .9x)* + The issue can be reproduced on a stable release of Emacs, such as 27, + 28, or 29. *(Unstable versions end in .50, .60, or .9x)* required: true - type: markdown attributes: diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml deleted file mode 100644 index f838bf64e..000000000 --- a/.github/workflows/add-to-project.yml +++ /dev/null @@ -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 diff --git a/.gitignore b/.gitignore index 124310e16..907145aa2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# generated by macOS +.DS_Store + # machine generated doom profiles or metadata /profiles/*.el /.local*/ diff --git a/README.md b/README.md index b47a7aecd..9a01c856d 100644 --- a/README.md +++ b/README.md @@ -98,20 +98,23 @@ Check out [the FAQ][FAQ] for answers to common questions about the project. # Prerequisites -+ Git 2.23+ -+ Emacs 27.1–29.1 (**Recommended: 29.1 + +- Git 2.23+ +- Emacs 27.1–29.1 (**Recommended: 29.1 + [native-comp](https://www.emacswiki.org/emacs/GccEmacs)**) - > :warning: Unstable and pre-release builds of Emacs -- which end in `.50`, - > `.60`, or `.9X` (e.g. `28.1.91`) -- **are not officially supported**. There - > *is* some effort to support Emacs HEAD, however. [Follow this Discourse - > post](https://discourse.doomemacs.org/t/3241) for details. -+ [ripgrep] 11.0+ -+ GNU `find` -+ *OPTIONAL:* [fd] 7.3.0+ (improves file indexing performance for some commands) - -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. +- [ripgrep] 11.0+ +- GNU `find` +- *OPTIONAL:* [fd] 7.3.0+ (improves file indexing performance for some commands) + +> [!WARNING] +> Unstable and pre-release builds of Emacs -- which end in `.50`, `.60`, or +> `.9X` (e.g. `28.1.91`) -- **are not officially supported**. There *is* some +> effort to support Emacs HEAD, however. [Follow this Discourse +> post](https://discourse.doomemacs.org/t/3241) for details. + +> [!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 diff --git a/docs/appendix.org b/docs/appendix.org index e991d3d2a..39be372ab 100644 --- a/docs/appendix.org +++ b/docs/appendix.org @@ -173,7 +173,7 @@ behaviour for known commands. #+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]]. #+end_quote diff --git a/docs/examples.org b/docs/examples.org index 2388d2cb4..9b1107f43 100644 --- a/docs/examples.org +++ b/docs/examples.org @@ -5,6 +5,12 @@ #+subtitle: Samples of Emacs/Doom dotfiles, concepts, and sub-projects #+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 Examples speak louder than technical explanations, so this file exists to house examples of Doom's (and Emacs') concepts, libraries, dotfiles, and more, for diff --git a/docs/faq.org b/docs/faq.org index 57ca83d8f..480ae45a0 100644 --- a/docs/faq.org +++ b/docs/faq.org @@ -5,6 +5,12 @@ #+subtitle: Answers to common issues and questions #+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 :PROPERTIES: :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 variable-pitch-mode or mixed-pitch-mode). Popular for text modes, like Org or Markdown. -- [[var:doom-unicode-font]]: used for rendering unicode glyphs. This is ~Symbola~ by - default. It is ignored if the [[doom-module::ui unicode]] module is enabled. +- [[var:doom-emoji-font]]: used for rendering emoji. Only needed if you want to use + a font other than your operating system’s 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]] face is used. - [[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 (setq doom-font (font-spec :family "JetBrainsMono" :size 12 :weight 'light) 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)) #+end_src #+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 issues are /rarely/ Doom issues!* #+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 (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 the [[doom-module::ui ligatures]] module altogether. @@ -618,7 +625,7 @@ keybinds to work: #+end_src #+begin_quote - 📌 I use [C-left] because it is easier to type than "", but they are + 󰐃 I use [C-left] because it is easier to type than "", but they are equivalent; two different ways to refer to the same key. #+end_quote ** 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. #+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! #+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? #+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]]. #+end_quote ** TODO How does Doom Emacs improve runtime performance? #+begin_quote - 🔨 *This post is a work in progress!* + 󱌣 *This post is a work in progress!* #+end_quote ** 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. #+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. #+end_quote diff --git a/docs/getting_started.org b/docs/getting_started.org index 467d3fe33..b6d58cf27 100644 --- a/docs/getting_started.org +++ b/docs/getting_started.org @@ -551,9 +551,7 @@ doom sync doom env # Lastly, install the icon fonts Doom uses: -emacs --batch -f all-the-icons-install-fonts -# On Windows, `all-the-icons-install-fonts` will only download the fonts, you'll -# have to install them by hand afterwards! +emacs --batch -f nerd-icons-install-fonts #+END_SRC To understand the purpose of the =~/.doom.d= directory and =~/.doom.d/init.el= diff --git a/lisp/cli/doctor.el b/lisp/cli/doctor.el index 7b796fe41..5b4ecd5dc 100644 --- a/lisp/cli/doctor.el +++ b/lisp/cli/doctor.el @@ -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"))) (print! (start "Checking for Emacs config conflicts...")) - (when (file-exists-p "~/.emacs") - (warn! "Detected an ~/.emacs file, which may prevent Doom from loading") - (explain! "If Emacs finds an ~/.emacs file, it will ignore ~/.emacs.d, where Doom is " - "typically installed. If you're seeing a vanilla Emacs splash screen, this " - "may explain why. If you use Chemacs, you may ignore this warning.")) + (print-group! + (unless (or (file-equal-p doom-emacs-dir "~/.emacs.d") + (file-equal-p doom-emacs-dir "~/.config/emacs")) + (print! (warn "Doom is installed in a non-standard location")) + (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...")) - (unless (functionp 'json-serialize) - (warn! "Emacs was not built with native JSON support") - (explain! "Users will see a substantial performance gain by building Emacs with " - "jansson support (i.e. a native JSON library), particularly LSP users. " - "You must install a prebuilt Emacs binary with this included, or compile " - "Emacs with the --with-json option.")) - (unless (featurep 'native-compile) - (warn! "Emacs was not built with native compilation support") - (explain! "Users will see a substantial performance gain by building Emacs with " - "native compilation support, availible in emacs 28+." - "You must install a prebuilt Emacs binary with this included, or compile " - "Emacs with the --with-native-compilation option.")) + (print! (start "Checking for missing Emacs features...")) + (print-group! + (unless (functionp 'json-serialize) + (warn! "Emacs was not built with native JSON support") + (explain! "Users will see a substantial performance gain by building Emacs with " + "jansson support (i.e. a native JSON library), particularly LSP users. " + "You must install a prebuilt Emacs binary with this included, or compile " + "Emacs with the --with-json option.")) + (unless (featurep 'native-compile) + (warn! "Emacs was not built with native compilation support") + (explain! "Users will see a substantial performance gain by building Emacs with " + "native compilation support, availible in emacs 28+." + "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...")) - (let* ((xdg-dir (concat (or (getenv "XDG_CONFIG_HOME") - "~/.config") - "/doom/")) - (doom-dir (or (getenv "DOOMDIR") - "~/.doom.d/")) - (dir (if (file-directory-p xdg-dir) - xdg-dir - doom-dir))) - (when (file-equal-p dir doom-emacs-dir) - (print! (error "Doom was cloned to %S, not ~/.emacs.d or ~/.config/emacs" - (path dir))) - (explain! "Doom's source and your private Doom config have to live in separate directories. " - "Putting them in the same directory (without changing the DOOMDIR environment " - "variable) will cause errors on startup.")) - (when (and (not (file-equal-p xdg-dir doom-dir)) - (file-directory-p xdg-dir) - (file-directory-p doom-dir)) - (print! (warn "Detected two private configs, in %s and %s") - (abbreviate-file-name xdg-dir) - doom-dir) - (explain! "The second directory will be ignored, as it has lower precedence."))) + (print-group! + (let* ((xdg-dir (concat (or (getenv "XDG_CONFIG_HOME") + "~/.config") + "/doom/")) + (doom-dir (or (getenv "DOOMDIR") + "~/.doom.d/")) + (dir (if (file-directory-p xdg-dir) + xdg-dir + doom-dir))) + (when (file-equal-p dir doom-emacs-dir) + (print! (error "Doom was cloned to %S, not ~/.emacs.d or ~/.config/emacs" + (path dir))) + (explain! "Doom's source and your private Doom config have to live in separate directories. " + "Putting them in the same directory (without changing the DOOMDIR environment " + "variable) will cause errors on startup.")) + (when (and (not (file-equal-p xdg-dir doom-dir)) + (file-directory-p xdg-dir) + (file-directory-p doom-dir)) + (print! (warn "Detected two private configs, in %s and %s") + (abbreviate-file-name xdg-dir) + 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...")) (elc-check-dir doom-core-dir) @@ -205,13 +243,13 @@ in." ;; Check for fonts (if (not (executable-find "fc-list")) (warn! "Warning: unable to detect fonts because fontconfig isn't installed") - ;; all-the-icons fonts + ;; nerd-icons fonts (when (and (pcase system-type (`gnu/linux (concat (or (getenv "XDG_DATA_HOME") "~/.local/share") "/fonts/")) (`darwin "~/Library/Fonts/")) - (require 'all-the-icons nil t)) + (require 'nerd-icons nil t)) (with-temp-buffer (let ((errors 0)) (cl-destructuring-bind (status . output) @@ -219,15 +257,16 @@ in." (if (not (zerop status)) (print! (error "There was an error running `fc-list'. Is fontconfig installed correctly?")) (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)) (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) - (explain! "Some all-the-icons fonts were missing.\n\n" - "You can install them by running `M-x all-the-icons-install-fonts' within Emacs.\n" - "This could also mean you've installed them in non-standard locations, in which " - "case feel free to ignore this warning."))))))))) + (explain! "Some needed fonts are not properly installed on your system. To download and " + "install them, run `M-x nerd-icons-install-fonts' from within Doom Emacs. " + "However, on Windows this command will only download them; the fonts must " + "be installed manually afterwards."))))))))) (print! (start "Checking for stale elc files in your DOOMDIR...")) (when (file-directory-p doom-user-dir) diff --git a/lisp/cli/install.el b/lisp/cli/install.el index e38e5736c..79dddaf8b 100644 --- a/lisp/cli/install.el +++ b/lisp/cli/install.el @@ -19,7 +19,7 @@ (config? ("--config" :yes) "Create `$DOOMDIR' or dummy files therein?") (envfile? ("--env" :yes) "(Re)generate an envvars file? (see `$ doom help env`)") (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?") &context context) "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, 4. Prompts you to generate an envvar file (same as `$ doom env`), 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. @@ -110,22 +110,6 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g. ('user-error (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") (print! (warn "A ~/.emacs file was detected. This conflicts with Doom and should be deleted!"))) diff --git a/lisp/cli/packages.el b/lisp/cli/packages.el index 463172cee..74daa9ea7 100644 --- a/lisp/cli/packages.el +++ b/lisp/cli/packages.el @@ -652,6 +652,7 @@ If ELPA-P, include packages installed with package.el (M-x package-install)." (doom-initialize-packages) (doom-packages--barf-if-incomplete) (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) (let ((rdirs (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 (if (not builds-p) (ignore (print! (item "Skipping builds"))) - (and (/= 0 (doom-packages--purge-builds builds-to-purge)) - (quiet! (straight-prune-build-cache)))) + (/= 0 (doom-packages--purge-builds builds-to-purge))) (if (not elpa-p) (ignore (print! (item "Skipping elpa packages"))) (/= 0 (doom-packages--purge-elpa))) diff --git a/lisp/doom-editor.el b/lisp/doom-editor.el index aa572e32d..2159b885c 100644 --- a/lisp/doom-editor.el +++ b/lisp/doom-editor.el @@ -130,7 +130,8 @@ or file path may exist now." (let ((buffer (or (buffer-base-buffer) (current-buffer)))) (and (buffer-file-name buffer) (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) "If a file has autosaved data, `after-find-file' will pause for 1 second to @@ -583,11 +584,9 @@ current buffer." filename)) (prog1 (apply fn args) (when (buffer-live-p buf) - (with-current-buffer buf (goto-char pos))))))))) - - -;;;###package imenu -(add-hook 'imenu-after-jump-hook #'recenter) + (with-current-buffer buf (goto-char pos)))))))) + :config + (setq helpful-set-variable-function #'setq!)) (use-package! smartparens diff --git a/lisp/doom-keybinds.el b/lisp/doom-keybinds.el index 3f4532515..1b877c28c 100644 --- a/lisp/doom-keybinds.el +++ b/lisp/doom-keybinds.el @@ -98,19 +98,20 @@ all hooks after it are ignored.") (defun doom/escape (&optional interactive) "Run `doom-escape-hook'." (interactive (list 'interactive)) - (cond ((minibuffer-window-active-p (minibuffer-window)) - ;; quit the minibuffer if open. - (when interactive - (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) + (let ((inhibit-quit t)) + (cond ((minibuffer-window-active-p (minibuffer-window)) + ;; quit the minibuffer if open. (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) diff --git a/lisp/doom-packages.el b/lisp/doom-packages.el index 0e6c2784f..72d3896b6 100644 --- a/lisp/doom-packages.el +++ b/lisp/doom-packages.el @@ -119,11 +119,11 @@ uses a straight or package.el command directly).") (append (apply fn args) ; lockfiles still take priority (doom-package-pinned-list))) -;; HACK: This fixes an issue present in recent builds of Emacs 29. See -;; emacs-mirror/emacs@0d383b592c2f. Straight.el uses `loaddefs-generate' if it -;; is available, which activates `emacs-lisp-mode' to read autoloads files, -;; but does so without suppressing its hooks. Some packages (like overseer) -;; add hooks to `emacs-lisp-mode-hook' in their autoloads, and once triggered, +;; HACK: This fixes an issue introduced in emacs-mirror/emacs@0d383b592c2f and +;; is present in >=29: Straight.el uses `loaddefs-generate' if it is +;; available, which activates `emacs-lisp-mode' to read autoloads files, but +;; does so without suppressing its hooks. Some packages (like overseer) add +;; 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 ;; file errors. ;; REVIEW: Report this upstream. diff --git a/lisp/doom-profiles.el b/lisp/doom-profiles.el index 2e482c0ec..f60531174 100644 --- a/lisp/doom-profiles.el +++ b/lisp/doom-profiles.el @@ -449,8 +449,8 @@ Defaults to the profile at `doom-profile-default'." (defun doom-profile--generate-package-autoloads () (doom-autoloads--scan (mapcar #'straight--autoloads-file - (seq-difference (hash-table-keys straight--build-cache) - doom-autoloads-excluded-packages)) + (nreverse (seq-difference (hash-table-keys straight--build-cache) + doom-autoloads-excluded-packages))) doom-autoloads-excluded-files 'literal)) diff --git a/lisp/doom-ui.el b/lisp/doom-ui.el index 05cc20c12..ab5e116a3 100644 --- a/lisp/doom-ui.el +++ b/lisp/doom-ui.el @@ -5,13 +5,13 @@ ;; ;;; Variables -(defvar doom-theme nil +(defcustom doom-theme nil "A symbol representing the Emacs theme to load at startup. Set to `nil' to load no theme at all. This variable is changed by `load-theme'.") -(defvar doom-font nil +(defcustom doom-font nil "The default font to use. 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 \"Fira Code-14\")") -(defvar doom-variable-pitch-font nil +(defcustom doom-variable-pitch-font nil "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 `doom-font' for examples. 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. Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See `doom-font' for examples. An omitted font size means to inherit `doom-font''s size.") -(defvar doom-unicode-font nil - "Fallback font for Unicode glyphs. +(defcustom doom-symbol-font nil + "Fallback font for symbols. Must be a `font-spec', a font object, an XFT font string, or an XLFD string. See -`doom-font' for examples. - -The defaults on macOS and Linux are Apple Color Emoji and Symbola, respectively. +`doom-font' for examples. Emacs defaults to Symbola. 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!") -(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" "Segoe UI Emoji" "Noto Color 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" "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 -(defvar doom-init-ui-hook nil +(defcustom doom-init-ui-hook nil "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 `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.") -(defvar doom-switch-window-hook nil +(defcustom doom-switch-window-hook nil "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.") (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 ;; `scroll-conservatively'). This is especially slow in larger files ;; during large-scale scrolling commands. If kept over 100, the window is - ;; never automatically recentered. - scroll-conservatively 101 + ;; never automatically recentered. The default (0) triggers this too + ;; aggressively, so I've set it to 10 to recenter if scrolling too far + ;; off-screen. + scroll-conservatively 10 scroll-margin 0 scroll-preserve-screen-position t ;; 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 compilation-ask-about-save nil ; save all buffers on `compile' compilation-scroll-output 'first-error) - ;; Handle ansi codes in compilation buffer - ;; DEPRECATED Use `ansi-color-compilation-filter' when dropping 27.x support - (add-hook 'compilation-filter-hook #'doom-apply-ansi-color-to-compilation-buffer-h) + (add-hook 'compilation-filter-hook + (if (< emacs-major-version 28) + #'doom-apply-ansi-color-to-compilation-buffer-h + #'ansi-color-compilation-filter)) ;; Automatically truncate compilation buffers so they don't accumulate too ;; much data and bog down the rest of Emacs. (autoload 'comint-truncate-buffer "comint" nil t) @@ -417,41 +432,17 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original ;; ;;; Third party packages -(use-package! all-the-icons - :commands (all-the-icons-octicon - all-the-icons-faicon - all-the-icons-fileicon - all-the-icons-wicon - all-the-icons-material - all-the-icons-alltheicon) - :preface - (add-hook! 'after-setting-font-hook - (defun doom-init-all-the-icons-fonts-h () - (when (fboundp 'set-fontset-font) - (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) - "")))) +(use-package! nerd-icons + :commands (nerd-icons-octicon + nerd-icons-faicon + nerd-icons-flicon + nerd-icons-wicon + nerd-icons-mdicon + nerd-icons-codicon + nerd-icons-devicon + nerd-icons-ipsicon + nerd-icons-pomicon + nerd-icons-powerline)) ;; Hide the mode line in completion popups and MAN pages because they serve ;; 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) (put face 'face-modified nil)))) (when (fboundp 'set-fontset-font) - (let ((fn (doom-rpartial #'member (font-family-list)))) - (when-let (font (cl-find-if fn doom-symbol-fallback-font-families)) - (set-fontset-font t 'symbol font)) - (when-let (font (cl-find-if fn doom-emoji-fallback-font-families)) - (set-fontset-font t 'unicode font)) - (when doom-unicode-font - (set-fontset-font t 'unicode doom-unicode-font)))) + (let* ((fn (doom-rpartial #'member (font-family-list))) + (symbol-font (or doom-symbol-font + (cl-find-if fn doom-symbol-fallback-font-families))) + (emoji-font (or doom-emoji-font + (cl-find-if fn doom-emoji-fallback-font-families)))) + (when symbol-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' (run-hooks 'after-setting-font-hook)) diff --git a/lisp/doom.el b/lisp/doom.el index ba4467a47..988a0d795 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -119,9 +119,9 @@ (let ((inhibit-changing-match-data t)) (if (string-match "HARFBUZZ" system-configuration-features) ; no alternative (push 'harfbuzz features))) -;; `native-compile' exists whether or not it is functional (e.g. libgcc is -;; available or not). This seems silly, so pretend it doesn't exist if it -;; isn't available. +;; The `native-compile' feature exists whether or not it is functional (e.g. +;; libgcc is available or not). This seems silly, so pretend it doesn't exist if +;; it isn't functional. (if (featurep 'native-compile) (if (not (native-comp-available-p)) (delq 'native-compile features))) @@ -168,7 +168,7 @@ "Current version of Doom Emacs 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.") (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) (zerop native-comp-async-jobs-number) (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 ;; 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 +(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 (defun doom--begin-init-h () "Begin the startup process." diff --git a/lisp/lib/docs.el b/lisp/lib/docs.el index bd609ccc0..ff7218684 100644 --- a/lisp/lib/docs.el +++ b/lisp/lib/docs.el @@ -19,24 +19,24 @@ (defvar doom-docs-header-specs '(("/docs/index\\.org$" (:label "FAQ" - :icon "question_answer" + :icon "nf-md-message_question_outline" :link "doom-faq:" :help-echo "Open the FAQ document")) (("/docs/[^/]+\\.org$" "/modules/README\\.org$") (:label "Back to index" - :icon "arrow_back" - :link ("doom-index" . "") + :icon "nf-md-arrow_left" + :link "doom-index" :help-echo "Navigate to the root index")) ("/modules/[^/]+/README\\.org$" (:label "Back to module index" - :icon "arrow_back" + :icon "nf-md-arrow_left" :link "doom-module-index:")) ("/modules/[^/]+/[^/]+/README\\.org$" (:label "Back to module index" - :icon "arrow_back" + :icon "nf-md-arrow_left" :link "doom-module-index:") (:label "History" - :icon "history" + :icon "nf-md-history" :icon-face font-lock-variable-name-face :link (lambda () (cl-destructuring-bind (category . module) (doom-module-from-path (buffer-file-name)) @@ -44,7 +44,7 @@ :help-echo "View the module history" :align right) (:label "Issues" - :icon "error_outline" + :icon "nf-md-flag" :icon-face error :link (lambda () (cl-destructuring-bind (category . module) (doom-module-from-path (buffer-file-name)) @@ -52,12 +52,12 @@ :align right)) (t (:label "Suggest edits" - :icon "edit" + :icon "nf-md-account_edit" :icon-face warning :link "doom-suggest-edit" :align right) (:label "Help" - :icon "help_outline" + :icon "nf-md-timeline_help_outline" :icon-face font-lock-function-name-face :link (lambda () (let ((title (cadar (org-collect-keywords '("TITLE"))))) @@ -101,9 +101,10 @@ (defun doom-docs--make-header-link (spec) "Create a header link according to SPEC." (let ((icon (and (plist-get spec :icon) - (funcall (or (plist-get spec :icon-function) - #'all-the-icons-material) - (plist-get spec :icon)))) + (with-demoted-errors "DOCS ERROR: %s" + (funcall (or (plist-get spec :icon-function) + #'nerd-icons-mdicon) + (plist-get spec :icon))))) (label (pcase (plist-get spec :label) ((and (pred functionp) lab) (funcall lab)) @@ -239,11 +240,9 @@ (beg (max (point-min) (1- (org-element-property :begin el)))) (end (org-element-property :end el)) ((memq (org-element-type el) '(drawer property-drawer)))) - (when (org-current-level) + (when (org-element-property-inherited :level el) (cl-decf end)) - (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))))) + (org-fold-core-region beg end doom-docs-mode 'doom-doc-hidden)))) ;; FIX: If the cursor remains within a newly folded region, that folk will ;; come undone, so we move it. (if pt (goto-char pt)))) @@ -373,7 +372,7 @@ depending.") (defvar doom-docs--cookies nil) ;;;###autoload (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." :lighter " Doom Docs" :after-hook (org-restart-font-lock) @@ -387,7 +386,7 @@ This primes `org-mode' for reading." (if doom-docs-mode (set (make-local-variable sym) t) (kill-local-variable sym))) - `(org-pretty-entities + '(org-pretty-entities org-hide-emphasis-markers org-hide-macro-markers)) (when doom-docs-mode @@ -428,13 +427,13 @@ This primes `org-mode' for reading." (defvar doom-docs--id-locations nil) (defvar doom-docs--id-files nil) +(defvar doom-docs--id-location-file (file-name-concat doom-cache-dir "doom-docs-org-ids")) ;;;###autoload (defun doom/reload-docs (&optional force) "Reload the ID locations in Doom's documentation and open docs buffers." (interactive (list 'interactive)) (with-temp-buffer - (let ((org-id-locations-file - (doom-path (file-truename doom-cache-dir) "doom-docs-org-ids")) + (let ((org-id-locations-file doom-docs--id-location-file) (org-id-track-globally t) org-agenda-files org-id-extra-files @@ -465,14 +464,26 @@ This primes `org-mode' for reading." (let ((org-id-link-to-org-use-id t) (org-id-method 'uuid) (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-files doom-docs--id-files)) (doom/reload-docs) - (let ((id (org-id-new))) - (org-id-add-location - id (buffer-file-name (buffer-base-buffer))) - id))) + (when-let (fname (buffer-file-name (buffer-base-buffer))) + (let ((id (org-id-new))) + (org-id-add-location id fname) + 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 (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 `read-only-mode' is activated." :after-hook (visual-line-mode -1) + (font-lock-add-keywords nil doom-docs-org-font-lock-keywords) (let ((gc-cons-threshold most-positive-fixnum) (gc-cons-percentage 1.0)) (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 org-id-method 'uuid 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-files doom-docs--id-files org-num-max-level 3 diff --git a/lisp/lib/help.el b/lisp/lib/help.el index cd6c8e269..777e337bf 100644 --- a/lisp/lib/help.el +++ b/lisp/lib/help.el @@ -168,7 +168,8 @@ selection of all minor-modes, active or not." (location (goto-char location))) (ignore-errors - (when (outline-invisible-p) + (when (memq (get-char-property (point) 'invisible) + '(outline org-fold-outline)) (save-excursion (outline-previous-visible-heading 1) (org-show-subtree)))))) @@ -575,7 +576,10 @@ If prefix arg is present, refresh the cache." (pp-to-string recipe)))) (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 ") (doom--help-insert-button (doom-package-homepage package)) diff --git a/lisp/lib/packages.el b/lisp/lib/packages.el index 96531b451..496091155 100644 --- a/lisp/lib/packages.el +++ b/lisp/lib/packages.el @@ -239,13 +239,14 @@ Must be run from a magit diff buffer." (unless (= (length before) (length after)) (user-error "Uneven number of packages being bumped")) (dolist (p1 before) - (cl-destructuring-bind (package &key plist _beg _end &allow-other-keys) p1 - (let ((p2 (cdr (assq package after)))) - (if (null p2) - (push package errors) - (let ((bstr1 (doom--package-to-bump-string package plist)) - (bstr2 (doom--package-to-bump-string package (plist-get p2 :plist)))) - (cl-pushnew (format "%s -> %s" bstr1 bstr2) lines :test #'equal)))))) + (when (and (listp p1) (eq (car p1) 'package!)) + (cl-destructuring-bind (package &key plist _beg _end &allow-other-keys) p1 + (let ((p2 (cdr (assq package after)))) + (if (null p2) + (push package errors) + (let ((bstr1 (doom--package-to-bump-string package plist)) + (bstr2 (doom--package-to-bump-string package (plist-get p2 :plist)))) + (cl-pushnew (format "%s -> %s" bstr1 bstr2) lines :test #'equal))))))) (if (null lines) (user-error "No bumps to bumpify") (prog1 (funcall (if interactive #'kill-new #'identity) diff --git a/lisp/lib/system.el b/lisp/lib/system.el index 3bbb27957..7a07d1975 100644 --- a/lisp/lib/system.el +++ b/lisp/lib/system.el @@ -52,8 +52,8 @@ (with-memoization (get 'doom-system-distro-icon 'cached-value) (propertize (pcase (doom-system-distro) - (`windows (all-the-icons-faicon "windows")) - (`macos (all-the-icons-faicon "apple")) + (`windows (nerd-icons-faicon "nf-fa-windows")) + (`macos (nerd-icons-faicon "nf-fa-apple")) (`arch "\uF303") (`debian "\uF306") (`raspbian "\uF315") @@ -74,7 +74,7 @@ (`devuan "\uF307") (`manjaro "\uF312") ((or `void `artix) "\uF17c") - (_ (all-the-icons-faicon "linux"))) + (_ (nerd-icons-faicon "nf-fa-linux"))) 'face '(:height 1) 'display '(raise 0)))) diff --git a/lisp/lib/ui.el b/lisp/lib/ui.el index 8d255255d..ea553c1d1 100644 --- a/lisp/lib/ui.el +++ b/lisp/lib/ui.el @@ -177,9 +177,13 @@ Use `winner-undo' to undo this. Alternatively, use OPACITY is an integer between 0 to 100, inclusive." (interactive (list (read-number "Opacity (0-100): " - (or (frame-parameter nil 'alpha) + (or (frame-parameter + nil (if (> emacs-major-version 28) + 'alpha-background 'alpha)) 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) ;;;###autoload diff --git a/lisp/packages.el b/lisp/packages.el index dbceeb029..07c83ce38 100644 --- a/lisp/packages.el +++ b/lisp/packages.el @@ -17,21 +17,22 @@ :branch ,straight-repository-branch :local-repo "straight.el" :files ("straight*.el")) - :pin "5e84c4e2cd8ca79560477782ee4c9e5187725def") + :pin "b3760f5829dba37e855add7323304561eb57a3d4") ;; 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! highlight-numbers :pin "8b4744c7f46c72b1d3d599d4fb75ef8183dee307") -(package! rainbow-delimiters :pin "a32b39bdfe6c61c322c37226d66e1b6d4f107ed0") +(package! rainbow-delimiters :pin "f40ece58df8b2f0fb6c8576b527755a552a5e763") (package! restart-emacs :pin "1607da2bc657fe05ae01f7fdf26f716eafead02c") ;; doom-editor.el (package! better-jumper :pin "47622213783ece37d5337dc28d33b530540fc319") -(package! dtrt-indent :pin "be07f4979a5b402a0cf5311c86c30b89ca0e1ee4") -(package! helpful :pin "c57ff0d284b50ff430fe1f13fd48deaa0d1a910e") -(package! pcre2el :pin "b941ed8a96299868171fac625ecffec77de3e986") -(package! smartparens :pin "79a338db115f441cd47bb91e6f75816c5e78a772") +(package! dtrt-indent :pin "e0630f74f915c6cded05f76f66d66e540fcc37c3") +(package! helpful :pin "a32a5b3d959a7fccf09a71d97b3d7c888ac31c69") +(package! pcre2el :pin "018531ba0cf8e2b28d1108136a0e031b6a45f1c1") +(package! smartparens :pin "0778a8a84064cf2bc3a9857bd0e7a4619cc1e5c3") (package! ws-butler ;; Use my fork of ws-butler, which has a few choice improvements and ;; optimizations (the original has been abandoned). @@ -39,13 +40,13 @@ :pin "572a10c11b6cb88293de48acbb59a059d36f9ba5") ;; doom-projects.el -(package! projectile :pin "971cd5c4f25ff1f84ab7e8337ffc7f89f67a1b52") -(package! project :pin "6c41ad68edf1f44110abe478d17c36f57a517e66") +(package! projectile :pin "9446ea92d28462aeb37846a8be0a0c97a7bc0cee") +(package! project :pin "f64bcf065c0731caecbdcff5ca1c7f2d711b5b1e") ;; doom-keybinds.el (package! general :pin "833dea2c4a60e06fcd552b653dfc8960935c9fb4") -(package! which-key :pin "df6b0cb8449812e7fb200bc852107fa7eb708496") +(package! which-key :pin "4d20bc852545a2e602f59084a630f888542052b1") (package! compat :recipe (:host github :repo "emacs-compat/compat") - :pin "75d0b8527f51aae42d23eee4aeb263e19055747e") + :pin "ea8de2ea18cf7c348aadb6eb2aeb2a9d840bd064") diff --git a/modules/README.org b/modules/README.org index 0d760b46b..2a017c3cb 100644 --- a/modules/README.org +++ b/modules/README.org @@ -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]]. -- 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). - Prettified =mu4e:main= view. - 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: -| 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 clojure]] | clojure-mode | clojure-lsp | | [[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. 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. - The first time you run Emacs a unicode cache will be generated -- this will take a while! - 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 configuration or the versions of relevant packages changes. diff --git a/modules/app/calendar/README.org b/modules/app/calendar/README.org index 4a5c9bf12..9c5913a12 100644 --- a/modules/app/calendar/README.org +++ b/modules/app/calendar/README.org @@ -34,12 +34,12 @@ This module requires: * TODO Usage #+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 * TODO Configuration #+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 ** Changing calendar sources @@ -74,5 +74,5 @@ to link your calendar with Google calendars. * TODO Appendix #+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 diff --git a/modules/app/emms/README.org b/modules/app/emms/README.org index 684fb126e..6db1aa0cb 100644 --- a/modules/app/emms/README.org +++ b/modules/app/emms/README.org @@ -34,7 +34,7 @@ These should be available through your OS package manager. * TODO Usage #+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 ** Keybinds @@ -56,7 +56,7 @@ These should be available through your OS package manager. * TODO Configuration #+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 * Troubleshooting @@ -70,5 +70,5 @@ Try [[kbd:][M-x +emms/mpd-restart-music-daemon]] then restart emacs. * TODO Appendix #+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 diff --git a/modules/app/everywhere/README.org b/modules/app/everywhere/README.org index f47d40691..89bb02e8e 100644 --- a/modules/app/everywhere/README.org +++ b/modules/app/everywhere/README.org @@ -68,5 +68,5 @@ Most other behavior is implemented as hooks on ~emacs-everywhere-init-hooks~. * TODO Appendix #+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 diff --git a/modules/app/everywhere/config.el b/modules/app/everywhere/config.el index 717024405..885495ede 100644 --- a/modules/app/everywhere/config.el +++ b/modules/app/everywhere/config.el @@ -20,7 +20,7 @@ (doom-modeline-spc) (when (emacs-everywhere-markdown-p) (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))) (propertize (emacs-everywhere-app-class emacs-everywhere-current-app) 'face 'doom-modeline-project-dir) diff --git a/modules/app/irc/README.org b/modules/app/irc/README.org index d2f519212..e25d529c0 100644 --- a/modules/app/irc/README.org +++ b/modules/app/irc/README.org @@ -52,7 +52,7 @@ environment.systemPackages = [ pkgs.gnutls ]; * TODO Usage #+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 To connect to IRC use ~M-x =irc~. @@ -70,7 +70,7 @@ When in a circe buffer these keybindings will be available: * TODO Configuration #+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 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 #+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 [[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 #+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 diff --git a/modules/app/irc/autoload/irc.el b/modules/app/irc/autoload/irc.el index d936b868e..16bca925b 100644 --- a/modules/app/irc/autoload/irc.el +++ b/modules/app/irc/autoload/irc.el @@ -55,7 +55,8 @@ workspace for it." circe-server-killed-confirmation) (when +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)) (when (modulep! :ui workspaces) (when (equal (+workspace-current-name) +irc--workspace-name) diff --git a/modules/app/irc/doctor.el b/modules/app/irc/doctor.el new file mode 100644 index 000000000..e2474f4e3 --- /dev/null +++ b/modules/app/irc/doctor.el @@ -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.")) diff --git a/modules/app/rss/README.org b/modules/app/rss/README.org index 3c4725bfb..f4a092151 100644 --- a/modules/app/rss/README.org +++ b/modules/app/rss/README.org @@ -39,7 +39,7 @@ Read RSS feeds in the comfort of Emacs. * TODO Usage #+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 - 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 #+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 ** 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]]) and put name as you want into ~description~. - 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 + General @@ -128,5 +128,5 @@ Hook ~elfeed-update~ to ~elfeed-search-mode-hook~: * TODO Appendix #+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 diff --git a/modules/app/rss/config.el b/modules/app/rss/config.el index a292f4006..7d952e42d 100644 --- a/modules/app/rss/config.el +++ b/modules/app/rss/config.el @@ -14,8 +14,9 @@ easier to scroll through.") (defvar +rss-workspace-name "*rss*" "Name of the workspace that contains the elfeed buffer.") + ;; -;; Packages +;;; Packages (use-package! elfeed :commands elfeed @@ -83,6 +84,7 @@ easier to scroll through.") (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)))))) + (use-package! elfeed-goodies :after elfeed :config diff --git a/modules/app/rss/packages.el b/modules/app/rss/packages.el index bc1c805c1..f486b1729 100644 --- a/modules/app/rss/packages.el +++ b/modules/app/rss/packages.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; -*- ;;; app/rss/packages.el -(package! elfeed :pin "162d7d545ed41c27967d108c04aa31f5a61c8e16") +(package! elfeed :pin "55fb162fa27e71b88effa59a83c57842e262b00f") (package! elfeed-goodies :pin "544ef42ead011d960a0ad1c1d34df5d222461a6b") (when (modulep! +org) - (package! elfeed-org :pin "3242ec0519800a58f20480c8a6e3b3337d137084")) + (package! elfeed-org :pin "fe59a96969bd321f5f9ec7317a4bc80943b94c86")) diff --git a/modules/app/twitter/README.org b/modules/app/twitter/README.org index b7023cf81..970e2da09 100644 --- a/modules/app/twitter/README.org +++ b/modules/app/twitter/README.org @@ -48,12 +48,12 @@ This module requires: * TODO Usage #+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 * TODO Configuration #+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 ** Commands & Keybindings @@ -96,6 +96,6 @@ key for evil users. To work around this issue you may use [[kbd:][M-SPC]] instea * TODO Appendix #+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 diff --git a/modules/checkers/grammar/README.org b/modules/checkers/grammar/README.org index 244d2e2d2..064b4fbe9 100644 --- a/modules/checkers/grammar/README.org +++ b/modules/checkers/grammar/README.org @@ -41,7 +41,7 @@ will need to set ~langtool-language-tool-jar~ to its location. * TODO Usage #+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 ** 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+. #+begin_quote - 🚧 This requires Java 1.8+ +  This requires Java 1.8+ #+end_quote *** Commands @@ -61,7 +61,7 @@ This minor mode highlights weasel words, duplication and passive voice. * TODO Configuration #+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 * Troubleshooting @@ -72,5 +72,5 @@ This minor mode highlights weasel words, duplication and passive voice. * TODO Appendix #+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 diff --git a/modules/checkers/grammar/packages.el b/modules/checkers/grammar/packages.el index 39da67b3b..f0082e185 100644 --- a/modules/checkers/grammar/packages.el +++ b/modules/checkers/grammar/packages.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; -*- ;;; checkers/grammar/packages.el -(package! langtool :pin "8276eccc5587bc12fd205ee58a7a982f0a136e41") -(package! writegood-mode :pin "ed42d918d98826ad88928b7af9f2597502afc6b0") +(package! langtool :pin "d86101eafe9a994eb0425e08e7c1795e9cb0cd42") +(package! writegood-mode :pin "d54eadeedb8bf3aa0e0a584c0a7373c69644f4b8") diff --git a/modules/checkers/spell/README.org b/modules/checkers/spell/README.org index 5f0a36975..3540dfc7e 100644 --- a/modules/checkers/spell/README.org +++ b/modules/checkers/spell/README.org @@ -58,7 +58,7 @@ your system and in your =$PATH=. They also need dictionaries for your language(s). #+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 because [[doom-package:spell-fu]] does not support generating the word list with anything other than =aspell= yet. @@ -108,7 +108,7 @@ language(s). * TODO Usage #+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 When using [[doom-module:+everywhere]], spell checking is performed for as many major modes as @@ -117,7 +117,7 @@ major modes. * TODO Configuration #+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 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 #+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 diff --git a/modules/checkers/spell/packages.el b/modules/checkers/spell/packages.el index 2af2169f0..eb2c07269 100644 --- a/modules/checkers/spell/packages.el +++ b/modules/checkers/spell/packages.el @@ -2,8 +2,8 @@ ;;; checkers/spell/packages.el (if (not (modulep! +flyspell)) - (package! spell-fu :pin "aed6e87aa31013534b7a6cbedb26e4f29ccea735") - (package! flyspell-correct :pin "7d7b6b01188bd28e20a13736ac9f36c3367bd16e") + (package! spell-fu :pin "e4031935803c66eca2f076dce72b0a6a770d026c") + (package! flyspell-correct :pin "1e7a5a56362dd875dddf848b9a9e25d1395b9d37") (cond ((modulep! :completion ivy) (package! flyspell-correct-ivy)) ((modulep! :completion helm) diff --git a/modules/checkers/syntax/README.org b/modules/checkers/syntax/README.org index 072c1e741..5aa7ac8d8 100644 --- a/modules/checkers/syntax/README.org +++ b/modules/checkers/syntax/README.org @@ -40,7 +40,7 @@ find out if you're missing any dependencies. * TODO Usage #+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 Most of flycheck's features are under [[kbd:][C-c !]], regardless of whether evil mode is @@ -67,7 +67,7 @@ Evil Specific: * TODO Configuration #+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 * Troubleshooting @@ -81,5 +81,5 @@ Evil Specific: * TODO Appendix #+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 diff --git a/modules/checkers/syntax/packages.el b/modules/checkers/syntax/packages.el index ccaaedc61..bd708b566 100644 --- a/modules/checkers/syntax/packages.el +++ b/modules/checkers/syntax/packages.el @@ -2,10 +2,10 @@ ;;; checkers/syntax/packages.el (unless (modulep! +flymake) - (package! flycheck :pin "784f184cdd9f9cb4e3dbb997c09d93e954142842") + (package! flycheck :pin "e56e30d8c66ffc9776d07740658d3b542c1a8e21") (package! flycheck-popup-tip :pin "ef86aad907f27ca076859d8d9416f4f7727619c6") (when (modulep! +childframe) - (package! flycheck-posframe :pin "8f60c9bf124ab9597d681504a73fdf116a0bde12"))) + (package! flycheck-posframe :pin "19896b922c76a0f460bf3fe8d8ebc2f9ac9028d8"))) ;; Flymake (when (modulep! +flymake) diff --git a/modules/completion/company/README.org b/modules/completion/company/README.org index 0e0fe1e82..922953aec 100644 --- a/modules/completion/company/README.org +++ b/modules/completion/company/README.org @@ -44,7 +44,7 @@ find out if you're missing any dependencies. * TODO Usage #+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 ** Code completion @@ -87,7 +87,7 @@ More information can be found [[https://github.com/oantolin/orderless#company][h * TODO Configuration #+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 ** Enable company backend(s) in certain modes @@ -142,5 +142,5 @@ on changing what backends are available for that mode. * TODO Appendix #+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 diff --git a/modules/completion/company/config.el b/modules/completion/company/config.el index 15beb0092..6ca06751f 100644 --- a/modules/completion/company/config.el +++ b/modules/completion/company/config.el @@ -97,47 +97,46 @@ :config (setq company-box-show-single-candidate t company-box-backends-colors nil - company-box-max-candidates 50 - company-box-icons-alist 'company-box-icons-all-the-icons + company-box-tooltip-limit 50 + company-box-icons-alist 'company-box-icons-nerd-icons ;; Move company-box-icons--elisp to the end, because it has a catch-all ;; clause that ruins icons from other backends in elisp buffers. company-box-icons-functions (cons #'+company-box-icons--elisp-fn (delq 'company-box-icons--elisp company-box-icons-functions)) - company-box-icons-all-the-icons - (let ((all-the-icons-scale-factor 0.8)) - `((Unknown . ,(all-the-icons-material "find_in_page" :face 'all-the-icons-purple)) - (Text . ,(all-the-icons-material "text_fields" :face 'all-the-icons-green)) - (Method . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) - (Function . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) - (Constructor . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) - (Field . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) - (Variable . ,(all-the-icons-material "adjust" :face 'all-the-icons-blue)) - (Class . ,(all-the-icons-material "class" :face 'all-the-icons-red)) - (Interface . ,(all-the-icons-material "settings_input_component" :face 'all-the-icons-red)) - (Module . ,(all-the-icons-material "view_module" :face 'all-the-icons-red)) - (Property . ,(all-the-icons-material "settings" :face 'all-the-icons-red)) - (Unit . ,(all-the-icons-material "straighten" :face 'all-the-icons-red)) - (Value . ,(all-the-icons-material "filter_1" :face 'all-the-icons-red)) - (Enum . ,(all-the-icons-material "plus_one" :face 'all-the-icons-red)) - (Keyword . ,(all-the-icons-material "filter_center_focus" :face 'all-the-icons-red)) - (Snippet . ,(all-the-icons-material "short_text" :face 'all-the-icons-red)) - (Color . ,(all-the-icons-material "color_lens" :face 'all-the-icons-red)) - (File . ,(all-the-icons-material "insert_drive_file" :face 'all-the-icons-red)) - (Reference . ,(all-the-icons-material "collections_bookmark" :face 'all-the-icons-red)) - (Folder . ,(all-the-icons-material "folder" :face 'all-the-icons-red)) - (EnumMember . ,(all-the-icons-material "people" :face 'all-the-icons-red)) - (Constant . ,(all-the-icons-material "pause_circle_filled" :face 'all-the-icons-red)) - (Struct . ,(all-the-icons-material "streetview" :face 'all-the-icons-red)) - (Event . ,(all-the-icons-material "event" :face 'all-the-icons-red)) - (Operator . ,(all-the-icons-material "control_point" :face 'all-the-icons-red)) - (TypeParameter . ,(all-the-icons-material "class" :face 'all-the-icons-red)) - (Template . ,(all-the-icons-material "short_text" :face 'all-the-icons-green)) - (ElispFunction . ,(all-the-icons-material "functions" :face 'all-the-icons-red)) - (ElispVariable . ,(all-the-icons-material "check_circle" :face 'all-the-icons-blue)) - (ElispFeature . ,(all-the-icons-material "stars" :face 'all-the-icons-orange)) - (ElispFace . ,(all-the-icons-material "format_paint" :face 'all-the-icons-pink))))) + company-box-icons-nerd-icons + `((Unknown . ,(nerd-icons-codicon "nf-cod-code" :face 'font-lock-warning-face)) + (Text . ,(nerd-icons-codicon "nf-cod-text_size" :face 'font-lock-doc-face)) + (Method . ,(nerd-icons-codicon "nf-cod-symbol_method" :face 'font-lock-function-name-face)) + (Function . ,(nerd-icons-codicon "nf-cod-symbol_method" :face 'font-lock-function-name-face)) + (Constructor . ,(nerd-icons-codicon "nf-cod-triangle_right" :face 'font-lock-function-name-face)) + (Field . ,(nerd-icons-codicon "nf-cod-symbol_field" :face 'font-lock-variable-name-face)) + (Variable . ,(nerd-icons-codicon "nf-cod-symbol_variable" :face 'font-lock-variable-name-face)) + (Class . ,(nerd-icons-codicon "nf-cod-symbol_class" :face 'font-lock-type-face)) + (Interface . ,(nerd-icons-codicon "nf-cod-symbol_interface" :face 'font-lock-type-face)) + (Module . ,(nerd-icons-codicon "nf-cod-file_submodule" :face 'font-lock-preprocessor-face)) + (Property . ,(nerd-icons-codicon "nf-cod-symbol_property" :face 'font-lock-variable-name-face)) + (Unit . ,(nerd-icons-codicon "nf-cod-symbol_ruler" :face 'font-lock-constant-face)) + (Value . ,(nerd-icons-codicon "nf-cod-symbol_field" :face 'font-lock-builtin-face)) + (Enum . ,(nerd-icons-codicon "nf-cod-symbol_enum" :face 'font-lock-builtin-face)) + (Keyword . ,(nerd-icons-codicon "nf-cod-symbol_keyword" :face 'font-lock-keyword-face)) + (Snippet . ,(nerd-icons-codicon "nf-cod-symbol_snippet" :face 'font-lock-string-face)) + (Color . ,(nerd-icons-codicon "nf-cod-symbol_color" :face 'success)) + (File . ,(nerd-icons-codicon "nf-cod-symbol_file" :face 'font-lock-string-face)) + (Reference . ,(nerd-icons-codicon "nf-cod-references" :face 'font-lock-variable-name-face)) + (Folder . ,(nerd-icons-codicon "nf-cod-folder" :face 'font-lock-variable-name-face)) + (EnumMember . ,(nerd-icons-codicon "nf-cod-symbol_enum_member" :face 'font-lock-builtin-face)) + (Constant . ,(nerd-icons-codicon "nf-cod-symbol_constant" :face 'font-lock-constant-face)) + (Struct . ,(nerd-icons-codicon "nf-cod-symbol_structure" :face 'font-lock-variable-name-face)) + (Event . ,(nerd-icons-codicon "nf-cod-symbol_event" :face 'font-lock-warning-face)) + (Operator . ,(nerd-icons-codicon "nf-cod-symbol_operator" :face 'font-lock-comment-delimiter-face)) + (TypeParameter . ,(nerd-icons-codicon "nf-cod-list_unordered" :face 'font-lock-type-face)) + (Template . ,(nerd-icons-codicon "nf-cod-symbol_snippet" :face 'font-lock-string-face)) + (ElispFunction . ,(nerd-icons-codicon "nf-cod-symbol_method" :face 'font-lock-function-name-face)) + (ElispVariable . ,(nerd-icons-codicon "nf-cod-symbol_variable" :face 'font-lock-variable-name-face)) + (ElispFeature . ,(nerd-icons-codicon "nf-cod-globe" :face 'font-lock-builtin-face)) + (ElispFace . ,(nerd-icons-codicon "nf-cod-symbol_color" :face 'success)))) ;; HACK Fix oversized scrollbar in some odd cases ;; REVIEW `resize-mode' is deprecated and may stop working in the future. diff --git a/modules/completion/company/packages.el b/modules/completion/company/packages.el index 5d9090b0c..d594c638b 100644 --- a/modules/completion/company/packages.el +++ b/modules/completion/company/packages.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; -*- ;;; completion/company/packages.el -(package! company :pin "2ca3e29abf87392714bc2b26e50e1c0f4b9f4e2c") +(package! company :pin "ed46a616ab9906fd43a630479b6a6c3f79e606f0") (package! company-dict :pin "cd7b8394f6014c57897f65d335d6b2bd65dab1f4") (when (modulep! +childframe) - (package! company-box :pin "766546b2668b5ef4eb4abbde632c9acd370c7788")) + (package! company-box :pin "b6f53e26adf948aca55c3ff6c22c21a6a6614253")) diff --git a/modules/completion/helm/README.org b/modules/completion/helm/README.org index 37332544f..9a545289a 100644 --- a/modules/completion/helm/README.org +++ b/modules/completion/helm/README.org @@ -22,7 +22,7 @@ For official documentation about Helm, see: Enable fuzzy completion for Helm searches. - +icons :: 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 - [[doom-package:helm]] @@ -40,7 +40,7 @@ For official documentation about Helm, see: ** TODO Hacks #+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 ** TODO Changelog @@ -74,18 +74,18 @@ its highlights will be covered here. ** Jump-to navigation Similar to Ivy, this module provides an interface to navigate within a project 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 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 This module also provides interactive text search and replace using [[https://github.com/BurntSushi/ripgrep][Ripgrep]]. *** Search -| Keybind | Description | -|---------+-----------------------------------------------------------| +| Keybind | Description | +|-------------------+---------------------------------------------------------| | [[kbd:][SPC s p]] | Search project (~+default/search-project~) | | [[kbd:][SPC s P]] | Search another project (~+default/search-other-project~) | | [[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. 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]d[!] [QUERY]~ | Search from current directory (if ~!~, don't search recursively) | @@ -106,8 +106,8 @@ commands. *** Replace 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-e]] | Open a writable buffer of your search results | | [[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: *** General -| Keybind | Description | -|------------+---------------------------| +| Keybind | Description | +|--------------------------------+---------------------------| | [[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 -| Keybind | Description | -|---------+----------------------------------------------------------------------| -| [[kbd:][SPC p t]] | List all TODO/FIXMEs in project | +| Keybind | Description | +|-------------------+--------------------------------------------------------------------| +| [[kbd:][SPC p t]] | List all TODO/FIXMEs in project | | [[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 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 another project (~+default/search-other-project~) | | [[kbd:][SPC s s]] | Search the current buffer (incrementally) (~+default/search-buffer~) | *** Search -| Keybind | Description | -|---------+----------------------------------------------------------------------| -| [[kbd:][SPC p t]] | List all TODO/FIXMEs in project | +| Keybind | Description | +|-------------------+--------------------------------------------------------------------| +| [[kbd:][SPC p t]] | List all TODO/FIXMEs in project | | [[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 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 another project (~+default/search-other-project~) | | [[kbd:][SPC s s]] | Search the current buffer (incrementally) (~+default/search-buffer~) | * TODO Configuration #+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 ** helm-mode @@ -182,9 +182,9 @@ makes sense to exempt ~foo~ with the following: ** Icons 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, -[[doom-package:all-the-icons]] is used. To change this: +[[doom-package:nerd-icons]] is used. To change this: #+begin_src emacs-lisp ;; add to $DOOMDIR/config.el (after! helm @@ -202,5 +202,5 @@ See [[id:4f36ae11-1da8-4624-9c30-46b764e849fc][this answer]]. * TODO Appendix #+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 diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index 8da8c7aa1..39dd73c91 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -195,7 +195,4 @@ Can be negative.") :when (modulep! +icons) :hook (helm-mode . helm-icons-enable) :init - (setq helm-icons-provider 'all-the-icons) - :config - (when (eq helm-icons-provider 'all-the-icons) - (setq helm-icons-mode->icon nil))) + (setq helm-icons-provider 'nerd-icons)) diff --git a/modules/completion/helm/doctor.el b/modules/completion/helm/doctor.el new file mode 100644 index 000000000..ea80e0b8e --- /dev/null +++ b/modules/completion/helm/doctor.el @@ -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))) diff --git a/modules/completion/helm/packages.el b/modules/completion/helm/packages.el index 94237eddb..f037a770b 100644 --- a/modules/completion/helm/packages.el +++ b/modules/completion/helm/packages.el @@ -1,20 +1,20 @@ ;; -*- no-byte-compile: t; -*- ;;; completion/helm/packages.el -(package! helm :pin "dfd6403947c5cd9f32afcd6bc92a1756cc958c82") -(package! helm-company :pin "6eb5c2d730a60e394e005b47c1db018697094dde") -(package! helm-c-yasnippet :pin "e214eec8b2875d8a7cd09006dfb6a8e15e9e4079") +(package! helm :pin "96aad023cb12e995e92763195086ccee3aa5a141") +(package! helm-company :pin "4622b82353220ee6cc33468f710fa5b6b253b7f1") +(package! helm-c-yasnippet :pin "c5880e740da101fde7a995e94a7b16c330e57583") (package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192") (package! helm-describe-modes :pin "11fb36af119b784539d31c6160002de1957408aa") -(package! helm-projectile :pin "35a2111d00c0c0c9d8743280d3f1243bb217118a") +(package! helm-projectile :pin "e2e38825c975269a4971df25e79b2ae98929624e") (package! helm-rg :pin "ee0a3c09da0c843715344919400ab0a0190cc9dc") (package! swiper-helm :pin "93fb6db87bc6a5967898b5fd3286954cc72a0008") (when (modulep! +childframe) - (package! helm-posframe :pin "87461b52b6f3f378c63642a33f584d4a4ba28351")) + (package! helm-posframe :pin "0b6bb016f0ff4980860a9d00574de311748c40b0")) (when (modulep! +fuzzy) (package! helm-flx :pin "5220099e695a3586dba2d59640217fe378e66310")) (when (modulep! +icons) - (package! helm-icons :pin "8d2f5e705c8b78a390677cf242024739c932fc95")) + (package! helm-icons :pin "0d113719ee72cb7b6bb7db29f7200d667bd86607")) (when (modulep! :lang org) - (package! helm-org :pin "d67186d3a64e610c03a5f3d583488f018fb032e4")) + (package! helm-org :pin "c80e53315ce6b096e2d0e630702df924bf00bf6a")) diff --git a/modules/completion/ido/README.org b/modules/completion/ido/README.org index 1b19d71c9..281edf6b8 100644 --- a/modules/completion/ido/README.org +++ b/modules/completion/ido/README.org @@ -33,12 +33,12 @@ Interactive DO things. The completion engine that is /mostly/ built-into Emacs. * Usage #+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 * Configuration #+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 * Troubleshooting @@ -52,5 +52,5 @@ See [[id:4f36ae11-1da8-4624-9c30-46b764e849fc][this answer]]. * Appendix #+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 diff --git a/modules/completion/ido/doctor.el b/modules/completion/ido/doctor.el new file mode 100644 index 000000000..9aeb09eb7 --- /dev/null +++ b/modules/completion/ido/doctor.el @@ -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))) diff --git a/modules/completion/ivy/README.org b/modules/completion/ivy/README.org index 660eaf7ac..500f22396 100644 --- a/modules/completion/ivy/README.org +++ b/modules/completion/ivy/README.org @@ -27,7 +27,7 @@ lighter, simpler and faster in many cases. Enable prescient filtering and sorting for Ivy searches. ** 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:counsel]] - [[doom-package:counsel-projectile]] @@ -64,7 +64,7 @@ use their associated Helm command or plugin. * TODO Usage #+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 [[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 #+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 ** TODO Enable fuzzy/non-fuzzy search for specific commands @@ -186,5 +186,5 @@ See [[id:4f36ae11-1da8-4624-9c30-46b764e849fc][this answer]]. * TODO Appendix #+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 diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index 78e793c64..e24b477dd 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -34,22 +34,6 @@ Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with (ivy-append-face candidate 'ivy-modified-buffer)) (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 (defun +ivy-rich-describe-variable-transformer (cand) "Previews the value of the variable in the minibuffer" diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index c9af7ee58..e1a758dc8 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -116,12 +116,6 @@ results buffer.") :config (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) (let ((filename (ivy-rich-bookmark-filename candidate))) (if (not filename) "" filename))) @@ -155,25 +149,16 @@ results buffer.") (switch-buffer-alist (assq 'ivy-rich-candidate (plist-get plist :columns)))) (setcar switch-buffer-alist '+ivy-rich-buffer-name)) + (when (modulep! +icons) + (nerd-icons-ivy-rich-mode +1)) (ivy-rich-mode +1) (ivy-rich-project-root-cache-mode +1)) -(use-package! all-the-icons-ivy +(use-package! nerd-icons-ivy-rich :when (modulep! +icons) - :after ivy - :config - ;; `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)))) + :commands (nerd-icons-ivy-rich-mode) + :after counsel-projectile) (use-package! counsel @@ -237,7 +222,6 @@ results buffer.") ;; 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 #'recenter) (ivy-add-actions 'counsel-rg ; also applies to `counsel-rg' '(("O" +ivy-git-grep-other-window-action "open in other window"))) @@ -315,7 +299,7 @@ results buffer.") (use-package! counsel-projectile - :defer t + :after ivy-rich :init (define-key! [remap projectile-find-file] #'+ivy/projectile-find-file diff --git a/modules/completion/ivy/doctor.el b/modules/completion/ivy/doctor.el index a79d37c56..771fdeb93 100644 --- a/modules/completion/ivy/doctor.el +++ b/modules/completion/ivy/doctor.el @@ -1,3 +1,7 @@ ;; -*- lexical-binding: t; no-byte-compile: t; -*- ;;; 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))) diff --git a/modules/completion/ivy/packages.el b/modules/completion/ivy/packages.el index 60df093e1..e170dc7a4 100644 --- a/modules/completion/ivy/packages.el +++ b/modules/completion/ivy/packages.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; -*- ;;; completion/ivy/packages.el -(package! swiper :pin "9d630d800e856a2c984c5a62a6f0ad313a9d2228") +(package! swiper :pin "8c30f4cab5948aa8d942a3b2bbf5fb6a94d9441d") (package! ivy) (package! ivy-hydra) (package! ivy-avy) @@ -13,7 +13,7 @@ (package! wgrep :pin "3132abd3750b8c87cbcf6942db952acfab5edccd") (if (modulep! +prescient) - (package! ivy-prescient :pin "d7cc55dad453c465af9ececbab94426202b5b32b") + (package! ivy-prescient :pin "707c25c947a9f17a1d43f97b3b28aba91ec9addb") (when (modulep! +fuzzy) (package! flx :pin "7b44a5abb254bbfbeca7a29336f7f4ebd8aabbf2"))) @@ -21,4 +21,4 @@ (package! ivy-posframe :pin "533a8e368fcabfd534761a5c685ce713376fa594")) (when (modulep! +icons) - (package! all-the-icons-ivy :pin "a70cbfa1effe36efc946a823a580cec686d5e88d")) + (package! nerd-icons-ivy-rich :pin "7197614b27fd562e64b11c91d41bed4443aded90")) diff --git a/modules/completion/vertico/README.org b/modules/completion/vertico/README.org index f49ad059b..73a52c0a6 100644 --- a/modules/completion/vertico/README.org +++ b/modules/completion/vertico/README.org @@ -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. ** 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-flycheck]] if [[doom-module::checkers syntax]] - [[doom-package:embark]] @@ -63,7 +63,7 @@ intend to use their associated Helm command or plugin. * TODO Usage #+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 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 keybindings are available: -| Keybind | Description | -|-------------------+----------------------------------------------------------------| -| [[kbd:][C-k]] | (evil) Go to previous candidate | -| [[kbd:][C-j]] | (evil) Go to next candidate | -| [[kbd:][C-M-k]] | (evil) Go to previous group | -| [[kbd:][C-M-j]] | (evil) Go to next group | +| Keybind | Description | +|---------------------------------------+--------------------------------------------------------------| +| [[kbd:][C-k]] | (evil) Go to previous candidate | +| [[kbd:][C-j]] | (evil) Go to next candidate | +| [[kbd:][C-M-k]] | (evil) Go to previous group | +| [[kbd:][C-M-j]] | (evil) Go to next group | | [[kbd:][C-;]] or [[kbd:][ 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-l]] | ~embark-collect~ the current candidate list (collect verbatim) | -| [[kbd:][C-SPC]] | Preview the current candidate | +| [[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-SPC]] | Preview the current candidate | ~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 @@ -99,17 +99,17 @@ This module provides an interface to navigate within a project using 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 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 This module provides interactive text search and replace using ripgrep. -| Keybind | Description | -|---------+--------------------------| +| Keybind | Description | +|------------------------+--------------------------| | [[kbd:][ s p]] | Search project | | [[kbd:][ s P]] | Search another project | | [[kbd:][ 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 *** General -| Keybind | Description | -|------------+-----------------------------| +| Keybind | Description | +|--------------------------------+-----------------------------| | [[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 -| Keybind | Description | -|------------------+---------------------------------------| -| [[kbd:][SPC RET]] | Find bookmark | +| Keybind | Description | +|--------------------------------------+---------------------------------------| +| [[kbd:][SPC RET]] | Find bookmark | | [[kbd:][SPC f f]], [[kbd:][SPC .]] | Browse from current directory | | [[kbd:][SPC p f]], [[kbd:][SPC SPC]] | Find file in project | -| [[kbd:][SPC f r]] | Find recently opened file | -| [[kbd:][SPC p p]] | Open another project | +| [[kbd:][SPC f r]] | Find recently opened file | +| [[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 | @@ -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]]. *** Search -| Keybind | Description | -|---------+-------------------------------------------| +| Keybind | Description | +|-------------------+-------------------------------------------| | [[kbd:][SPC p t]] | List all TODO/FIXMEs in project | | [[kbd:][SPC s b]] | Search the current buffer | | [[kbd:][SPC s d]] | Search this directory | @@ -200,10 +200,10 @@ to =~/=. *** Multiple candidate search This module modifies the default keybindings used in ~consult-completing-read-multiple~: -| Keybind | Description | -|---------+-------------------------------------------------------------| -| [[kbd:][TAB]] | Select or deselect current candidate | -| [[kbd:][RET]] | Enters selected candidates (also toggles current candidate) | +| Keybind | Description | +|---------------+-------------------------------------------------------------| +| [[kbd:][TAB]] | Select or deselect current candidate | +| [[kbd:][RET]] | Enters selected candidates (also toggles current candidate) | *** Async search commands :PROPERTIES: @@ -226,9 +226,9 @@ filtering should be done after a second =#=. For more information [[https://github.com/minad/consult#asynchronous-search][see here]]. ** Marginalia -| Keybind | Description | -|---------+---------------------------------| -| [[kbd:][M-A]] | Cycle between annotation levels | +| Keybind | Description | +|---------------+---------------------------------| +| [[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 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 #+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 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 #+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 diff --git a/modules/completion/vertico/autoload/workspaces.el b/modules/completion/vertico/autoload/workspaces.el index fcf63506d..01610da8c 100644 --- a/modules/completion/vertico/autoload/workspaces.el +++ b/modules/completion/vertico/autoload/workspaces.el @@ -86,8 +86,8 @@ buffer will be opened in the current workspace instead." (funcall consult--buffer-display (car buffer))))))) ;;;###autoload -(defun +vertico/embark-open-in-new-workspace (x) - "Open X (a file) in a new workspace." - (interactive) +(defun +vertico/embark-open-in-new-workspace (file) + "Open file in a new workspace." + (interactive "GFile:") (+workspace/new) - (find-file x)) + (find-file file)) diff --git a/modules/completion/vertico/config.el b/modules/completion/vertico/config.el index c797303e2..a4efa7c4e 100644 --- a/modules/completion/vertico/config.el +++ b/modules/completion/vertico/config.el @@ -10,6 +10,12 @@ overrides `completion-styles' during company completion sessions.") (defvar +vertico-consult-fd-args nil "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 @@ -130,9 +136,10 @@ orderless." [remap yank-pop] #'consult-yank-pop [remap persp-switch-to-buffer] #'+vertico/switch-workspace-buffer) :config - (defadvice! +vertico--consult-recent-file-a (&rest _args) - "`consult-recent-file' needs to have `recentf-mode' on to work correctly" - :before #'consult-recent-file + (defadvice! +vertico--consult-recentf-a (&rest _args) + "`consult-recent-file' needs to have `recentf-mode' on to work correctly. +`consult-buffer' needs `recentf-mode' to show file candidates." + :before (list #'consult-recent-file #'consult-buffer) (recentf-mode +1)) (setq consult-project-root-function #'doom-project-root @@ -197,22 +204,35 @@ orderless." ("C-x C-j" . consult-dir-jump-file)) :config (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 () - "Get a list of hosts from docker." - (when (if (>= emacs-major-version 29) - (require 'tramp-container nil t) - (setq-local docker-tramp-use-names t) - (require 'docker-tramp nil t)) - (let ((hosts) - (docker-query-fn #'docker-tramp--parse-running-containers)) - (when (>= emacs-major-version 29) - (setq docker-query-fn #'tramp-docker--completion-function)) - (dolist (cand (funcall docker-query-fn)) - (let ((user (unless (string-empty-p (car cand)) - (concat (car cand) "@"))) - (host (car (cdr cand)))) - (push (concat "/docker:" user host ":/") hosts))) - hosts))) + (let ((+vertico-consult-dir-container-executable "docker")) + (+vertico--consult-dir-container-hosts "docker"))) + + (defvar +vertico--consult-dir-source-tramp-podman + `(:name "Podman" + :narrow ?p + :category file + :face consult-file + :history file-name-history + :items ,#'+vertico--consult-dir-podman-hosts) + "Podman candiadate source for `consult-dir'.") (defvar +vertico--consult-dir-source-tramp-docker `(:name "Docker" @@ -223,6 +243,7 @@ orderless." :items ,#'+vertico--consult-dir-docker-hosts) "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 'consult-dir--source-tramp-ssh t) @@ -253,14 +274,16 @@ orderless." (set-popup-rule! "^\\*Embark Export:" :size 0.35 :ttl 0 :quit nil) - (defadvice! +vertico--embark-which-key-prompt-a (fn &rest args) - "Hide the which-key indicator immediately when using the completing-read prompter." - :around #'embark-completing-read-prompter - (which-key--hide-popup-ignore-command) - (let ((embark-indicators - (remq #'embark-which-key-indicator embark-indicators))) - (apply fn args))) - (cl-nsubstitute #'+vertico-embark-which-key-indicator #'embark-mixed-indicator embark-indicators) + (after! which-key + (defadvice! +vertico--embark-which-key-prompt-a (fn &rest args) + "Hide the which-key indicator immediately when using the completing-read prompter." + :around #'embark-completing-read-prompter + (which-key--hide-popup-ignore-command) + (let ((embark-indicators + (remq #'embark-which-key-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, ;; so we don't get a false positive match. (let ((pos (or (cl-position @@ -294,7 +317,7 @@ orderless." :desc "Cycle marginalia views" "M-A" #'marginalia-cycle) :config (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) (pushnew! marginalia-command-categories '(+default/find-file-under-here . file) diff --git a/modules/completion/vertico/doctor.el b/modules/completion/vertico/doctor.el index febc9702d..009c0cbc2 100644 --- a/modules/completion/vertico/doctor.el +++ b/modules/completion/vertico/doctor.el @@ -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) ;; FIXME: This throws an error if grep is missing. diff --git a/modules/completion/vertico/packages.el b/modules/completion/vertico/packages.el index eb55266c4..68f1b73e9 100644 --- a/modules/completion/vertico/packages.el +++ b/modules/completion/vertico/packages.el @@ -21,7 +21,7 @@ (package! wgrep :pin "3132abd3750b8c87cbcf6942db952acfab5edccd") (when (modulep! +icons) - (package! all-the-icons-completion :pin "8eb3e410d63f5d0657b41829e7898793e81f31c0")) + (package! nerd-icons-completion :pin "c2db8557a3c1a9588d111f8c8e91cae96ee85010")) (when (modulep! +childframe) (package! vertico-posframe diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index b154a0da0..7aa4dfc41 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -126,6 +126,9 @@ :desc "Search .emacs.d" "e" #'+default/search-emacsd :desc "Locate file" "f" #'+lookup/file :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 link" "L" #'ffap-menu :desc "Jump to bookmark" "m" #'bookmark-jump @@ -145,7 +148,10 @@ ;;; 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 path" "F" (cmd!! #'+default/insert-file-path t) :desc "Snippet" "s" #'yas-insert-snippet diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 9d3d499b5..a62541d4c 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -496,7 +496,10 @@ ;;; 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 path" "F" (cmd!! #'+default/insert-file-path t) :desc "Evil ex path" "p" (cmd! (evil-ex "R!echo ")) @@ -736,6 +739,9 @@ :desc "Search .emacs.d" "e" #'+default/search-emacsd :desc "Locate file" "f" #'locate :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 link" "L" #'ffap-menu :desc "Jump list" "j" #'evil-show-jumps @@ -754,8 +760,9 @@ ((modulep! :completion helm) #'swiper-isearch-thing-at-point)) :desc "Dictionary" "t" #'+lookup/dictionary-definition :desc "Thesaurus" "T" #'+lookup/synonyms - (:when (fboundp 'vundo) - :desc "Undo history" "u" #'vundo)) + :desc "Undo history" "u" + (cond ((modulep! :emacs undo +tree) #'undo-tree-visualize) + ((modulep! :emacs undo) #'vundo))) ;;; t --- toggle (:prefix-map ("t" . "toggle") diff --git a/modules/config/default/README.org b/modules/config/default/README.org index a725132ca..2b0538070 100644 --- a/modules/config/default/README.org +++ b/modules/config/default/README.org @@ -43,12 +43,12 @@ This module provides a set of reasonable defaults, including: * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -59,7 +59,7 @@ This module provides a set of reasonable defaults, including: * TODO Appendix #+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 ** Commands diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index d68698049..d49ea8643 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -25,7 +25,8 @@ generate `completing-read' candidates." (interactive) (call-interactively (if (and (not IS-MAC) (executable-find "man")) - #'man + (or (command-remapping #'man) + #'man) #'woman))) ;;;###autoload diff --git a/modules/config/literate/README.org b/modules/config/literate/README.org index 363bddfd6..6f5a7a19d 100644 --- a/modules/config/literate/README.org +++ b/modules/config/literate/README.org @@ -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~. #+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!* #+end_quote * TODO Usage #+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 - 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 #+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 ** Change the location of config.org @@ -120,5 +120,5 @@ your =$DOOMDIR=). This behavior can be disabled with: * TODO Appendix #+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 diff --git a/modules/editor/evil/README.org b/modules/editor/evil/README.org index e3c9d7426..69083f97e 100644 --- a/modules/editor/evil/README.org +++ b/modules/editor/evil/README.org @@ -58,7 +58,7 @@ This holy module brings the Vim editing model to Emacs. * TODO Usage #+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 ** Ported vim plugins @@ -138,7 +138,7 @@ And these are text objects added by this module: * TODO Configuration #+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 * 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. #+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. #+end_quote @@ -241,5 +241,5 @@ Like in vim, the clipboard can still be accessed by using the [[kbd:][+]] regist * TODO Appendix #+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 diff --git a/modules/editor/evil/autoload/evil.el b/modules/editor/evil/autoload/evil.el index 9527c1994..0f602752e 100644 --- a/modules/editor/evil/autoload/evil.el +++ b/modules/editor/evil/autoload/evil.el @@ -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")) (let* ((this-window (selected-window)) (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))) (when (or (minibufferp that-buffer) (window-dedicated-p this-window)) diff --git a/modules/editor/evil/config.el b/modules/editor/evil/config.el index 1197653b0..74d7b942c 100644 --- a/modules/editor/evil/config.el +++ b/modules/editor/evil/config.el @@ -245,9 +245,7 @@ directives. By default, this only recognizes C directives.") :hook (org-mode . embrace-org-mode-hook) :hook (ruby-mode . embrace-ruby-mode-hook) :hook (emacs-lisp-mode . embrace-emacs-lisp-mode-hook) - :hook ((lisp-mode emacs-lisp-mode clojure-mode racket-mode hy-mode) - . +evil-embrace-lisp-mode-hook-h) - :hook ((c++-mode rustic-mode csharp-mode java-mode swift-mode typescript-mode) + :hook ((c++-mode c++-ts-mode rustic-mode csharp-mode java-mode swift-mode typescript-mode) . +evil-embrace-angle-bracket-modes-hook-h) :hook (scala-mode . +evil-embrace-scala-mode-hook-h) :init @@ -284,16 +282,6 @@ directives. By default, this only recognizes C directives.") embrace--pairs-list)) (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 () (let ((var (make-local-variable 'evil-embrace-evil-surround-keys))) (set var (delq ?< evil-embrace-evil-surround-keys)) diff --git a/modules/editor/evil/init.el b/modules/editor/evil/init.el index 6bfa97df6..fb8cc330a 100644 --- a/modules/editor/evil/init.el +++ b/modules/editor/evil/init.el @@ -40,15 +40,16 @@ free-keys helm help - indent image + indent kotlin-mode + lispy outline replace shortdoc simple slime - lispy) + tab-bar) "A list of `evil-collection' modules to ignore. See the definition of this variable for an explanation of the defaults (in comments). See `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-sidebar disk-usage + distel doc-view docker ebib @@ -131,9 +133,11 @@ variable for an explanation of the defaults (in comments). See edebug ediff eglot + elpaca + ement explain-pause-mode - elfeed eldoc + elfeed elisp-mode elisp-refs elisp-slime-nav @@ -167,7 +171,7 @@ variable for an explanation of the defaults (in comments). See hg-histedit hungry-delete ibuffer - image + (image image-mode) image-dired image+ imenu @@ -179,6 +183,7 @@ variable for an explanation of the defaults (in comments). See js2-mode leetcode lispy + lms log-edit log-view lsp-ui-imenu @@ -238,6 +243,7 @@ variable for an explanation of the defaults (in comments). See snake so-long speedbar + tab-bar tablist tar-mode telega diff --git a/modules/editor/evil/packages.el b/modules/editor/evil/packages.el index 7108dc868..20c2c832e 100644 --- a/modules/editor/evil/packages.el +++ b/modules/editor/evil/packages.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; -*- ;;; editor/evil/packages.el -(package! evil :pin "9eb69b7f5b3c72cfc66f69b3242e935015780654") +(package! evil :pin "5fc16776c5eb00c956ec7e9d83facb6a38dd868d") (package! evil-args :pin "2671071a4a57eaee7cc8c27b9e4b6fc60fd2ccd3") (package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9") (package! evil-embrace :pin "3081d37811b6a3dfaaf01d578c7ab7a746c6064d") @@ -35,4 +35,4 @@ (package! neotree) (autoload 'neotree-make-executor "neotree" nil nil 'macro)) - (package! evil-collection :pin "1ad283f5b7ac9320ac3d41bccfc71a52f714563a")) + (package! evil-collection :pin "8be4b75c86bc637dbcd14be7522d6da06df1747e")) diff --git a/modules/editor/file-templates/README.org b/modules/editor/file-templates/README.org index 9cf272415..66e0224d3 100644 --- a/modules/editor/file-templates/README.org +++ b/modules/editor/file-templates/README.org @@ -31,7 +31,7 @@ This module adds file templates for blank files, powered by [[doom-package:yasni * TODO Usage #+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 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~. #+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. #+end_quote * TODO Configuration #+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 ** 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 #+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 ** API diff --git a/modules/editor/file-templates/autoload.el b/modules/editor/file-templates/autoload.el index d11046bbe..7cbd0f343 100644 --- a/modules/editor/file-templates/autoload.el +++ b/modules/editor/file-templates/autoload.el @@ -15,9 +15,9 @@ PRED can either be a regexp string or a major mode symbol. PLIST may contain these properties: :when FUNCTION - Provides a secondary predicate. This function takes no arguments and is - executed from within the target buffer. If it returns nil, this rule will be - skipped over. + Provides a secondary predicate. This function takes the filename as an + argument and is executed from within the target buffer. If it returns nil, + this rule will be skipped over. :trigger STRING|FUNCTION If a string, this is the yasnippet trigger keyword used to trigger the target snippet. diff --git a/modules/editor/file-templates/templates/c++-mode/__main.cpp b/modules/editor/file-templates/templates/c++-mode/__main.cpp index b4a1557a8..b3554503f 100644 --- a/modules/editor/file-templates/templates/c++-mode/__main.cpp +++ b/modules/editor/file-templates/templates/c++-mode/__main.cpp @@ -4,9 +4,7 @@ # -- #include -using namespace std; - -int main(int argc, char *argv[]) { +auto main(int argc, char *argv[]) -> int { $0 return 0; diff --git a/modules/editor/file-templates/templates/c-mode/__main.c b/modules/editor/file-templates/templates/c-mode/__main.c new file mode 100644 index 000000000..eb80db0f4 --- /dev/null +++ b/modules/editor/file-templates/templates/c-mode/__main.c @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# group: file templates +# contributor: Lorenzo Ravaglia +# -- +#include + +int main(int argc, char *argv[]) { + $0 + + return 0; +} \ No newline at end of file diff --git a/modules/editor/file-templates/templates/org-mode/__doom-readme b/modules/editor/file-templates/templates/org-mode/__doom-readme index aed7608ff..ffe6fd092 100644 --- a/modules/editor/file-templates/templates/org-mode/__doom-readme +++ b/modules/editor/file-templates/templates/org-mode/__doom-readme @@ -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 # heading and use: #+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 ** 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 # to the heading and use: #+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?]] #+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 # the heading and use: #+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 ** TODO Changelog @@ -122,7 +122,7 @@ This module requires: # If there are prerequisites but you can't document them yet, add TODO to the # heading and use: #+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 * Usage @@ -130,12 +130,12 @@ This module requires: # If this is left empty, add TODO to the heading and use: #+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 # If this section has incomplete content, add TODO to the heading and use: #+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 * TODO Configuration @@ -144,12 +144,12 @@ This module requires: # If this is left empty, add TODO to the heading and use: #+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 # If this section has incomplete content, add TODO to the heading and use: #+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 * Troubleshooting @@ -188,10 +188,10 @@ Answer # If this is left empty, add TODO to the heading and use: #+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 # If this section has incomplete content, add TODO to the heading and use: #+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 \ No newline at end of file diff --git a/modules/editor/fold/README.org b/modules/editor/fold/README.org index 7f33b3189..27c67f52b 100644 --- a/modules/editor/fold/README.org +++ b/modules/editor/fold/README.org @@ -23,7 +23,7 @@ marker, indent and syntax-based code folding for as many languages as possible. ** TODO Hacks #+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 ** TODO Changelog @@ -37,7 +37,7 @@ marker, indent and syntax-based code folding for as many languages as possible. * TODO Usage #+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 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 #+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 * Troubleshooting @@ -65,5 +65,5 @@ Emacs keybinds when [[doom-module::editor evil +everywhere]] is disabled: * TODO Appendix #+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 diff --git a/modules/editor/fold/packages.el b/modules/editor/fold/packages.el index 8676dbac8..032d3ed72 100644 --- a/modules/editor/fold/packages.el +++ b/modules/editor/fold/packages.el @@ -7,5 +7,5 @@ (when (modulep! :editor evil) (package! evil-vimish-fold :pin "b6e0e6b91b8cd047e80debef1a536d9d49eef31a")) (when (modulep! :tools tree-sitter) - (package! ts-fold :pin "9d9e0c5cf7b5397e06571bb6bf497598dc8796a8" + (package! ts-fold :pin "75e72c658ad8d8aac3af554a6b51b3c5c22dd0aa" :recipe (:host github :repo "emacs-tree-sitter/ts-fold"))) diff --git a/modules/editor/format/README.org b/modules/editor/format/README.org index dd23f3988..d5c855bac 100644 --- a/modules/editor/format/README.org +++ b/modules/editor/format/README.org @@ -3,44 +3,41 @@ #+created: July 26, 2020 #+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: -This module integrates code formatters into Emacs. Here are some of the -formatters that it currently supports: +Code style is something that's hotly debated since the beginning of time. -#+begin_quote -asmfmt, black, brittany, cabal-fmt, clang-format, cmake-format, dartfmt, dfmt, -dhall format, dockfmt, elm-format, emacs, fish_indent, fprettify, gleam format, -gofmt, iStyle, jsonnetfmt, ktlint, latexindent, ledger-mode, lua-fmt, mix -format, nixfmt, node-cljfmt, ocp-indent, perltidy, prettier, purty, rufo, -rustfmt, scalafmt, script shfmt, snakefmt, sqlformat, styler, swiftformat, tidy -#+end_quote +Tabs or spaces? +2-width or 4-width indentation? + +Which is right? Doom doesn't care, but we will try and make it easy for you to +format code within the safety of Emacs. + +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 -/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]] +- [[doom-user:][@elken]] + +[[doom-contrib-maintainer:][Become a maintainer?]] ** Module flags - +onsave :: 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) - format on save. + [[var:+format-on-save-disabled-modes]] to disable format on save for certain + major modes. ** Packages -- [[doom-package:format-all]] +- [[doom-package:apheleia]] ** Hacks -- format-all has been heavily modified to suit Doom's goals for this module: - - Reformatted text is applied to the buffer by RCS patch, as to reduce its - affect on cursor position. - - Adds partial formatting, i.e. you can now reformat a subset of the buffer. - - Adds the ability to use any arbitrary formatter on the current buffer if you - pass the universal argument to [[fn:+format/buffer]] or [[fn:+format/region]] (i.e. - removes the major-mode lock on formatters). +As of writing this, apheleia doesn't /yet/ support regions or similar kinds of +buffers, so there are a couple of hacks to attempt to rectify this. + +For the most part, things should work as expected. However, because the +formatting occurs on an isolated version of the buffer; lisp/scheme or similarly +indentation-based languages may produce poor results. ** TODO Changelog # 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 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: -- Angular/Vue (prettier) -- Assembly (asmfmt) -- 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) +To see if a particular mode has a configured formatter, check for the mode in +[[var:apheleia-mode-alist]] which corresponds to the list of formatters defined in +[[var:apheleia-formatters]] -* TODO Usage -#+begin_quote - 🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]] -#+end_quote +* Usage +** With +onsave +When this flag is enabled, you shouldn't need to do anything other than write +code and save it. -* TODO Configuration -#+begin_quote - 🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] -#+end_quote +** Without +onsave +Without the flag, formatting will only occur when either =+format/buffer= +or =apheleia-format-buffer= is called. The difference between them is +=+format/buffer= will use a LSP server if configured and available. -** Automatic reformatting when saving buffers -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 -enabled in. +* Configuration + +Detailed configuration can be found [[https://github.com/radian-software/apheleia/#user-guide][upstream]], but for most purposes here we +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 -(setq +format-on-save-enabled-modes - '(not emacs-lisp-mode ; elisp's mechanisms are good enough - sql-mode ; sqlformat is currently broken - tex-mode ; latexindent is broken - latex-mode)) +(set-formatter! 'unique-name '("command" "line" "here") :modes '(name-of-major-mode)) #+end_src -If you want to format code when you save a buffer, but want more granular -control over which major modes this behavior is enabled in, there is an -alternative. Make sure [[doom-module:+onsave]] is disabled before you try this: +If you're trying to override a formatter that has previously been defined by +Doom, you will need to ensure that the call in your config is contained within +an =after!= form, eg below to override Clojure's with =zprint=: + #+begin_src emacs-lisp -(add-hook 'python-mode-hook #'format-all-mode) -(add-hook 'js2-mode-hook #'format-all-mode) +(after! clojure-mode + (set-formatter! 'zprint '("zprint" "-") :modes '(clojure-mode))) #+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 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 in one mode: ~(setq-hook! 'python-mode-hook +format-with-lsp nil)~ -** TODO Defining your own formatters -See the ~set-formatter!~ function. - -** TODO Selecting a specific formatter for a particular buffer +** Selecting a specific formatter for a particular buffer Set the buffer-local variable ~+format-with~ to the name of the formatter to use. e.g. #+begin_src emacs-lisp +;; Overrides `apheleia-mode-alist` (setq-hook! 'python-mode-hook +format-with 'html-tidy) -;; Or set it to `:none' to disable formatting -(setq-hook! 'python-mode-hook +format-with :none) +;; Or set it to `nil' to fallback to `apheleia-mode-alist` +(setq-hook! 'python-mode-hook +format-with nil) #+end_src 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 -code]]. +looked up in the ~apheleia-mode-alist~ hash table. * 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 /This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]] * TODO Appendix #+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 diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index b06290da9..90929cb22 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -1,276 +1,86 @@ ;;; 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 () (save-excursion (goto-char (point-min)) (skip-chars-forward " \t\n") (current-indentation))) - -;; -;; Public library - -(defun +format-completing-read () - "TODO" - (require 'format-all) - (let* ((fmtlist (mapcar #'symbol-name (hash-table-keys format-all--format-table))) - (fmt (completing-read "Formatter: " fmtlist))) - (if fmt (intern fmt)))) - -;;;###autoload -(defun +format-probe-a (fn) - "Use `+format-with' instead, if it is set. -Prompts for a formatter if universal arg is set." - (cond ((or buffer-read-only (eq +format-with :none)) - (list nil nil)) - (current-prefix-arg - (list (or (+format-completing-read) - (user-error "Aborted")) - t)) - (+format-with - (list +format-with t)) - ((and +format-with-lsp - (bound-and-true-p lsp-managed-mode) - (lsp-feature? "textDocument/formatting")) - (list 'lsp nil)) - ((and +format-with-lsp - (bound-and-true-p eglot--managed-mode) - (eglot--server-capable :documentFormattingProvider)) - (list 'eglot nil)) - ((funcall fn)))) - -;;;###autoload -(defun +format-buffer-a (formatter mode-result) - "Advice that extends `format-all-buffer--with' to: - -1. Enable partial/region reformatting, while preserving leading indentation, -2. Applies changes via RCS patch, line by line, to protect buffer markers and - reduce cursor movement or window scrolling. - -See `+format/buffer' for the interactive version of this function, and -`+format-buffer-h' to use as a `before-save-hook' hook." - (cond - ((eq formatter 'lsp) - (call-interactively - (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)))))))))) +(defun +format-region (start end &optional callback) + "Format from START to END with `apheleia'." + (when-let* ((command (apheleia--get-formatters + (if current-prefix-arg + 'prompt + 'interactive))) + (cur-buffer (current-buffer)) + (formatted-buffer (get-buffer-create " *apheleia-formatted*")) + (indent 0)) + (with-current-buffer formatted-buffer + (erase-buffer) + (unless IS-WINDOWS + (setq-local coding-system-for-read 'utf-8) + (setq-local coding-system-for-write 'utf-8)) + ;; 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 cur-buffer)) + ;; Making enable-multibyte-characters buffer-local causes an + ;; error. + unless (eq var 'enable-multibyte-characters) + ;; Using setq-local would quote var. + do (set (make-local-variable var) val)) + ;; + (insert-buffer-substring-no-properties cur-buffer start end) + ;; 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))) + ;; + (apheleia-format-buffer + command + (lambda () + (with-current-buffer formatted-buffer + (when (> indent 0) + ;; restore indentation without affecting new + ;; indentation + (indent-rigidly (point-min) (point-max) + (max 0 (- indent (+format--current-indentation))))) + (set-buffer-modified-p nil)) + (with-current-buffer cur-buffer + (delete-region start end) + (insert-buffer-substring-no-properties formatted-buffer) + (when callback (funcall callback)) + (kill-buffer formatted-buffer))))))) ;; ;;; 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 -(defun +format/buffer () +(defun +format/buffer (&optional arg) "Reformat the current buffer using LSP or `format-all-buffer'." - (interactive) - (+format--buffer)) + (interactive "P") + (call-interactively + (if (and +format-with-lsp + (bound-and-true-p lsp-mode) + (lsp-feature? "textDocument/formatting")) + #'lsp-format-buffer + #'apheleia-format-buffer))) ;;;###autoload -(defun +format/region (beg end) +(defun +format/region (beg end &optional arg) "Runs the active formatter on the lines within BEG and END. 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 snippets or single lines." (interactive "rP") - (let ((+format-region-p t)) - (save-restriction - (narrow-to-region beg end) - (+format--buffer)))) + (if (and +format-with-lsp + (bound-and-true-p lsp-mode) + (lsp-feature? "textDocument/rangeFormatting")) + (call-interactively #'lsp-format-region) + (+format-region beg end))) ;;;###autoload (defun +format/region-or-buffer () @@ -281,13 +91,3 @@ is selected)." (if (doom-region-active-p) #'+format/region #'+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'.") diff --git a/modules/editor/format/autoload/settings.el b/modules/editor/format/autoload/settings.el index 0261c175f..ea12a1ac2 100644 --- a/modules/editor/format/autoload/settings.el +++ b/modules/editor/format/autoload/settings.el @@ -1,97 +1,10 @@ ;;; 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 -(cl-defun set-formatter! - (name formatter &key modes filter ok-statuses error-regexp) +(cl-defun set-formatter! (name args &key modes) "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. @@ -99,7 +12,7 @@ FORMATTER can be a symbol referring to another formatter, a function, string or nested list. 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 be piped to (through stdin). 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 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 the structure: (MAJOR-MODE FORM). FORM is evaluated when the buffer is formatted 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 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: - - (set-formatter! 'asmfmt \"asmfmt\" :modes '(asm-mode nasm-mode)) - (set-formatter! 'black \"black -q -\") - (set-formatter! 'html-tidy \"tidy -q -indent\" :modes '(html-mode web-mode)) + (set-formatter! \\='asmfmt \"asmfmt\" :modes \\='(asm-mode nasm-mode)) + (set-formatter! \\='black \"black -q -\") + (set-formatter! \\='html-tidy \"tidy -q -indent\" :modes \\='(html-mode web-mode)) Advanced examples: - (set-formatter! - 'clang-format - '(\"clang-format\" + \\='clang-format + \\='(\"clang-format\" (\"-assume-filename=%S\" (or buffer-file-name mode-result \"\"))) :modes - '((c-mode \".c\") + \\='((c-mode \".c\") (c++-mode \".cpp\") (java-mode \".java\") (objc-mode \".m\") (protobuf-mode \".proto\"))) - (set-formatter! 'html-tidy - '(\"tidy\" \"-q\" \"-indent\" - (\"-xml\" (memq major-mode '(nxml-mode xml-mode)))) + (set-formatter! \\='html-tidy + \\='(\"tidy\" \"-q\" \"-indent\" + (\"-xml\" (memq major-mode \\='(nxml-mode xml-mode)))) :modes - '(html-mode + \\='(html-mode (web-mode (and (equal \"none\" web-mode-engine) - (car (member web-mode-content-type '(\"xml\" \"html\")))))) - :ok-statuses '(0 1) - :executable \"tidy\") + (car (member web-mode-content-type \\='(\"xml\" \"html\"))))))) - (set-formatter! 'html-tidy ; overwrite predefined html-tidy formatter - '(\"tidy\" \"-q\" \"-indent\" + (set-formatter! \\='html-tidy ; overwrite predefined html-tidy formatter + \\='(\"tidy\" \"-q\" \"-indent\" \"--tidy-mark\" \"no\" \"--drop-empty-elements\" \"no\" \"--show-body-only\" \"auto\" (\"--indent-spaces\" \"%d\" tab-width) (\"--indent-with-tabs\" \"%s\" (if indent-tabs-mode \"yes\" \"no\")) - (\"-xml\" (memq major-mode '(nxml-mode xml-mode)))) - :ok-statuses '(0 1))) + (\"-xml\" (memq major-mode \\='(nxml-mode xml-mode))))) - (set-formatter! 'elm-format - \"elm-format --yes --stdin\" - :filter - (lambda (output errput first-diff) - (list output - (format-all--remove-ansi-color errput) - first-diff)))" + (set-formatter! \\='elm-format + \"elm-format --yes --stdin\")" (declare (indent defun)) (cl-check-type name symbol) - (after! format-all - (if (null formatter) - (+format--set name - :unset t - :modes modes) - (let ((fn (funcall (cond ((stringp formatter) - #'+format--make-shell-command) - ((listp formatter) - #'+format--make-shell-command-list) - ((and (commandp formatter) - (not (stringp formatter))) - #'+format--make-command) - ((functionp formatter) - #'+format--make-function)) - formatter - 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)))) + (after! apheleia + (if (null args) + (progn + (setq apheleia-formatters + (assq-delete-all name apheleia-formatters)) + (while (rassoc name apheleia-mode-alist) + (setq apheleia-mode-alist + (assq-delete-all (car (rassoc name apheleia-mode-alist)) apheleia-mode-alist)))) + (let ((formatter (cond + ((listp args) `(,@args)) + (t args)))) + (setf (alist-get name apheleia-formatters) formatter)) + (when modes + (dolist (mode modes) + (setf (alist-get mode apheleia-mode-alist) name)))))) diff --git a/modules/editor/format/config.el b/modules/editor/format/config.el index 0e634adbe..77dd06479 100644 --- a/modules/editor/format/config.el +++ b/modules/editor/format/config.el @@ -1,18 +1,14 @@ ;;; editor/format/config.el -*- lexical-binding: t; -*- -(defvar +format-on-save-enabled-modes - '(not emacs-lisp-mode ; elisp's mechanisms are good enough - sql-mode ; sqlformat is currently broken - tex-mode ; latexindent is broken - latex-mode - org-msg-edit-mode) ; doesn't need a formatter - "A list of major modes in which to reformat the buffer upon saving. - -If this list begins with `not', then it negates the list. -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. - +(defvar +format-on-save-disabled-modes + '(sql-mode ; sqlformat is currently broken + tex-mode ; latexindent is broken + latex-mode + org-msg-edit-mode) ; doesn't need a formatter + "A list of major modes in which to not 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 nil, formatting is enabled in all modes. Irrelevant if you do not have the +onsave flag enabled for this module.") (defvar +format-preserve-indentation t @@ -21,69 +17,59 @@ buffer. This is particularly useful for partials. 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 "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 -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 -(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) - (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 -;; Allow a specific formatter to be used by setting `+format-with', either -;; buffer-locally or let-bound. -(advice-add #'format-all--probe :around #'+format-probe-a) +(defadvice! +format--inhibit-reformat-on-prefix-arg-a (orig-fn &optional arg) + "Make it so \\[save-buffer] with prefix arg inhibits reformatting." + :around #'save-buffer + (let ((apheleia-mode (and apheleia-mode (memq arg '(nil 1))))) + (funcall orig-fn))) -;; Doom uses a modded `format-all-buffer', which -;; 1. Enables partial reformatting (while preserving leading indentation), -;; 2. Applies changes via RCS patch, line by line, to protect buffer markers -;; and avoid any jarring cursor+window scrolling. -(advice-add #'format-all-buffer--with :override #'+format-buffer-a) +(add-hook! + 'apheleia-post-format-hook + ;; HACK `web-mode' doesn't update syntax highlighting after arbitrary buffer + ;; modifications, so we must trigger refontification manually. + (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 -;; format a buffer. -(add-to-list 'debug-ignored-errors "^Don't know how to format ") - -;; 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))) + (defun +format--refresh-git-gutter-h () + (when (fboundp '+vc-gutter-update-h) + (+vc-gutter-update-h)))) diff --git a/modules/editor/format/packages.el b/modules/editor/format/packages.el index eada328ac..da69e9682 100644 --- a/modules/editor/format/packages.el +++ b/modules/editor/format/packages.el @@ -1,4 +1,4 @@ ;; -*- no-byte-compile: t; -*- ;;; editor/format/packages.el -(package! format-all :pin "47d862d40a088ca089c92cd393c6dca4628f87d3") +(package! apheleia :pin "56651724ad22f2769bbdaccf54cbe75c1cb35c91") diff --git a/modules/editor/format/test/test-format.el b/modules/editor/format/test/test-format.el deleted file mode 100644 index dc2306838..000000000 --- a/modules/editor/format/test/test-format.el +++ /dev/null @@ -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" )))) diff --git a/modules/editor/god/README.org b/modules/editor/god/README.org index cd709bc10..38bc0f7de 100644 --- a/modules/editor/god/README.org +++ b/modules/editor/god/README.org @@ -4,7 +4,7 @@ #+since: 21.12.0 #+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 * Description :unfold: @@ -35,12 +35,12 @@ mode. * Usage #+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 * Configuration #+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 * Troubleshooting @@ -51,5 +51,5 @@ mode. * Appendix #+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 diff --git a/modules/editor/lispy/README.org b/modules/editor/lispy/README.org index 03a323f6e..05618260b 100644 --- a/modules/editor/lispy/README.org +++ b/modules/editor/lispy/README.org @@ -41,7 +41,7 @@ languages: * TODO Usage #+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 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 #+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 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 #+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 diff --git a/modules/editor/lispy/packages.el b/modules/editor/lispy/packages.el index 3604d5b22..46099a98a 100644 --- a/modules/editor/lispy/packages.el +++ b/modules/editor/lispy/packages.el @@ -1,6 +1,6 @@ ;; -*- no-byte-compile: t; -*- ;;; editor/lispyville/packages.el -(package! lispy :pin "097dd66e662c3eee90d112d88bac5345d26e508f") +(package! lispy :pin "fe44efd21573868638ca86fc8313241148fabbe3") (when (modulep! :editor evil) (package! lispyville :pin "14ee8711d58b649aeac03581d22b10ab077f06bd")) diff --git a/modules/editor/multiple-cursors/README.org b/modules/editor/multiple-cursors/README.org index 0b033ffb3..7770099ba 100644 --- a/modules/editor/multiple-cursors/README.org +++ b/modules/editor/multiple-cursors/README.org @@ -39,7 +39,7 @@ evil) that loosely take after multi-cursors in Atom or Sublime Text. * TODO Usage #+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 ** evil-mc @@ -63,7 +63,7 @@ Designates "interactive edit" regions. Only the textual changes to them are mirr * TODO Configuration #+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 * Troubleshooting @@ -74,5 +74,5 @@ Designates "interactive edit" regions. Only the textual changes to them are mirr * Appendix #+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 diff --git a/modules/editor/multiple-cursors/packages.el b/modules/editor/multiple-cursors/packages.el index aa42652f8..4ff3edf26 100644 --- a/modules/editor/multiple-cursors/packages.el +++ b/modules/editor/multiple-cursors/packages.el @@ -4,6 +4,6 @@ (cond ((modulep! :editor evil) (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"))) diff --git a/modules/editor/objed/README.org b/modules/editor/objed/README.org index 0e12c2bfd..ff527708a 100644 --- a/modules/editor/objed/README.org +++ b/modules/editor/objed/README.org @@ -34,18 +34,18 @@ or Kakoune and tries to align them with regular Emacs conventions. /This module has no external requirements./ #+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. #+end_quote * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -56,5 +56,5 @@ or Kakoune and tries to align them with regular Emacs conventions. * TODO Appendix #+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 diff --git a/modules/editor/parinfer/README.org b/modules/editor/parinfer/README.org index 515f738ee..37dab263e 100644 --- a/modules/editor/parinfer/README.org +++ b/modules/editor/parinfer/README.org @@ -31,7 +31,7 @@ This module requires [[https://github.com/justinbarclay/parinfer-rust-mode#parin * TODO Usage #+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 ** Keybindings @@ -42,7 +42,7 @@ This module requires [[https://github.com/justinbarclay/parinfer-rust-mode#parin * TODO Configuration #+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 * Troubleshooting @@ -53,5 +53,5 @@ This module requires [[https://github.com/justinbarclay/parinfer-rust-mode#parin * TODO Appendix #+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 diff --git a/modules/editor/parinfer/packages.el b/modules/editor/parinfer/packages.el index 9f31eee1a..65ae55b11 100644 --- a/modules/editor/parinfer/packages.el +++ b/modules/editor/parinfer/packages.el @@ -1,4 +1,4 @@ ;; -*- no-byte-compile: t; -*- ;;; editor/parinfer/packages.el -(package! parinfer-rust-mode :pin "332c7f47426f0519dc5c24dda82afdb1aa8b61ee") +(package! parinfer-rust-mode :pin "6e6bdeeba32534acca5928fe4201ce013094988d") diff --git a/modules/editor/rotate-text/README.org b/modules/editor/rotate-text/README.org index bf5fba2d8..86bbe9a89 100644 --- a/modules/editor/rotate-text/README.org +++ b/modules/editor/rotate-text/README.org @@ -33,7 +33,7 @@ keywords or text patterns at point, like ~true~ and ~false~, or ~public~, * TODO Usage #+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 For evil users: [[kbd:][[r]] and [[kbd:][]r]] will cycle back and forward (respectively) through @@ -42,7 +42,7 @@ through them. * TODO Configuration #+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 To enable a set of items to cycle through globally: @@ -73,5 +73,5 @@ described above. * Appendix #+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 diff --git a/modules/editor/snippets/README.org b/modules/editor/snippets/README.org index a2e74dcf3..c7e84e820 100644 --- a/modules/editor/snippets/README.org +++ b/modules/editor/snippets/README.org @@ -21,7 +21,7 @@ This module adds snippet expansions to Emacs, powered by [[doom-package:yasnippe ** TODO Hacks #+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 ** TODO Changelog @@ -35,12 +35,12 @@ This module adds snippet expansions to Emacs, powered by [[doom-package:yasnippe * TODO Usage #+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 * TODO Configuration #+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 ** Disabling the built-in snippets @@ -62,5 +62,5 @@ Custom snippets should be added under =$DOOMDIR/snippets/= directory. Refer to [ * TODO Appendix #+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 diff --git a/modules/editor/snippets/autoload/snippets.el b/modules/editor/snippets/autoload/snippets.el index 539a11b80..59c257dd6 100644 --- a/modules/editor/snippets/autoload/snippets.el +++ b/modules/editor/snippets/autoload/snippets.el @@ -33,7 +33,13 @@ ignored. This makes it easy to override built-in snippets with private ones." (unless (file-directory-p dir) (if (y-or-n-p (format "%S doesn't exist. Create it?" (abbreviate-file-name dir))) (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) "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)) (defun +snippet--completing-read-uuid (prompt all-snippets &rest args) - (plist-get - (text-properties-at - 0 (apply #'completing-read prompt - (cl-loop for (_ . tpl) in (mapcan #'yas--table-templates (if all-snippets - (hash-table-values yas--tables) - (yas--get-snippet-tables))) + (let* ((completion-uuid-alist + (cl-loop for (_ . tpl) in (mapcan #'yas--table-templates + (if all-snippets + (hash-table-values yas--tables) + (yas--get-snippet-tables))) - for txt = (format "%-25s%-30s%s" - (yas--template-key tpl) - (yas--template-name tpl) - (abbreviate-file-name (yas--template-load-file tpl))) - collect - (progn - (set-text-properties 0 (length txt) `(uuid ,(yas--template-uuid tpl) - path ,(yas--template-load-file tpl)) - txt) - txt)) - args)) - 'uuid)) + for txt = (format "%-25s%-30s%s" + (yas--template-key tpl) + (yas--template-name tpl) + (abbreviate-file-name (yas--template-load-file tpl))) + collect + (cons txt (yas--template-uuid tpl)))) + (completion (apply #'completing-read prompt completion-uuid-alist args))) + (alist-get completion completion-uuid-alist nil nil #'string=))) + +(defun +snippets--snippet-mode-name-completing-read (&optional all-modes) + (cond (all-modes (completing-read + "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 () (interactive) @@ -193,25 +204,30 @@ buggy behavior when is pressed in an empty field." (user-error "Cannot find template with UUID %S" template-uuid))) ;;;###autoload -(defun +snippets/new () - "Create a new snippet in `+snippets-dir'." - (interactive) - (let ((default-directory - (expand-file-name (symbol-name major-mode) - +snippets-dir))) - (+snippet--ensure-dir default-directory) - (with-current-buffer (switch-to-buffer "untitled-snippet") - (snippet-mode) - (erase-buffer) - (yas-expand-snippet (concat "# -*- mode: snippet -*-\n" - "# name: $1\n" - "# uuid: $2\n" - "# key: ${3:trigger-key}${4:\n" - "# condition: t}\n" - "# --\n" - "$0")) - (when (bound-and-true-p evil-local-mode) - (evil-insert-state))))) +(defun +snippets/new (&optional all-modes) + "Create a new snippet in `+snippets-dir'. + +If there are extra yasnippet modes active, or if ALL-MODES is non-nil, you will +be prompted for the mode for which to create the snippet." + (interactive "P") + (let* ((mode (+snippets--snippet-mode-name-completing-read all-modes)) + (default-directory (+snippet--ensure-dir (expand-file-name mode +snippets-dir))) + (snippet-key (read-string "Enter a key for the snippet: ")) + (snippet-file-name (expand-file-name snippet-key))) + (when (+snippets--use-snippet-file-name-p snippet-file-name) + (with-current-buffer (switch-to-buffer snippet-key) + (snippet-mode) + (erase-buffer) + (set-visited-file-name snippet-file-name) + (yas-expand-snippet (concat "# -*- mode: snippet -*-\n" + "# name: $1\n" + "# uuid: $2\n" + "# key: ${3:" snippet-key "}${4:\n" + "# condition: t}\n" + "# --\n" + "$0")) + (when (bound-and-true-p evil-local-mode) + (evil-insert-state)))))) ;;;###autoload (defun +snippets/new-alias (template-uuid) @@ -224,21 +240,26 @@ You will be prompted for a snippet to alias." current-prefix-arg))) (unless (require 'doom-snippets nil t) (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))) - (+snippet--ensure-dir default-directory) - (with-current-buffer (switch-to-buffer "untitled-snippet") - (snippet-mode) - (erase-buffer) - (yas-expand-snippet - (concat "# -*- mode: snippet -*-\n" - "# name: $1\n" - "# key: ${2:trigger-key}${3:\n" - "# condition: t}\n" - "# type: command\n" - "# --\n" - "(%alias \"${4:" (or template-uuid "uuid") "}\")")) - (when (bound-and-true-p evil-local-mode) - (evil-insert-state))))) + (let* ((default-directory (+snippet--ensure-dir (expand-file-name + (symbol-name major-mode) + +snippets-dir))) + (alias-key (read-string "Enter a key for the alias: ")) + (alias-file-name (expand-file-name alias-key))) + (when (+snippets--use-snippet-file-name-p alias-file-name) + (with-current-buffer (switch-to-buffer alias-key) + (snippet-mode) + (erase-buffer) + (set-visited-file-name alias-file-name) + (yas-expand-snippet + (concat "# -*- mode: snippet -*-\n" + "# name: $1\n" + "# key: ${2:" alias-key "}${3:\n" + "# 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 (defun +snippets/edit (template-uuid) diff --git a/modules/editor/snippets/packages.el b/modules/editor/snippets/packages.el index 8a71b39c6..798e65cf9 100644 --- a/modules/editor/snippets/packages.el +++ b/modules/editor/snippets/packages.el @@ -1,10 +1,10 @@ ;; -*- no-byte-compile: t; -*- ;;; editor/snippets/packages.el -(package! yasnippet :pin "5cbdbf0d2015540c59ed8ee0fcf4788effdf75b6") +(package! yasnippet :pin "76e1eee654ea9479ba1441f9c17567694e6a2096") (package! auto-yasnippet :pin "6a9e406d0d7f9dfd6dff7647f358cb05a0b1637e") (package! doom-snippets :recipe (:host github :repo "doomemacs/snippets" :files (:defaults "*")) - :pin "fe4003014ae00b866f117cb193f711fd9d72fd11") + :pin "d490cba6d762e69b483be308bc387c1f785742f0") diff --git a/modules/editor/word-wrap/README.org b/modules/editor/word-wrap/README.org index 2ccc0952c..712644a9a 100644 --- a/modules/editor/word-wrap/README.org +++ b/modules/editor/word-wrap/README.org @@ -33,12 +33,12 @@ lines in the buffer without modifying the buffer content. * TODO Usage #+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 * TODO Configuration #+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 ** Activation @@ -116,5 +116,5 @@ modes like ~org-mode~ which handle prefix indentation themselves. * TODO Appendix #+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 diff --git a/modules/editor/word-wrap/packages.el b/modules/editor/word-wrap/packages.el index ab1386701..635b6f4be 100644 --- a/modules/editor/word-wrap/packages.el +++ b/modules/editor/word-wrap/packages.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; -*- ;;; editor/word-wrap/packages.el -(package! adaptive-wrap :pin "0d5b4a07de76d87dd64333a566a8a0a845f2b9f0") +(package! adaptive-wrap :pin "fc9f0306f14c3859c9903b0a0336478bf070c943") (package! visual-fill-column :pin "695a59789209c42fa08a5bce92963ee32f4455be") diff --git a/modules/emacs/dired/README.org b/modules/emacs/dired/README.org index 7a324d979..b9df9c3bb 100644 --- a/modules/emacs/dired/README.org +++ b/modules/emacs/dired/README.org @@ -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]]. ** 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:diredfl]] - [[doom-package:dired-rsync]] @@ -25,7 +25,7 @@ This module provides reasonable defaults and augmentations for dired. ** TODO Hacks #+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 ** TODO Changelog @@ -40,13 +40,13 @@ This module has no requirements *except on BSDs* like MacOS or FreeBSD, where * TODO Usage #+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 -| Keybind | Description | -|---------+----------------------------| -| [[kbd:][SPC f d]] | Find directory with dired | -| [[kbd:][q]] | Exit dired buffer | +| Keybind | Description | +|-------------------+---------------------------------------------| +| [[kbd:][SPC f d]] | Find directory with dired | +| [[kbd:][q]] | Exit dired buffer | | [[kbd:][C-c C-r]] | Run [[doom-package:dired-rsync]] | | [[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 #+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 * Troubleshooting @@ -70,5 +70,5 @@ If [[doom-module:+ranger]] is enabled often a buffer will be opened in minimal r * TODO Appendix #+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 diff --git a/modules/emacs/dired/config.el b/modules/emacs/dired/config.el index 26e5e74e2..fe1404ee5 100644 --- a/modules/emacs/dired/config.el +++ b/modules/emacs/dired/config.el @@ -1,5 +1,8 @@ ;;; 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 :commands dired-jump :init @@ -139,7 +142,7 @@ we have to clean it up ourselves." dirvish-attributes '(git-msg) dired-omit-files (concat dired-omit-files "\\|^\\..*$")) (when (modulep! +icons) - (push 'all-the-icons dirvish-attributes)) + (push +dired-dirvish-icon-provider dirvish-attributes)) (map! :map dirvish-mode-map :n "b" #'dirvish-goto-bookmark :n "z" #'dirvish-show-history @@ -151,28 +154,20 @@ we have to clean it up ourselves." "h" #'dired-omit-mode)) -(use-package! all-the-icons-dired +(use-package! nerd-icons-dired :when (modulep! +icons) :unless (modulep! +dirvish) - :hook (dired-mode . all-the-icons-dired-mode) + :hook (dired-mode . nerd-icons-dired-mode) :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 _) :before #'wdired-change-to-wdired-mode - (setq-local +wdired-icons-enabled (if all-the-icons-dired-mode 1 -1)) - (when all-the-icons-dired-mode - (all-the-icons-dired-mode -1))) + (setq-local +wdired-icons-enabled (if nerd-icons-dired-mode 1 -1)) + (when nerd-icons-dired-mode + (nerd-icons-dired-mode -1))) (defadvice! +dired-restore-icons-after-wdired-mode-a (&rest _) :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 diff --git a/modules/emacs/dired/packages.el b/modules/emacs/dired/packages.el index 802ec83c3..2bcecf0b9 100644 --- a/modules/emacs/dired/packages.el +++ b/modules/emacs/dired/packages.el @@ -10,5 +10,5 @@ (package! dirvish :pin "4fe9c00894304e99aca22ae4b6b656fe94b8f927")) (when (and (modulep! +icons) (not (modulep! +dirvish))) - (package! all-the-icons-dired :pin "5e9b097f9950cc9f86de922b07903a4e5fefc733")) + (package! nerd-icons-dired :pin "4a068884bf86647d242c3adc8320cd603e15dac3")) (package! fd-dired :pin "458464771bb220b6eb87ccfd4c985c436e57dc7e") diff --git a/modules/emacs/electric/README.org b/modules/emacs/electric/README.org index b6b26a1c1..5cc9e2a33 100644 --- a/modules/emacs/electric/README.org +++ b/modules/emacs/electric/README.org @@ -20,7 +20,7 @@ indentation (as opposed to character-based). ** TODO Hacks #+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 ** TODO Changelog @@ -34,12 +34,12 @@ indentation (as opposed to character-based). * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -50,5 +50,5 @@ indentation (as opposed to character-based). * TODO Appendix #+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 diff --git a/modules/emacs/ibuffer/README.org b/modules/emacs/ibuffer/README.org index ce5be3796..58d47d830 100644 --- a/modules/emacs/ibuffer/README.org +++ b/modules/emacs/ibuffer/README.org @@ -15,7 +15,7 @@ This module augments the built-in [[doom-package:ibuffer]] package. ** Module flags - +icons :: - Enable filetype icons for buffers using [[doom-package:all-the-icons]]. + Enable filetype icons for buffers using [[doom-package:nerd-icons]]. ** Packages - [[doom-package:ibuffer-projectile]] @@ -23,7 +23,7 @@ This module augments the built-in [[doom-package:ibuffer]] package. ** TODO Hacks #+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 ** TODO Changelog @@ -37,12 +37,12 @@ This module augments the built-in [[doom-package:ibuffer]] package. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -53,5 +53,5 @@ This module augments the built-in [[doom-package:ibuffer]] package. * TODO Appendix #+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 diff --git a/modules/emacs/ibuffer/config.el b/modules/emacs/ibuffer/config.el index 775bc9131..166a62712 100644 --- a/modules/emacs/ibuffer/config.el +++ b/modules/emacs/ibuffer/config.el @@ -25,11 +25,11 @@ ;; Display buffer icons on GUI (define-ibuffer-column icon (:name " ") (let ((icon (if (and (buffer-file-name) - (all-the-icons-auto-mode-match?)) - (all-the-icons-icon-for-file (file-name-nondirectory (buffer-file-name)) :v-adjust -0.05) - (all-the-icons-icon-for-mode major-mode :v-adjust -0.05)))) + (nerd-icons-auto-mode-match?)) + (nerd-icons-icon-for-file (file-name-nondirectory (buffer-file-name)) :v-adjust -0.05) + (nerd-icons-icon-for-mode major-mode :v-adjust -0.05)))) (if (symbolp icon) - (setq icon (all-the-icons-faicon "file-o" :face 'all-the-icons-dsilver :height 0.8 :v-adjust 0.0)) + (setq icon (nerd-icons-faicon "nf-fa-file_o" :face 'nerd-icons-dsilver :height 0.8 :v-adjust 0.0)) icon))) ;; Redefine size column to display human readable size @@ -72,8 +72,8 @@ :config (setq ibuffer-projectile-prefix (if (modulep! +icons) - (concat (all-the-icons-octicon - "file-directory" + (concat (nerd-icons-octicon + "nf-oct-file_directory" :face ibuffer-filter-group-name-face :v-adjust -0.05) " ") diff --git a/modules/emacs/ibuffer/packages.el b/modules/emacs/ibuffer/packages.el index 21ae2d78c..0a2bc9401 100644 --- a/modules/emacs/ibuffer/packages.el +++ b/modules/emacs/ibuffer/packages.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; -*- ;;; emacs/ibuffer/packages.el -(package! ibuffer-projectile :pin "ecbe482804a217b1471593f6c7a8b3d64f3cdc47") -(package! ibuffer-vc :pin "9204001d1c5ca39409485c1574fd315b0e137a92") +(package! ibuffer-projectile :pin "710ecac1578273bf31debe52870f5844472e3428") +(package! ibuffer-vc :pin "1388d2ea18287c74a79d053619dbdfa9090c26a2") diff --git a/modules/emacs/undo/README.org b/modules/emacs/undo/README.org index d8b737177..907977c60 100644 --- a/modules/emacs/undo/README.org +++ b/modules/emacs/undo/README.org @@ -46,12 +46,12 @@ persist across Emacs sessions. * TODO Usage #+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 * TODO Configuration #+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 ** Disabling persistent undo history @@ -80,5 +80,5 @@ persist across Emacs sessions. * TODO Appendix #+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 diff --git a/modules/emacs/undo/config.el b/modules/emacs/undo/config.el index dc9edbe95..bfc9e46d5 100644 --- a/modules/emacs/undo/config.el +++ b/modules/emacs/undo/config.el @@ -50,6 +50,7 @@ (use-package! vundo :unless (modulep! +tree) + :when (> emacs-major-version 27) :defer t :config (setq vundo-glyph-alist vundo-unicode-symbols diff --git a/modules/emacs/undo/packages.el b/modules/emacs/undo/packages.el index 359ae9ff0..a3bb404d6 100644 --- a/modules/emacs/undo/packages.el +++ b/modules/emacs/undo/packages.el @@ -2,8 +2,8 @@ ;;; emacs/undo/packages.el (if (modulep! +tree) - (package! undo-tree :pin "16f4121032d09ef44b3d7d02c4d02c3c2f18041f") - (package! undo-fu :pin "0e22308de8337a9291ddd589edae167d458fbe77") - (package! undo-fu-session :pin "7b3fd0647dd1fbd02101eec61440e6d44953bcd9") + (package! undo-tree :pin "f9e7eac16f674aa7ed8fa065401d26c0258a84f8") + (package! undo-fu :pin "0e74116fd5c7797811a91ba4eadef50d67523eb6") + (package! undo-fu-session :pin "a6c4f73bc22401fd36e0f2fd4fe058bb28566d84") (when (> emacs-major-version 27) ; unsupported in 27 - (package! vundo :pin "26c929229ae03b8d942907541f0844988b36d0ce"))) + (package! vundo :pin "24271862a2f746be038306eafe20f5eff55c4566"))) diff --git a/modules/emacs/vc/README.org b/modules/emacs/vc/README.org index 615b43787..eb35f35d0 100644 --- a/modules/emacs/vc/README.org +++ b/modules/emacs/vc/README.org @@ -40,12 +40,12 @@ This module only requires [[https://git-scm.com/][Git]]. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -56,5 +56,5 @@ This module only requires [[https://git-scm.com/][Git]]. * TODO Appendix #+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 diff --git a/modules/emacs/vc/packages.el b/modules/emacs/vc/packages.el index 23cd57473..39ad6dc4c 100644 --- a/modules/emacs/vc/packages.el +++ b/modules/emacs/vc/packages.el @@ -6,7 +6,7 @@ (package! smerge-mode :built-in t) (package! browse-at-remote :pin "c020975a891438e278ad1855213d4f3d62c9fccb") -(package! git-commit :pin "97a95f70079b6613bf98d2306279d3e03fe51234") +(package! git-commit :pin "48818355728c48d986d74dde8b1e9fba25f0fd53") (package! git-timemachine ;; The original lives on codeberg.org; which has uptime issues. :recipe (:host github :repo "emacsmirror/git-timemachine") diff --git a/modules/email/mu4e/README.org b/modules/email/mu4e/README.org index 067c45ce8..1c34794f3 100644 --- a/modules/email/mu4e/README.org +++ b/modules/email/mu4e/README.org @@ -6,7 +6,7 @@ * Description :unfold: 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). - Prettified =mu4e:main= view. - Cooperative locking of the =mu= process. Another Emacs instance may request @@ -47,7 +47,7 @@ This module makes Emacs an email client, using [[https://www.djcbsoftware.nl/cod ** TODO Hacks #+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 ** TODO Changelog @@ -64,12 +64,12 @@ This module requires: (recommended, default) or [[http://www.offlineimap.org/][offlineimap]] but you can sync mail in other ways too. #+name: Install Matrix -| Platform | Install command | Base packages | -|---------------+----------------------------+-------------------------| -| MacOS | ~$ brew install ~ | =mu= | +| Platform | Install command | Base packages | +|---------------+--------------------------+---------------------| +| MacOS | ~$ brew install ~ | =mu= | | Arch | ~$ pacman -S ~ | (AUR, ~$ yay -S~) =mu= | | openSUSE | ~$ zypper install ~ | =maildir-utils=, =mu4e= | -| Fedora | ~$ dnf install ~ | =maildir-utils= | +| Fedora | ~$ dnf install ~ | =maildir-utils= | | Debian/Ubuntu | ~$ apt-get install ~ | =maildir-utils=, =mu4e= | Then install either the =isync= (=mbsync=) or =offlineimap= package. @@ -103,12 +103,12 @@ environment.systemPackages = with pkgs; [ * TODO Usage #+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 * TODO Configuration #+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 ** offlineimap @@ -312,5 +312,5 @@ need to switch to the unstable build of =net-mail/mu= to see it. * TODO Appendix #+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 diff --git a/modules/email/mu4e/autoload/advice.el b/modules/email/mu4e/autoload/advice.el index c053d83e7..29b24d502 100644 --- a/modules/email/mu4e/autoload/advice.el +++ b/modules/email/mu4e/autoload/advice.el @@ -1,37 +1,5 @@ ;;; email/mu4e/autoload/advice.el -*- lexical-binding: t; -*- -;;;###autoload -(defun +mu4e~main-action-str-prettier-a (str &optional func-or-shortcut) - "Highlight the first occurrence of [.] in STR. -If FUNC-OR-SHORTCUT is non-nil and if it is a function, call it -when STR is clicked (using RET or mouse-2); if FUNC-OR-SHORTCUT is -a string, execute the corresponding keyboard action when it is -clicked." - (let ((newstr - (replace-regexp-in-string - "\\[\\(..?\\)\\]" - (lambda(m) - (format "%s" - (propertize (match-string 1 m) 'face 'mu4e-highlight-face))) - (replace-regexp-in-string "\t\\*" (format "\t%s" +mu4e-main-bullet) str))) - (map (make-sparse-keymap)) - (func (if (functionp func-or-shortcut) - func-or-shortcut - (if (stringp func-or-shortcut) - (lambda()(interactive) - (execute-kbd-macro func-or-shortcut)))))) - (define-key map [mouse-2] func) - (define-key map (kbd "RET") func) - (put-text-property 0 (length newstr) 'keymap map newstr) - (put-text-property (string-match "[A-Za-z].+$" newstr) - (- (length newstr) 1) 'mouse-face 'highlight newstr) - newstr)) - -;;;###autoload -(defun +mu4e~main-keyval-str-prettier-a (str) - "Replace '*' with `+mu4e-main-bullet' in STR." - (replace-regexp-in-string "\t\\*" (format "\t%s" +mu4e-main-bullet) str)) - ;; Org msg LaTeX image scaling ;;;###autoload diff --git a/modules/email/mu4e/autoload/email.el b/modules/email/mu4e/autoload/email.el index 4aa54d8e5..336ed40f1 100644 --- a/modules/email/mu4e/autoload/email.el +++ b/modules/email/mu4e/autoload/email.el @@ -113,37 +113,47 @@ will also be the width of all other printable characters." (insert str) (car (window-text-pixel-size))))) -(cl-defun +mu4e-normalised-icon (name &key set color height v-adjust) +(cl-defun +mu4e-normalised-icon (name &key set color height v-adjust space-right) "Convert :icon declaration to icon" - (let* ((icon-set (intern (concat "all-the-icons-" (or set "faicon")))) + (let* ((icon-set (intern (concat "nerd-icons-" (or set "faicon")))) (v-adjust (or v-adjust 0.02)) (height (or height 0.8)) (icon (if color - (apply icon-set `(,name :face ,(intern (concat "all-the-icons-" color)) :height ,height :v-adjust ,v-adjust)) + (apply icon-set `(,name :face ,(intern (concat "nerd-icons-" color)) :height ,height :v-adjust ,v-adjust)) (apply icon-set `(,name :height ,height :v-adjust ,v-adjust)))) (icon-width (+mu4e--get-string-width icon)) (space-width (+mu4e--get-string-width " ")) - (space-factor (- 2 (/ (float icon-width) space-width)))) - (concat (propertize " " 'display `(space . (:width ,space-factor))) icon))) + (space-factor (- 2 (/ (float icon-width) space-width))) + ;; always pad the left + (space-left (propertize " " 'display `(space . (:width ,space-factor)))) + ;; optionally pad the right + (space-right (if space-right space-left ""))) + (format "%s%s%s" space-left icon space-right))) ;; Set up all the fancy icons ;;;###autoload (defun +mu4e-initialise-icons () (setq mu4e-use-fancy-chars t - mu4e-headers-draft-mark (cons "D" (+mu4e-normalised-icon "pencil")) - mu4e-headers-flagged-mark (cons "F" (+mu4e-normalised-icon "flag")) - mu4e-headers-new-mark (cons "N" (+mu4e-normalised-icon "sync" :set "material" :height 0.8 :v-adjust -0.10)) - mu4e-headers-passed-mark (cons "P" (+mu4e-normalised-icon "arrow-right")) - mu4e-headers-replied-mark (cons "R" (+mu4e-normalised-icon "reply")) + + mu4e-modeline-all-clear (cons "C:" (+mu4e-normalised-icon "nf-md-check" :set "mdicon" :height 1.0 :space-right t)) ;;󰄬 + mu4e-modeline-all-read (cons "R:" (+mu4e-normalised-icon "nf-md-email_check" :set "mdicon" :height 1.0 :space-right t)) ;;󰪱 + mu4e-modeline-unread-items (cons "U:" (+mu4e-normalised-icon "nf-md-email_alert" :set "mdicon" :height 1.0 :space-right t)) ;;󰛏 + mu4e-modeline-new-items (cons "N:" (+mu4e-normalised-icon "nf-md-sync" :set "mdicon" :height 1.0 :space-right t)) ;;󰓦 + + mu4e-headers-draft-mark (cons "D" (+mu4e-normalised-icon "nf-fa-pencil")) + mu4e-headers-flagged-mark (cons "F" (+mu4e-normalised-icon "nf-fa-flag")) + mu4e-headers-new-mark (cons "N" (+mu4e-normalised-icon "nf-md-sync" :set "mdicon" :v-adjust -0.10)) + mu4e-headers-passed-mark (cons "P" (+mu4e-normalised-icon "nf-fa-arrow_right")) + mu4e-headers-replied-mark (cons "R" (+mu4e-normalised-icon "nf-fa-reply")) mu4e-headers-seen-mark (cons "S" "") ;(+mu4e-normalised-icon "eye" :height 0.6 :v-adjust 0.07 :color "dsilver")) - mu4e-headers-trashed-mark (cons "T" (+mu4e-normalised-icon "trash")) - mu4e-headers-attach-mark (cons "a" (+mu4e-normalised-icon "file-text-o" :color "silver")) - mu4e-headers-encrypted-mark (cons "x" (+mu4e-normalised-icon "lock")) - mu4e-headers-signed-mark (cons "s" (+mu4e-normalised-icon "certificate" :height 0.7 :color "dpurple")) - mu4e-headers-unread-mark (cons "u" (+mu4e-normalised-icon "eye-slash" :v-adjust 0.05)) - mu4e-headers-list-mark (cons "l" (+mu4e-normalised-icon "sitemap" :set "faicon")) - mu4e-headers-personal-mark (cons "p" (+mu4e-normalised-icon "user")) - mu4e-headers-calendar-mark (cons "c" (+mu4e-normalised-icon "calendar")))) + mu4e-headers-trashed-mark (cons "T" (+mu4e-normalised-icon "nf-fa-trash")) + mu4e-headers-attach-mark (cons "a" (+mu4e-normalised-icon "nf-fa-file_text_o" :color "silver")) + mu4e-headers-encrypted-mark (cons "x" (+mu4e-normalised-icon "nf-fa-lock")) + mu4e-headers-signed-mark (cons "s" (+mu4e-normalised-icon "nf-fa-certificate" :height 0.7 :color "dpurple")) + mu4e-headers-unread-mark (cons "u" (+mu4e-normalised-icon "nf-fa-eye_slash" :v-adjust 0.05)) + mu4e-headers-list-mark (cons "l" (+mu4e-normalised-icon "nf-fa-sitemap" :set "faicon")) + mu4e-headers-personal-mark (cons "p" (+mu4e-normalised-icon "nf-fa-user")) + mu4e-headers-calendar-mark (cons "c" (+mu4e-normalised-icon "nf-fa-calendar")))) (defun +mu4e-colorize-str (str &optional unique herring) "Apply a face from `+mu4e-header-colorized-faces' to STR. diff --git a/modules/email/mu4e/config.el b/modules/email/mu4e/config.el index 782157330..9f2791271 100644 --- a/modules/email/mu4e/config.el +++ b/modules/email/mu4e/config.el @@ -42,7 +42,8 @@ "read-patch-directory" "replace-first-line-matching" "request-contacts-maybe" "rfc822-phrase-type" "start" "stop" "temp-window" "update-contacts" "update-mail-and-index-real" - "update-mail-mode" "update-sentinel-func")) + "update-mail-mode" "update-sentinel-func" "view-gather-mime-parts" + "view-open-file" "view-mime-part-to-temp-file")) (defalias (intern (concat "mu4e--" transferable-suffix)) (intern (concat "mu4e~" transferable-suffix)) "Alias to provide the API of mu4e 1.8 (mu4e~ ⟶ mu4e--).") @@ -119,6 +120,7 @@ is non-nil." ;; Better search symbols (letf! ((defun make-help-button (text help-echo) (with-temp-buffer + (insert " ") (insert-text-button text 'help-echo help-echo 'mouse-face nil) @@ -127,13 +129,13 @@ is non-nil." (cons (make-help-button text1 help-echo) (make-help-button text2 help-echo)))) (setq mu4e-headers-threaded-label - (make-help-button-cons "T" (concat " " (all-the-icons-octicon "git-branch" :v-adjust 0.05)) + (make-help-button-cons "T" (nerd-icons-octicon "nf-oct-git_branch" :v-adjust 0.05) "Thread view") mu4e-headers-related-label - (make-help-button-cons "R" (concat " " (all-the-icons-material "link" :v-adjust -0.1)) + (make-help-button-cons "R" (nerd-icons-mdicon "nf-md-link" :v-adjust -0.1) "Showing related emails") mu4e-headers-full-label - (make-help-button-cons "F" (concat " " (all-the-icons-material "disc_full")) + (make-help-button-cons "F" (nerd-icons-mdicon "nf-md-disc") "Search is full!"))) ;; set mail user agent @@ -156,14 +158,14 @@ is non-nil." (add-to-list 'mu4e-bookmarks '("flag:flagged" "Flagged messages" ?f) t) - ;; TODO avoid assuming that all-the-icons is present + ;; TODO avoid assuming that nerd-icons is present (defvar +mu4e-header-colorized-faces - '(all-the-icons-green - all-the-icons-lblue - all-the-icons-purple-alt - all-the-icons-blue-alt - all-the-icons-purple - all-the-icons-yellow) + '(nerd-icons-green + nerd-icons-lblue + nerd-icons-purple-alt + nerd-icons-blue-alt + nerd-icons-purple + nerd-icons-yellow) "Faces to use when coloring folders and account stripes.") (defvar +mu4e-min-header-frame-width 120 @@ -220,6 +222,9 @@ is non-nil." ;; Wrap text in messages (setq-hook! 'mu4e-view-mode-hook truncate-lines nil) + ;; mu4e now uses `display-buffer-alist' so we need to add some rules of our own + (set-popup-rule! "^\\*mu4e-\\(main\\|headers\\)\\*" :ignore t) + ;; Html mails might be better rendered in a browser (add-to-list 'mu4e-view-actions '("View in browser" . mu4e-action-view-in-browser)) (when (fboundp 'make-xwidget) @@ -272,7 +277,7 @@ Acts like a singular `mu4e-view-save-attachments', without the saving." (lambda (part) (when (assoc "attachment" (cdr part)) part)) - (mu4e~view-gather-mime-parts)))) + (mu4e--view-gather-mime-parts)))) (files (+mu4e-part-selectors parts))) (cdr (assoc (completing-read "Select attachment: " (mapcar #'car files)) files)) (user-error (mu4e-format "No attached files found")))) @@ -280,13 +285,13 @@ Acts like a singular `mu4e-view-save-attachments', without the saving." (defun +mu4e-view-open-attachment () "Select an attachment, and open it." (interactive) - (mu4e~view-open-file - (mu4e~view-mime-part-to-temp-file (cdr (+mu4e-view-select-attachment))))) + (mu4e--view-open-file + (mu4e--view-mime-part-to-temp-file (cdr (+mu4e-view-select-attachment))))) (defun +mu4e-view-select-mime-part-action () "Select a MIME part, and perform an action on it." (interactive) - (let ((labeledparts (+mu4e-part-selectors (mu4e~view-gather-mime-parts)))) + (let ((labeledparts (+mu4e-part-selectors (mu4e--view-gather-mime-parts)))) (if labeledparts (mu4e-view-mime-part-action (cadr (assoc (completing-read "Select part: " (mapcar #'car labeledparts)) @@ -321,8 +326,8 @@ Acts like a singular `mu4e-view-save-attachments', without the saving." sizefmt (format "%%-%ds " maxsizelen)) (dolist (pinfo partinfo) (push (cons (concat (propertize (format "%-2s " (plist-get pinfo :index)) 'face '(bold font-lock-type-face)) - (when (featurep 'all-the-icons) - (all-the-icons-icon-for-file (or (plist-get pinfo :filename) ""))) + (when (featurep 'nerd-icons) + (nerd-icons-icon-for-file (or (plist-get pinfo :filename) ""))) (format fnamefmt (or (plist-get pinfo :filename) (propertize (plist-get pinfo :type) 'face '(italic font-lock-doc-face)))) (format sizefmt (propertize (plist-get pinfo :size) 'face 'font-lock-builtin-face)) @@ -359,17 +364,6 @@ This should already be the case yet it does not always seem to be." :before #'mu4e-compose-resend (read-only-mode -1)) - (defvar +mu4e-main-bullet "⚫" - "Prefix to use instead of \" *\" in the mu4e main view. -This is enacted by `+mu4e~main-action-str-prettier-a' and -`+mu4e~main-keyval-str-prettier-a'.") - - (advice-add #'mu4e--key-val :filter-return #'+mu4e~main-keyval-str-prettier-a) - (advice-add #'mu4e--main-action-str :override #'+mu4e~main-action-str-prettier-a) - (when (modulep! :editor evil) - ;; As +mu4e~main-action-str-prettier replaces [k]ey with key q]uit should become quit - (setq evil-collection-mu4e-end-region-misc "quit")) - ;; process lock control (when IS-WINDOWS (setq diff --git a/modules/email/notmuch/README.org b/modules/email/notmuch/README.org index b22d374c2..fe549e23e 100644 --- a/modules/email/notmuch/README.org +++ b/modules/email/notmuch/README.org @@ -23,7 +23,7 @@ This module turns Emacs into an email client using [[doom-package:notmuch]]. ** TODO Hacks #+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 ** TODO Changelog @@ -70,7 +70,7 @@ environment.systemPackages = with pkgs; [ * TODO Usage #+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 | Keymap | Command | Description | @@ -80,7 +80,7 @@ environment.systemPackages = with pkgs; [ * TODO Configuration #+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 ** Downloading your email @@ -203,5 +203,5 @@ features off: * TODO Appendix #+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 diff --git a/modules/email/wanderlust/README.org b/modules/email/wanderlust/README.org index 4123261b5..21f236458 100644 --- a/modules/email/wanderlust/README.org +++ b/modules/email/wanderlust/README.org @@ -5,7 +5,7 @@ * Description :unfold: #+begin_quote - 🔨 This module has no description. [[doom-contrib-module:][Write one?]] + 󱌣 This module has no description. [[doom-contrib-module:][Write one?]] #+end_quote ** Maintainers @@ -20,7 +20,7 @@ ** TODO Hacks #+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 ** TODO Changelog @@ -34,12 +34,12 @@ * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -50,5 +50,5 @@ * TODO Appendix #+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 diff --git a/modules/input/bidi/README.org b/modules/input/bidi/README.org index 72390c149..1cea6aeb5 100644 --- a/modules/input/bidi/README.org +++ b/modules/input/bidi/README.org @@ -67,7 +67,7 @@ right-to-left when ~+bidi-mode~ is on, add the following to your config: #+end_src #+begin_quote - 🚧 Do not do this if you are using ~+bidi-global-mode~, it will mess up all of +  Do not do this if you are using ~+bidi-global-mode~, it will mess up all of the buffers in Emacs that use English, including things like the =M-x= buffer. #+end_quote @@ -95,7 +95,7 @@ Hebrew and Arabic characters. They are set by default to =DejaVu Sans=, since it has decent looking Hebrew and Arabic character support. #+begin_quote - 📌 If you are writing in an Arabic-derived script, such as Persian, Urdu, or + 󰐃 If you are writing in an Arabic-derived script, such as Persian, Urdu, or Pashto, you may want to change ~+bidi-arabic-font~ to one specific to your language, especially if you want your script to be written in the Nastaliq style. @@ -145,5 +145,5 @@ If Emacs is having trouble properly displaying a Nastaliq font, try using one of * TODO Appendix #+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 diff --git a/modules/input/chinese/README.org b/modules/input/chinese/README.org index bee3f1aae..7a064b444 100644 --- a/modules/input/chinese/README.org +++ b/modules/input/chinese/README.org @@ -38,7 +38,7 @@ methods: Pinyin and Wubi. [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] #+begin_quote - 🔨 This module is missing install instructions. [[doom-contrib-module:][Write some?]] + 󱌣 This module is missing install instructions. [[doom-contrib-module:][Write some?]] #+end_quote If you want to use rime as the input method engine: @@ -50,12 +50,12 @@ If you want to use rime as the input method engine: * TODO Usage #+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 * TODO Configuration #+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 ** Using fcitx5 @@ -74,5 +74,5 @@ Modify ~fcitx-remote-command~ to change the default: * TODO Appendix #+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 diff --git a/modules/input/chinese/config.el b/modules/input/chinese/config.el index f256fb66c..a60a38797 100644 --- a/modules/input/chinese/config.el +++ b/modules/input/chinese/config.el @@ -24,6 +24,7 @@ #'evil-pinyin--build-regexp-string #'pyim-cregexp-build))) ((modulep! :completion ivy) + (autoload 'pyim-cregexp-ivy "pyim-cregexp-utils") (setq ivy-re-builders-alist '((t . pyim-cregexp-ivy)))))) diff --git a/modules/input/japanese/README.org b/modules/input/japanese/README.org index 8ad2315bd..cfd497ed2 100644 --- a/modules/input/japanese/README.org +++ b/modules/input/japanese/README.org @@ -35,12 +35,12 @@ This module adds support for Japanese script. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -51,5 +51,5 @@ This module adds support for Japanese script. * TODO Appendix #+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 diff --git a/modules/input/layout/+bepo.el b/modules/input/layout/+bepo.el index a783bebc6..e6f5aa598 100644 --- a/modules/input/layout/+bepo.el +++ b/modules/input/layout/+bepo.el @@ -149,7 +149,7 @@ In all cases, 'h' functions go to 'c' and 'l' ones go to 'r' so the navigation k "»" ">")) (after! lsp-ui (+layout-bepo-rotate-ts-bare-keymap '(lsp-ui-peek-mode-map))) - (after! org + (after! org-capture (defadvice! doom-bepo--org-completing-read (&rest args) "Completing-read with SPACE being a normal character, and C-c mapping left alone." :override #'org-completing-read diff --git a/modules/input/layout/README.org b/modules/input/layout/README.org index 1dc3dd530..18596db93 100644 --- a/modules/input/layout/README.org +++ b/modules/input/layout/README.org @@ -24,7 +24,7 @@ layouts. ** TODO Hacks #+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 ** TODO Changelog @@ -38,7 +38,7 @@ layouts. * TODO Usage #+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 ** Bépo @@ -104,7 +104,7 @@ Therefore, in ~org-mode~: * TODO Configuration #+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 ** Bépo @@ -151,5 +151,5 @@ restart. * TODO Appendix #+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 diff --git a/modules/lang/agda/README.org b/modules/lang/agda/README.org index 57dbbf341..a93911ec5 100644 --- a/modules/lang/agda/README.org +++ b/modules/lang/agda/README.org @@ -36,12 +36,12 @@ exists directly in the agda repository, but not in melpa. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -52,5 +52,5 @@ exists directly in the agda repository, but not in melpa. * TODO Appendix #+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 diff --git a/modules/lang/beancount/README.org b/modules/lang/beancount/README.org index 77e89581f..e48700aa2 100644 --- a/modules/lang/beancount/README.org +++ b/modules/lang/beancount/README.org @@ -22,7 +22,7 @@ you [[https://plaintextaccounting.org/][manage your money in plain text]]. ** Hacks - Associates the material =attach_money= icon with =*.beancount= files in the - [[doom-package:all-the-icons]] package. + [[doom-package:nerd-icons]] package. ** TODO Changelog # This section will be machine generated. Don't edit it by hand. @@ -34,15 +34,16 @@ you [[https://plaintextaccounting.org/][manage your money in plain text]]. This module requires: - [[https://github.com/beancount/beancount][beancount]], for generating reports - [[https://beancount.github.io/fava/][fava]], for a web interface for your ledgers +- [[doom-executable:bean-format]], if [[doom-module::editor format]] * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -53,5 +54,5 @@ This module requires: * TODO Appendix #+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 diff --git a/modules/lang/beancount/autoload.el b/modules/lang/beancount/autoload.el index 2d9c41a9f..599620ca3 100644 --- a/modules/lang/beancount/autoload.el +++ b/modules/lang/beancount/autoload.el @@ -3,7 +3,7 @@ ;; ;;; Helpers -;; Lifted from ledger +;; Lifted from ledger-mode (defconst +beancount--payee-any-status-regex "^[0-9]+[-/][-/.=0-9]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+\\(.+?\\)\\s-*\\(;\\|$\\)") @@ -111,9 +111,9 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order." (let ((inhibit-field-text-motion t)) (sort-subr reverse - '+beancount--navigate-next-xact - '+beancount--navigate-end-of-xact - '+beancount--sort-startkey)))) + #'+beancount--navigate-next-xact + #'+beancount--navigate-end-of-xact + #'+beancount--sort-startkey)))) (goto-char (point-min)) (re-search-forward (regexp-quote target-xact)) (goto-char (+ (match-beginning 0) point-delta)))) @@ -121,14 +121,16 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order." (defvar compilation-read-command) ;;;###autoload (defun +beancount/balance () - "Run 'bean-report bal'." + "Display a balance report with bean-report (bean-report bal)." (interactive) (let (compilation-read-command) (beancount--run "bean-report" buffer-file-name "bal"))) ;;;###autoload (defun +beancount/clone-transaction () - "TODO" + "Clones a transaction from (and to the bottom of) the current ledger buffer. + +Updates the date to today." (interactive) (save-restriction (widen) @@ -144,8 +146,9 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order." ;;;###autoload (defun +beancount/clone-this-transaction (&optional arg) - "Copy the current transaction to the bottom of the ledger. -Updates the date to today" + "Clones the transaction at point to the bottom of the ledger. + +Updates the date to today." (interactive "P") (if (and (not arg) (looking-at-p "^$")) (call-interactively #'+beancount/clone-transaction) @@ -165,16 +168,66 @@ Updates the date to today" (beancount-insert-date) (insert transaction))))) +;;;###autoload +(defun +beancount/occur (account &optional disable?) + "Hide transactions that don't involve ACCOUNT. + +If DISABLE? (universal arg), reveal hidden accounts without prompting." + (interactive + (list (unless current-prefix-arg + ;; REVIEW: Could/should this be generalized to search for arbitrary + ;; regexps, if desired? + (completing-read "Account: " #'beancount-account-completion-table)) + current-prefix-arg)) + (with-silent-modifications + (save-excursion + (setq header-line-format nil) + ;; TODO: Namespace these text-properties, in case of conflicts + (remove-text-properties (point-min) (point-max) '(invisible nil display nil)) + (unless disable? + ;; TODO: Prettier header-line display + (setq header-line-format `("" "Filtering by account: " ,account)) + (let ((start (point-min)) + (placeholder (propertize "[...]\n" 'face 'shadow))) + (goto-char start) + (while (re-search-forward (concat "\\_<" (regexp-quote account) "\\_>") nil t) + (save-excursion + (seq-let (beg end) (beancount-find-transaction-extents (point)) + ;; TODO: Highlight entry (ala org-occur) + (if (= beg end) + (setq end (save-excursion (goto-char end) (1+ (eol))))) + (put-text-property start beg 'invisible t) + (put-text-property start beg 'display placeholder) + (setq start end)))) + (put-text-property start (point-max) 'invisible t) + (put-text-property start (point-max) 'display placeholder)))))) + ;;;###autoload (defun +beancount/next-transaction (&optional count) "Jump to the start of the next COUNT-th transaction." (interactive "p") - (dotimes (_ (or count 1)) - (beancount-goto-next-transaction))) + (let ((beancount-transaction-regexp + ;; Don't skip over timestamped directives (like balance or event + ;; declarations). + (concat beancount-timestamped-directive-regexp + "\\|" beancount-transaction-regexp))) + (dotimes (_ (or count 1)) + (beancount-goto-next-transaction)))) ;;;###autoload (defun +beancount/previous-transaction (&optional count) - "Jump to the start of current or previous COUNT-th transaction." + "Jump to the start of current or previous COUNT-th transaction. + +Return non-nil if successful." (interactive "p") - (re-search-backward - beancount-transaction-regexp nil t (or count 1))) + (let ((pos (point))) + (condition-case e + (progn + ;; Ensures "jump to top of current transaction" behavior that is + ;; common for jump-to-previous commands like this in other Emacs modes + ;; (like org-mode). + (or (bolp) (goto-char (eol))) + (re-search-backward + (concat beancount-timestamped-directive-regexp + "\\|" beancount-transaction-regexp))) + ('search-failed (goto-char pos) nil)))) diff --git a/modules/lang/beancount/config.el b/modules/lang/beancount/config.el index 19261c366..79e2cffc8 100644 --- a/modules/lang/beancount/config.el +++ b/modules/lang/beancount/config.el @@ -4,12 +4,11 @@ :mode ("\\.beancount\\'" . beancount-mode) :hook (beancount-mode . outline-minor-mode) :init - ;; REVIEW Remove once domtronn/all-the-icons.el#272 is merged - (after! all-the-icons - (add-to-list 'all-the-icons-icon-alist - '("\\.beancount\\'" all-the-icons-material "attach_money" :face all-the-icons-lblue)) - (add-to-list 'all-the-icons-mode-icon-alist - '(beancount-mode all-the-icons-material "attach_money" :face all-the-icons-lblue))) + (after! nerd-icons + (add-to-list 'nerd-icons-extension-icon-alist + '("beancount" nerd-icons-faicon "nf-fa-money" :face nerd-icons-lblue)) + (add-to-list 'nerd-icons-mode-icon-alist + '(beancount-mode nerd-icons-faicon "nf-fa-money" :face nerd-icons-lblue))) :config (setq beancount-electric-currency t) @@ -26,6 +25,7 @@ :localleader "b" #'+beancount/balance "c" #'beancount-check + "s" #'+beancount/occur "l" #'beancount-linked "q" #'beancount-query "x" #'beancount-context diff --git a/modules/lang/cc/README.org b/modules/lang/cc/README.org index cd673da23..bf4d3eac7 100644 --- a/modules/lang/cc/README.org +++ b/modules/lang/cc/README.org @@ -133,9 +133,14 @@ rdm & rc -J $PROJECT_ROOT # loads PROJECT_ROOT's compile_commands.json #+end_src +** =:editor format= +The formatter used is [[doom-executable:clang-format]] which should be installed alongside =clang=. + +For more info, see [[doom-module::editor format]]. + * TODO Usage #+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 1. Enable this module. @@ -155,7 +160,7 @@ additional function to get inheritance type hierarchy is added: * TODO Configure #+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 ** Project compile settings @@ -274,5 +279,5 @@ lists available options * TODO Appendix #+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 diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index c0fb46811..75f74a55b 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -48,6 +48,17 @@ This is ignored by ccls.") (set-docsets! 'c-mode "C") (set-docsets! 'c++-mode "C++" "Boost") (set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{)) + (set-formatter! + 'clang-format + '("clang-format" + "-assume-filename" + (or (buffer-file-name) + (cdr (assoc major-mode + '((c-mode . ".c") + (c++-mode . ".cpp") + (cuda-mode . ".cu") + (protobuf-mode . ".proto")))))) + :modes '(c-mode c++-mode protobuf-mode cuda-mode)) (set-rotate-patterns! 'c++-mode :symbols '(("public" "protected" "private") ("class" "struct"))) @@ -229,8 +240,7 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e ;; than display a jarring confirmation prompt for killing it. (add-hook! 'kill-emacs-hook (ignore-errors (rtags-cancel-process))) - (add-hook 'rtags-jump-hook #'better-jumper-set-jump) - (add-hook 'rtags-after-find-file-hook #'recenter)) + (add-hook 'rtags-jump-hook #'better-jumper-set-jump)) ;; @@ -240,7 +250,12 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e (add-hook! '(c-mode-local-vars-hook c++-mode-local-vars-hook objc-mode-local-vars-hook - cmake-mode-local-vars-hook) + cmake-mode-local-vars-hook + ;; HACK Can't use cude-mode-local-vars-hook because cuda-mode + ;; isn't a proper major mode (just a plain function + ;; masquarading as one, so your standard mode hooks won't fire + ;; from switching to cuda-mode). + cuda-mode-hook) :append #'lsp!) (map! :after ccls diff --git a/modules/lang/cc/doctor.el b/modules/lang/cc/doctor.el index f9d2ee687..21c4bba08 100644 --- a/modules/lang/cc/doctor.el +++ b/modules/lang/cc/doctor.el @@ -26,3 +26,7 @@ ;; glslangValidator (unless (executable-find "glslangValidator") (warn! "Couldn't find glslangValidator. GLSL code completion is disabled"))) + +(when (modulep! :editor format) + (unless (executable-find "clang-format") + (warn! "Couldn't find clang-format. Formatting will be disabled."))) diff --git a/modules/lang/cc/packages.el b/modules/lang/cc/packages.el index ebf67ec56..67bc7bb2b 100644 --- a/modules/lang/cc/packages.el +++ b/modules/lang/cc/packages.el @@ -3,10 +3,10 @@ (package! cmake-mode :recipe (:host github :repo "emacsmirror/cmake-mode" :files (:defaults "*")) - :pin "6ce56331445ad7ef79a11d5a3163364a883067c2") + :pin "f9c7a21254a82a8d44b623bdfded6d21b4ea33ef") (package! cuda-mode :pin "7f593518fd135fc6af994024bcb47986dfa502d2") (package! demangle-mode :pin "04f545adab066708d6151f13da65aaf519f8ac4e") -(package! disaster :pin "0c13bd244cc43773af81e52ce73a55f199d58a61") +(package! disaster :pin "16bba9afb92aacf06c088c29ba47813b65a80d87") (package! modern-cpp-font-lock :pin "43c6b68ff58fccdf9deef11674a172e4eaa8455c") (package! opencl-mode :pin "15091eff92c33ee0d1ece40eb99299ef79fee92d") @@ -19,7 +19,7 @@ (if (modulep! +lsp) (unless (modulep! :tools lsp +eglot) ;; ccls package is necessary only for lsp-mode. - (package! ccls :pin "29d231590fad39b4d658d9262859e60669edb9b0")) + (package! ccls :pin "dd33da8ed74ea3936c1ac969fe1be02879825e86")) (when (package! irony :pin "870d1576fb279bb93f776a71e65f45283c423a9e") (package! irony-eldoc :pin "73e79a89fad982a2ba072f2fcc1b4e41f0aa2978") (when (and (modulep! :checkers syntax) @@ -28,7 +28,7 @@ (when (modulep! :completion company) (package! company-irony :pin "b44711dfce445610c1ffaec4951c6ff3882b216a") (package! company-irony-c-headers :pin "72c386aeb079fb261d9ec02e39211272f76bbd97"))) - (when (package! rtags :pin "9e442e5b30b6e9bbd3eb3bbc59db33177f15d730") + (when (package! rtags :pin "ee1ab7b9a6c88dc05282d9e3c64c0d380bf53c11") (when (modulep! :completion ivy) (package! ivy-rtags)) (when (modulep! :completion helm) diff --git a/modules/lang/clojure/README.org b/modules/lang/clojure/README.org index 453fc904c..d9d98d2e8 100644 --- a/modules/lang/clojure/README.org +++ b/modules/lang/clojure/README.org @@ -43,10 +43,13 @@ This module adds support for the Clojure(Script) language. This module requires: - [[https://clojure.org/][clojure]] + +This module optionally requires: - [[https://github.com/borkdude/clj-kondo][clj-kondo]], for linting code (if [[doom-module::checkers syntax]]) - [[https://clojure-lsp.github.io/clojure-lsp/][clojure-lsp]], for LSP support (if [[doom-module:+lsp]]) - [[https://github.com/babashka/neil][neil]] for the ability to add packages to your Clojure project from Emacs - [[https://github.com/borkdude/jet][jet]] for jet integration +- [[https://github.com/weavejester/cljfmt][cljfmt]], for formatting code (if [[doom-module::editor format]]) * Usage @@ -146,10 +149,17 @@ Several bindings used for viewing documentation for various functions, both insi | [[kbd:][K]] | ~+lookup/documentation~ | -* TODO Configuration -#+begin_quote - 🔨 This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]] -#+end_quote +* Configuration +** =enrich-classpath= +In recent versions, an option has been introduced that attempts to improve the experience of CIDER by accessing java source & javadocs, though this option is still currently considered beta. + +In order to opt into this, add the following to your =config.el= + +#+begin_src emacs-lisp +(setq cider-enrich-classpath t) +#+end_src + +See [[https://docs.cider.mx/cider/config/basic_config.html#use-enrich-classpath][the docs]] for more * Troubleshooting /There are no known problems with this module./ [[doom-report:][Report one?]] @@ -159,5 +169,5 @@ Several bindings used for viewing documentation for various functions, both insi * TODO Appendix #+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 diff --git a/modules/lang/clojure/config.el b/modules/lang/clojure/config.el index dc51777e5..832fa659e 100644 --- a/modules/lang/clojure/config.el +++ b/modules/lang/clojure/config.el @@ -16,6 +16,8 @@ (use-package! clojure-mode :hook (clojure-mode . rainbow-delimiters-mode) :config + (set-formatter! 'cljfmt '("cljfmt" "fix" "-") :modes '(clojure-mode clojurec-mode clojurescript-mode)) + (when (modulep! +lsp) (add-hook! '(clojure-mode-local-vars-hook clojurec-mode-local-vars-hook @@ -134,7 +136,7 @@ "Update repl icon on modeline with cider information." (setq cider-modeline-icon (concat " " - (+modeline-format-icon 'faicon "terminal" "" face label -0.0575) + (+modeline-format-icon 'faicon "nf-fa-terminal" "" face label -0.0575) " ")) (add-to-list 'global-mode-string '(t (:eval cider-modeline-icon)) diff --git a/modules/lang/clojure/doctor.el b/modules/lang/clojure/doctor.el index dff17429e..5cc63fb90 100644 --- a/modules/lang/clojure/doctor.el +++ b/modules/lang/clojure/doctor.el @@ -5,3 +5,7 @@ (not (modulep! +lsp))) (unless (executable-find "clj-kondo") (warn! "Couldn't find clj-kondo. flycheck-clj-kondo will not work."))) + +(when (modulep! :editor format) + (unless (executable-find "cljfmt") + (warn! "Couldn't find cljfmt. Formatting will be disabled."))) diff --git a/modules/lang/clojure/packages.el b/modules/lang/clojure/packages.el index 5603afe85..33c4f5fe9 100644 --- a/modules/lang/clojure/packages.el +++ b/modules/lang/clojure/packages.el @@ -10,17 +10,17 @@ ;; HACK Forward declare these clj-refactor/cider deps so that their deps are ;; byte-compiled first. -(package! parseclj :pin "4d0e780e00f1828b00c43099e6eebc6582998f72") -(package! parseedn :pin "a09686fbb9113b8b1b4f20c9e1dc0d6fea01a64f") +(package! parseclj :pin "74ff7d63fed92a3c859e474ae85f011e794b751a") +(package! parseedn :pin "c8f07926a688bfe995fde4460103915d401a1aff") ;;; Core packages -(package! clojure-mode :pin "3453cd229b412227aaffd1dc2870fa8fa213c5b1") -(package! clj-refactor :pin "b5abe655e572a6ecfed02bb8164b64716ef76b8e") -(package! cider :pin "1ed5163433c991c00ea83fdd4447e8daf4aeccbe") +(package! clojure-mode :pin "25d713a67d8e0209ee74bfc0153fdf677697b43f") +(package! clj-refactor :pin "0a2a6cbc2e29177f4f55730637a357433a03fa38") +(package! cider :pin "120fd885d37c07137f1c162e8d522ab3eed1ac3f") (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) (package! flycheck-clj-kondo :pin "ff7bed2315755cfe02ef471edf522e27b78cd5ca")) -(package! jet :pin "f007660c568e924e32d486a02aa4cd18203313cc") +(package! jet :pin "7d5157aac692fc761d8ed7a9f820fa6522136254") (package! neil :recipe (:host github :repo "babashka/neil" :files ("*.el")) - :pin "1dbac785cee4af8ad499839adbb83a8a297e7c70") + :pin "40993873bb4ef6d88af450e8a96d03275e266f6b") diff --git a/modules/lang/common-lisp/README.org b/modules/lang/common-lisp/README.org index 2bb211fff..1872f8f4f 100644 --- a/modules/lang/common-lisp/README.org +++ b/modules/lang/common-lisp/README.org @@ -39,7 +39,7 @@ This module requires [[http://www.sbcl.org/][SBCL]]. * TODO Usage #+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 This module does not integrate with [[doom-module::tools lsp]]. Sly (and SLIME before it) is @@ -59,9 +59,15 @@ This module also enables the evaluation of =lisp= source blocks in Org Mode. However, you will need a running Sly session for this to work. ~M-x sly~ starts such a session if you didn't have one open already. +** formatter +By enabling [[doom-module::editor format]], [[fn:apheleia-indent-lisp-buffer]] will be +used to format the current buffer. + +Enable [[doom-module::editor format +onsave]] to format the buffer on save. + * TODO Configuration #+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 If you don't want Sly to use SBCL, you can configure the variable @@ -75,5 +81,5 @@ If you don't want Sly to use SBCL, you can configure the variable * TODO Appendix #+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 diff --git a/modules/lang/common-lisp/config.el b/modules/lang/common-lisp/config.el index f773627cb..83a0a3030 100644 --- a/modules/lang/common-lisp/config.el +++ b/modules/lang/common-lisp/config.el @@ -26,10 +26,14 @@ (after! lisp-mode (set-repl-handler! 'lisp-mode #'+lisp/open-repl) (set-eval-handler! 'lisp-mode #'sly-eval-region) + (set-formatter! 'lisp-indent #'apheleia-indent-lisp-buffer :modes '(lisp-mode)) (set-lookup-handlers! 'lisp-mode :definition #'sly-edit-definition :documentation #'sly-describe-symbol)) + ;; This needs to be appended so it fires later than `sly-editing-mode' + (add-hook 'lisp-mode-local-vars-hook #'sly-lisp-indent-compatibility-mode 'append) + ;; HACK Ensures that sly's contrib modules are loaded as soon as possible, but ;; also as late as possible, so users have an opportunity to override ;; `sly-contrib' in an `after!' block. diff --git a/modules/lang/coq/README.org b/modules/lang/coq/README.org index 3bd58b72a..d2000e8db 100644 --- a/modules/lang/coq/README.org +++ b/modules/lang/coq/README.org @@ -34,7 +34,7 @@ This module adds [[https://coq.inria.fr][coq]] support, powered by [[https://pro * TODO Usage #+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 * Configuration @@ -49,5 +49,5 @@ See [[https://github.com/hlissner/doom-emacs/issues?q=is%3Aissue+is%3Aopen+label * TODO Appendix #+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 diff --git a/modules/lang/crystal/README.org b/modules/lang/crystal/README.org index 9b4122da5..2ca533792 100644 --- a/modules/lang/crystal/README.org +++ b/modules/lang/crystal/README.org @@ -45,12 +45,18 @@ This module requires: * TODO Usage #+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 +** formatter +By enabling [[doom-module::editor format]], [[doom-package:apheleia]] will be +used to format the current buffer. + +Enable [[doom-module::editor format +onsave]] to format the buffer on save. + * TODO Configuration #+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 * Troubleshooting @@ -61,5 +67,5 @@ This module requires: * TODO Appendix #+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 diff --git a/modules/lang/crystal/config.el b/modules/lang/crystal/config.el index 255f1a89d..979d27944 100644 --- a/modules/lang/crystal/config.el +++ b/modules/lang/crystal/config.el @@ -1,6 +1,8 @@ ;;; lang/crystal/config.el -*- lexical-binding: t; -*- (after! crystal-mode + (set-formatter! 'crystal-mode '("crystal" "tool" "format" "-") :modes '(crystal-mode)) + (set-lookup-handlers! 'crystal-mode :definition #'crystal-def-jump :references #'crystal-tool-imp) diff --git a/modules/lang/crystal/doctor.el b/modules/lang/crystal/doctor.el index b2f68f86e..23eb9171a 100644 --- a/modules/lang/crystal/doctor.el +++ b/modules/lang/crystal/doctor.el @@ -3,3 +3,6 @@ (unless (executable-find "icr") (warn! "Couldn't find icr. REPL will not work")) + +(unless (executable-find "crystal") + (error! "Couldn't find crystal. Most language features will not work.")) diff --git a/modules/lang/csharp/README.org b/modules/lang/csharp/README.org index a122fd7c6..fcde71183 100644 --- a/modules/lang/csharp/README.org +++ b/modules/lang/csharp/README.org @@ -45,24 +45,31 @@ This module requires: - .NET SDKs (on Windows) - .NET Core 1.X - 3.X or .NET 5 for cross platform - omnisharp-rosyln (if [[doom-module:+lsp]]) +- [[doom-executable:csharpier]] (if [[doom-module::editor format]]) -** TODO MacOS +** mono +*** TODO MacOS -** Arch Linux +*** Arch Linux #+begin_src sh pacman --needed --noconfirm -S mono #+end_src -** TODO NixOS +*** TODO NixOS + +** csharpier +#+begin_src shell +dotnet tool install csharpier -g +#+end_src * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -73,5 +80,5 @@ pacman --needed --noconfirm -S mono * TODO Appendix #+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 diff --git a/modules/lang/csharp/config.el b/modules/lang/csharp/config.el index d68e0a0eb..e0fe64a49 100644 --- a/modules/lang/csharp/config.el +++ b/modules/lang/csharp/config.el @@ -3,6 +3,7 @@ (use-package! csharp-mode :hook (csharp-mode . rainbow-delimiters-mode) :config + (set-formatter! 'csharpier '("dotnet-csharpier") :modes '(csharp-mode)) (set-electric! 'csharp-mode :chars '(?\n ?\})) (set-rotate-patterns! 'csharp-mode :symbols '(("public" "protected" "private") @@ -49,8 +50,10 @@ or terminating simple string." :defer t :init (add-hook 'csharp-mode-local-vars-hook #'tree-sitter! 'append) - (if (fboundp #'csharp-tree-sitter-mode) - (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-tree-sitter-mode)))) + (when (fboundp #'csharp-tree-sitter-mode) + (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-tree-sitter-mode)) + (when (modulep! +lsp) + (add-hook 'csharp-tree-sitter-mode-local-vars-hook #'lsp! 'append)))) ;; Unity shaders diff --git a/modules/lang/csharp/doctor.el b/modules/lang/csharp/doctor.el index e11ceb459..3d7b2be35 100644 --- a/modules/lang/csharp/doctor.el +++ b/modules/lang/csharp/doctor.el @@ -9,3 +9,7 @@ (assert! (or (not (modulep! +tree-sitter)) (modulep! :tools tree-sitter)) "This module requires (:tools tree-sitter)") + +(when (modulep! :editor format) + (unless (executable-find "dotnet-csharpier") + (warn! "csharpier is not installed, formatting will be disabled."))) diff --git a/modules/lang/dart/README.org b/modules/lang/dart/README.org index 0ca04e04b..5c875e7ab 100644 --- a/modules/lang/dart/README.org +++ b/modules/lang/dart/README.org @@ -84,10 +84,10 @@ flutter doctor # for Dependency check and further instructions * TODO Usage #+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 -- Syntax highlighting and formatting for ~.dart~ files provided by LSP. +- Syntax highlighting and formatting for ~.dart~ files provided by LSP or [[doom-module::editor format]]. - Auto import. - Widget guide lines for Flutter. - Closing labels for constructors. @@ -97,7 +97,7 @@ flutter doctor # for Dependency check and further instructions * TODO Configuration #+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 ** Dart & Flutter @@ -134,5 +134,5 @@ mention the Android SDK, as discussed above). * TODO Appendix #+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 diff --git a/modules/lang/dart/packages.el b/modules/lang/dart/packages.el index 297a54530..5a7c93395 100644 --- a/modules/lang/dart/packages.el +++ b/modules/lang/dart/packages.el @@ -3,7 +3,8 @@ (package! dart-mode :pin "9c846769abd37f7fdc7ba8388d1f3a2b844b75e3") -(when (modulep! +lsp) +(when (and (modulep! +lsp) + (not (modulep! :tools lsp +eglot))) (package! lsp-dart :pin "3db9f93c83052d6a8976c92d67d2b24473930760")) (when (modulep! +flutter) diff --git a/modules/lang/data/README.org b/modules/lang/data/README.org index 43e24b856..b39209db3 100644 --- a/modules/lang/data/README.org +++ b/modules/lang/data/README.org @@ -29,12 +29,12 @@ This module adds Emacs support for CSV and XML files. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -45,5 +45,5 @@ This module adds Emacs support for CSV and XML files. * TODO Appendix #+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 diff --git a/modules/lang/data/config.el b/modules/lang/data/config.el index 45ec4f6b1..f46042a09 100644 --- a/modules/lang/data/config.el +++ b/modules/lang/data/config.el @@ -7,8 +7,12 @@ :config (setq nxml-slash-auto-complete-flag t nxml-auto-insert-xml-declaration-flag t) + ;; https://github.com/Fuco1/smartparens/issues/397#issuecomment-501059014 + (after! smartparens + (sp-local-pair 'nxml-mode "<" ">" :post-handlers '(("[d1]" "/")))) (set-company-backend! 'nxml-mode '(company-nxml company-yasnippet)) - (setq-hook! 'nxml-mode-hook tab-width nxml-child-indent)) + (setq-hook! 'nxml-mode-hook tab-width nxml-child-indent) + (set-formatter! 'xmllint '("xmllint" "--format" "-") :modes '(nxml-mode))) ;;;###package csv-mode diff --git a/modules/lang/data/doctor.el b/modules/lang/data/doctor.el new file mode 100644 index 000000000..b18eb5d54 --- /dev/null +++ b/modules/lang/data/doctor.el @@ -0,0 +1,5 @@ +;;; lang/data/doctor.el -*- lexical-binding: t; -*- + +(when (modulep! :editor format) + (unless (executable-find "xmllint") + (warn! "Couldn't find xmllint. Formatting will be disabled."))) diff --git a/modules/lang/dhall/README.org b/modules/lang/dhall/README.org index 0e996234a..8bac03ffe 100644 --- a/modules/lang/dhall/README.org +++ b/modules/lang/dhall/README.org @@ -33,12 +33,12 @@ This module requires the =dhall-json= package, which provides both the * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -49,5 +49,5 @@ This module requires the =dhall-json= package, which provides both the * TODO Appendix #+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 diff --git a/modules/lang/elixir/README.org b/modules/lang/elixir/README.org index d4850645b..c1189cccf 100644 --- a/modules/lang/elixir/README.org +++ b/modules/lang/elixir/README.org @@ -65,7 +65,7 @@ zypper install elixir * TODO Usage #+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 - Code completion ([[doom-module::completion company]]) @@ -74,6 +74,7 @@ zypper install elixir - Phoenix support - ~iex~ integration ([[doom-module::tools eval]]) - Syntax checking ([[doom-module::checkers syntax]], using [[doom-package:flycheck-credo]]) +- Formatting for elixir files provided by [[doom-module::editor format]]. ** exunit-mode The exunit-mode prefix is [[kbd:][ t]]. Here is some examples: @@ -88,7 +89,7 @@ The exunit-mode prefix is [[kbd:][ t]]. Here is some examples: * TODO Configuration #+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 * Troubleshooting @@ -99,5 +100,5 @@ The exunit-mode prefix is [[kbd:][ t]]. Here is some examples: * TODO Appendix #+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 diff --git a/modules/lang/elm/README.org b/modules/lang/elm/README.org index 873ed3901..8445c7c20 100644 --- a/modules/lang/elm/README.org +++ b/modules/lang/elm/README.org @@ -32,7 +32,7 @@ This module adds [[https://elm-lang.org/][Elm]] support to Doom Emacs. [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] #+begin_quote - 🔨 /This module's prerequisites are not all documented./ [[doom-contrib-module:][Document them?]] + 󱌣 /This module's prerequisites are not all documented./ [[doom-contrib-module:][Document them?]] #+end_quote - If [[doom-module:+lsp]] is enabled, [[https://github.com/elm-tooling/elm-language-server][elm-language-server]] is required to be installed and in @@ -40,12 +40,18 @@ This module adds [[https://elm-lang.org/][Elm]] support to Doom Emacs. * TODO Usage #+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 +** formatter +By enabling [[doom-module::editor format]], [[doom-package:apheleia]] will be +used to format the current buffer. + +Enable [[doom-module::editor format +onsave]] to format the buffer on save. + * TODO Configuration #+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 * Troubleshooting @@ -56,5 +62,5 @@ This module adds [[https://elm-lang.org/][Elm]] support to Doom Emacs. * TODO Appendix #+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 diff --git a/modules/lang/emacs-lisp/README.org b/modules/lang/emacs-lisp/README.org index 827278bb9..2a034f580 100644 --- a/modules/lang/emacs-lisp/README.org +++ b/modules/lang/emacs-lisp/README.org @@ -53,12 +53,18 @@ about it. * TODO Usage #+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 +** formatter +By enabling [[doom-module::editor format]], [[doom-package:apheleia]] will be +used to format the current buffer. + +Enable [[doom-module::editor format +onsave]] to format the buffer on save. + * TODO Configuration #+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 * Troubleshooting @@ -69,5 +75,5 @@ about it. * TODO Appendix #+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 diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index 9e1aadbe3..b2e650320 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -102,15 +102,18 @@ if it's callable, `apropos' otherwise." (cond ((when-let (module (+emacs-lisp--module-at-point)) (doom/help-modules (car module) (cadr module)) (when (eq major-mode 'org-mode) + (goto-char (point-min)) (with-demoted-errors "%s" (re-search-forward (if (caddr module) - "\\* Module flags$" - "\\* Description$")) + "^\\*+ Module flags" + "^\\* Description")) (when (caddr module) (re-search-forward (format "=\\%s=" (caddr module)) nil t)) - (when (invisible-p (point)) + (when (memq (get-char-property (line-end-position) + 'invisible) + '(outline org-fold-outline)) (org-show-hidden-entry)))) 'deferred)) (thing (helpful-symbol (intern thing))) @@ -392,7 +395,7 @@ Intended as :around advice for `elisp-demos--search'." (or (funcall fn symbol) (with-file-contents! (doom-path doom-docs-dir "examples.org") (save-excursion - (when (re-search-backward + (when (re-search-forward (format "^\\*+[ \t]+\\(?:TODO \\)?%s$" (regexp-quote (symbol-name symbol))) nil t) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index d6393e384..1e140a00e 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -39,6 +39,7 @@ See `+emacs-lisp-non-package-mode' for details.") :documentation #'+emacs-lisp-lookup-documentation) (set-docsets! '(emacs-lisp-mode lisp-interaction-mode) "Emacs Lisp") (set-ligatures! 'emacs-lisp-mode :lambda "lambda") + (set-formatter! 'lisp-indent #'apheleia-indent-lisp-buffer :modes '(emacs-lisp-mode)) (set-rotate-patterns! 'emacs-lisp-mode :symbols '(("t" "nil") ("let" "let*") @@ -112,9 +113,6 @@ See `+emacs-lisp-non-package-mode' for details.") (when +emacs-lisp-enable-extra-fontification `((+emacs-lisp-highlight-vars-and-faces . +emacs-lisp--face))))) - ;; Recenter window after following definition - (advice-add #'elisp-def :after #'doom-recenter-a) - (defadvice! +emacs-lisp-append-value-to-eldoc-a (fn sym) "Display variable value next to documentation in eldoc." :around #'elisp-get-var-docstring diff --git a/modules/lang/erlang/README.org b/modules/lang/erlang/README.org index 3a2b6be03..f88be01dc 100644 --- a/modules/lang/erlang/README.org +++ b/modules/lang/erlang/README.org @@ -39,16 +39,23 @@ Includes: This module requires Erlang be installed (which includes ~erlang-mode~). Check your distribution's package manager or a version management tool such as [[https://github.com/kerl/kerl][kerl]]. -For LSP support, install [[https://github.com/erlang/sourcer][sourcer]]. +- [[https://github.com/erlang/sourcer][sourcer]] when [[doom-module::tools lsp]] & [[doom-module:+lsp]] +- [[https://github.com/sile/efmt][efmt]] when [[doom-module::editor format]] * TODO Usage #+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 +** formatter +By enabling [[doom-module::editor format]], [[doom-package:apheleia]] will be +used to format the current buffer. + +Enable [[doom-module::editor format +onsave]] to format the buffer on save. + * TODO Configuration #+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 * Troubleshooting @@ -59,5 +66,5 @@ For LSP support, install [[https://github.com/erlang/sourcer][sourcer]]. * TODO Appendix #+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 diff --git a/modules/lang/erlang/config.el b/modules/lang/erlang/config.el index edd3fd689..672ca5b6a 100644 --- a/modules/lang/erlang/config.el +++ b/modules/lang/erlang/config.el @@ -5,6 +5,7 @@ :mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode) :mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode) :config + (set-formatter! 'efmt '("efmt" "-") :modes '(erlang-mode)) (when (modulep! +lsp) (add-hook 'erlang-mode-local-vars-hook #'lsp! 'append)) diff --git a/modules/lang/erlang/doctor.el b/modules/lang/erlang/doctor.el index f442e8834..3997f8fa3 100644 --- a/modules/lang/erlang/doctor.el +++ b/modules/lang/erlang/doctor.el @@ -4,3 +4,7 @@ (assert! (or (not (modulep! +lsp)) (modulep! :tools lsp)) "This module requires (:tools lsp)") + +(when (modulep! :editor format) + (unless (executable-find "efmt") + (warn! "Couldn't find efmt. Formatting will be disabled."))) diff --git a/modules/lang/ess/README.org b/modules/lang/ess/README.org index 9637a0683..4ea980919 100644 --- a/modules/lang/ess/README.org +++ b/modules/lang/ess/README.org @@ -45,7 +45,7 @@ This module has several optional dependencies: * TODO Usage #+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 ** :map ess-doc-map @@ -92,7 +92,7 @@ This module has several optional dependencies: * TODO Configuration #+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 * Troubleshooting @@ -103,5 +103,5 @@ This module has several optional dependencies: * TODO Appendix #+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 diff --git a/modules/lang/factor/README.org b/modules/lang/factor/README.org index 86a494860..0cc9f0620 100644 --- a/modules/lang/factor/README.org +++ b/modules/lang/factor/README.org @@ -30,12 +30,12 @@ This module requires [[https://github.com/factor/factor][factor]] for its advanc * TODO Usage #+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 * TODO Configuration #+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 This module requires the installation of factor to be available at @@ -53,5 +53,5 @@ This module requires the installation of factor to be available at * TODO Appendix #+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 diff --git a/modules/lang/faust/README.org b/modules/lang/faust/README.org index d96526271..f8eb900f7 100644 --- a/modules/lang/faust/README.org +++ b/modules/lang/faust/README.org @@ -36,7 +36,7 @@ Add support to [[https://faust.grame.fr/][Faust language]] inside emacs. * TODO Usage #+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 | Binding | Description | @@ -54,7 +54,7 @@ Add support to [[https://faust.grame.fr/][Faust language]] inside emacs. * TODO Configuration #+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 * Troubleshooting @@ -65,5 +65,5 @@ Add support to [[https://faust.grame.fr/][Faust language]] inside emacs. * TODO Appendix #+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 diff --git a/modules/lang/fortran/README.org b/modules/lang/fortran/README.org index ac46501c0..6ccfa6598 100644 --- a/modules/lang/fortran/README.org +++ b/modules/lang/fortran/README.org @@ -20,7 +20,7 @@ In particular, this module features: - Optional Intel Fortran support via the [[doom-module:+intel]] flag. #+begin_quote - 💬 After a career of writing Fortran on Mainframes and Windows machines, my + 󰟶 After a career of writing Fortran on Mainframes and Windows machines, my now-retired Dad is switching to Linux. Imagine my surprise when I learned that off-the-shelf setups for Fortran on Linux basically don't exist! Well, until now... Cheers Dad, hope this helps. --[[doom-user:][fosskers]] @@ -97,14 +97,19 @@ your Bash Profile, etc., and log out and in again._ Now Doom will be able to use Good luck and happy computing! +** efmt +When [[doom-module::editor format]] is enabled and [[doom-executable:fprettify]] is installed, buffers can be formatted with [[fn:apheleia-format-buffer]]. + +Enable [[doom-module::editor format +onsave]] to format the buffer on save. + * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -115,5 +120,5 @@ Good luck and happy computing! * TODO Appendix #+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 diff --git a/modules/lang/fortran/autoload.el b/modules/lang/fortran/autoload.el index 8bf4443a6..f3d4d4488 100644 --- a/modules/lang/fortran/autoload.el +++ b/modules/lang/fortran/autoload.el @@ -63,7 +63,7 @@ or gfortran, depending on what feature flags are set." (_ ""))) ;;;###autoload -(defun +fortran-compilation-buffer-name-fn (mode) +(defun +fortran-compilation-buffer-name-fn (_mode) "The name of the buffer produced by `compile'." "*fortran-compilation*") @@ -115,3 +115,13 @@ or gfortran, depending on what feature flags are set." "Test the current project using fpm." (interactive) (compile "fpm test")) + +;;;###autoload +(defun +fortran/fpm-open-project-toml (project-root) + "Open fpm.toml at PROJECT-ROOT (defaults to the open project)." + (interactive (list (doom-project-root))) + (let ((file (file-name-concat project-root "fpm.toml"))) + (cond ((file-exists-p file) (find-file file)) + ((null project-root) (user-error "Not in a project")) + (t (user-error "No fpm.toml found at project root (%s)" + (abbreviate-file-name project-root)))))) diff --git a/modules/lang/fortran/config.el b/modules/lang/fortran/config.el index 310ee4b10..b42e76ad6 100644 --- a/modules/lang/fortran/config.el +++ b/modules/lang/fortran/config.el @@ -27,13 +27,16 @@ (:prefix ("f" . "fpm") :desc "fpm build" "b" #'+fortran/fpm-build :desc "fpm run" "r" #'+fortran/fpm-run - :desc "fpm test" "t" #'+fortran/fpm-test) + :desc "fpm test" "t" #'+fortran/fpm-test + :desc "Open project config" "o" #'+fortran/fpm-open-project-toml) (:prefix ("g" . "gfortran") :desc "compile" "c" #'+fortran/gfortran-compile :desc "run" "r" #'+fortran/gfortran-run) :desc "build" "b" #'+fortran/build :desc "run" "r" #'+fortran/run) + (set-formatter! 'fprettify '("fprettify" "-") :modes '(f90-mode fortran-mode)) + (when (modulep! +intel) (map! :map f90-mode-map :localleader @@ -47,6 +50,7 @@ ["Run" +fortran/run :active t :help "Run the Executable"] ["Test" +fortran/fpm-test :active (+fortran--fpm-toml) :help "Run the Unit Tests"]))) + (use-package! fortran ;; The `.for' extension is automatically recognized by Emacs and invokes ;; `fortran-mode', but not its capital variant `.FOR'. Many old files are diff --git a/modules/lang/fortran/doctor.el b/modules/lang/fortran/doctor.el index 27a12c0c9..976c36a45 100644 --- a/modules/lang/fortran/doctor.el +++ b/modules/lang/fortran/doctor.el @@ -18,6 +18,8 @@ (when (modulep! +lsp) (unless (executable-find "fortls") - (warn! "Couldn't find fortls.")) + (warn! "Couldn't find fortls. Language features will be disabled."))) + +(when (modulep! :editor format) (unless (executable-find "fprettify") - (warn! "Couldn't find fprettify."))) + (warn! "Couldn't find fprettify. Formatting will be disabled."))) diff --git a/modules/lang/fsharp/README.org b/modules/lang/fsharp/README.org index b528ab980..618959f19 100644 --- a/modules/lang/fsharp/README.org +++ b/modules/lang/fsharp/README.org @@ -48,14 +48,21 @@ pacman -S mono ** LSP The language server is automatically installed by [[https://github.com/emacs-lsp/lsp-mode/blob/master/clients/lsp-fsharp.el][lsp-fsharp]]. +** Fantomas +Fantomas is used for formatting via [[doom-module::editor format]] and can be installed as a [[https://dotnet.microsoft.com/en-us/download][dotnet]] tool. + +#+begin_src shell +dotnet tool install -g fantomas-tool +#+end_src + * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -66,5 +73,5 @@ The language server is automatically installed by [[https://github.com/emacs-lsp * TODO Appendix #+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 diff --git a/modules/lang/fsharp/config.el b/modules/lang/fsharp/config.el index 127f66840..6b79db3f8 100644 --- a/modules/lang/fsharp/config.el +++ b/modules/lang/fsharp/config.el @@ -11,6 +11,7 @@ (set-lookup-handlers! 'fsharp-mode :async t :definition #'fsharp-ac/gotodefn-at-point) (set-company-backend! 'fsharp-mode 'fsharp-ac/company-backend)) (set-repl-handler! 'fsharp-mode #'run-fsharp) + (set-formatter! 'fantomas '("fantomas" "--stdin") :modes '(fsharp-mode)) (map! :localleader :map fsharp-mode-map "b" #'fsharp-ac/pop-gotodefn-stack ; Useful for re-tracing your steps diff --git a/modules/lang/fstar/README.org b/modules/lang/fstar/README.org index 0979cf117..85ec8c0b6 100644 --- a/modules/lang/fstar/README.org +++ b/modules/lang/fstar/README.org @@ -50,12 +50,12 @@ yaourt -S fstar * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -69,5 +69,5 @@ yaourt -S fstar * TODO Appendix #+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 diff --git a/modules/lang/gdscript/README.org b/modules/lang/gdscript/README.org index aeb35d812..902ad861a 100644 --- a/modules/lang/gdscript/README.org +++ b/modules/lang/gdscript/README.org @@ -42,7 +42,7 @@ pip3 install gdtoolkit * TODO Usage #+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 ** LSP support @@ -60,7 +60,7 @@ available commands. * TODO Configuration #+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 * Troubleshooting @@ -74,5 +74,5 @@ available commands. * TODO Appendix #+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 diff --git a/modules/lang/gdscript/config.el b/modules/lang/gdscript/config.el index 9ab354a7b..f8496eeba 100644 --- a/modules/lang/gdscript/config.el +++ b/modules/lang/gdscript/config.el @@ -13,6 +13,8 @@ (set-lookup-handlers! 'gdscript-mode :documentation #'gdscript-docs-browse-symbol-at-point) + (set-formatter! 'gdformat '("gdformat" "-") :modes '(gdscript-mode)) + (when (modulep! +lsp) (add-hook 'gdscript-mode-local-vars-hook #'lsp! 'append)) diff --git a/modules/lang/gdscript/doctor.el b/modules/lang/gdscript/doctor.el new file mode 100644 index 000000000..2798524cc --- /dev/null +++ b/modules/lang/gdscript/doctor.el @@ -0,0 +1,5 @@ +;;; lang/gdscript/doctor.el -*- lexical-binding: t; -*- + +(when (modulep! :editor format) + (unless (executable-find "gdformat") + (warn! "Couldn't find gdformat. Formatting will be disabled."))) diff --git a/modules/lang/go/README.org b/modules/lang/go/README.org index a754e59a5..761ab8c9b 100644 --- a/modules/lang/go/README.org +++ b/modules/lang/go/README.org @@ -88,7 +88,7 @@ go install github.com/fatih/gomodifytags@latest * TODO Usage #+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 ** Keybinds @@ -126,7 +126,7 @@ go install github.com/fatih/gomodifytags@latest * TODO Configuration #+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 * Troubleshooting @@ -137,5 +137,5 @@ go install github.com/fatih/gomodifytags@latest * TODO Appendix #+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 diff --git a/modules/lang/go/config.el b/modules/lang/go/config.el index 525444a81..dc66af7b2 100644 --- a/modules/lang/go/config.el +++ b/modules/lang/go/config.el @@ -11,14 +11,6 @@ :references #'go-guru-referrers :documentation #'godoc-at-point) - ;; Redefines default formatter to *not* use goimports if reformatting a - ;; region; as it doesn't play well with partial code. - (set-formatter! 'gofmt - '(("%s" (if (or +format-region-p - (not (executable-find "goimports"))) - "gofmt" - "goimports")))) - (if (modulep! +lsp) (add-hook 'go-mode-local-vars-hook #'lsp! 'append) (add-hook 'go-mode-hook #'go-eldoc-setup)) diff --git a/modules/lang/graphql/README.org b/modules/lang/graphql/README.org index 772c13fd3..7a6952545 100644 --- a/modules/lang/graphql/README.org +++ b/modules/lang/graphql/README.org @@ -43,9 +43,15 @@ It includes: * Installation [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] +** LSP + This module has no direct requirements, but the +lsp flag requires a [[https://emacs-lsp.github.io/lsp-mode/page/lsp-graphql/][supported LSP server]]. +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]]. + * Usage ** Sending queries When visiting a graphql buffer, you have access to the ability to send the @@ -119,5 +125,5 @@ them into version control. * TODO Appendix #+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 diff --git a/modules/lang/graphql/config.el b/modules/lang/graphql/config.el index 4c222f269..f03597df1 100644 --- a/modules/lang/graphql/config.el +++ b/modules/lang/graphql/config.el @@ -1,18 +1,10 @@ ;;; lang/graphql/config.el -*- lexical-binding: t; -*- (after! graphql-mode - (defface all-the-icons-rhodamine + (defface nerd-icons-rhodamine '((t (:foreground "#E10098"))) "Face for GraphQL icon." - :group 'all-the-icons-faces) - ;; Define a doom-modeline compatiable major-mode icon - (after! all-the-icons - (setf (alist-get "graphql" all-the-icons-extension-icon-alist) - '(all-the-icons-fileicon "graphql" :v-adjust -0.05 :face all-the-icons-rhodamine)) - (setf (alist-get "gql" all-the-icons-extension-icon-alist) - '(all-the-icons-fileicon "graphql" :v-adjust -0.05 :face all-the-icons-rhodamine)) - (setf (alist-get 'graphql-mode all-the-icons-mode-icon-alist) - '(all-the-icons-fileicon "graphql" :v-adjust -0.05 :face all-the-icons-rhodamine))) + :group 'nerd-icons-faces) (if (modulep! +lsp) (add-hook 'graphql-mode-local-vars-hook #'lsp! 'append) (set-company-backend! 'graphql-mode 'company-graphql)) diff --git a/modules/lang/haskell/README.org b/modules/lang/haskell/README.org index 0e089a69d..7fce1d721 100644 --- a/modules/lang/haskell/README.org +++ b/modules/lang/haskell/README.org @@ -52,25 +52,30 @@ system package manager, cabal, or stack. formatters such as [[https://github.com/lspitzner/brittany][brittany]], [[https://github.com/ennocramer/floskell][floskell]], [[https://github.com/tweag/ormolu][ormolu]], [[https://github.com/fourmolu/fourmolu][fourmolu]], and [[https://github.com/haskell/stylish-haskell][stylish-haskell]], which can be installed through system package manager, cabal, or stack. +** Formatter + +[[doom-module::editor format]] by default uses [[https://github.com/fourmolu/fourmolu#installation][fourmolu]] to format code when not +relying on hls, follow the linked install instructions. + * TODO Usage #+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 This module integrates the haskell packages into Doom by providing things such as REPL support, project root recognition, etc. It also provide the following keybindings: -| Keybinding | Description | -|-----------------+-----------------------------------------------| -| [[kbd:][ b]] | Build the current cabal project | +| Keybinding | Description | +|-----------------+---------------------------------------------| +| [[kbd:][ b]] | Build the current cabal project | | [[kbd:][ c]] | Visit the =.cabal= file of the current buffer | -| [[kbd:][ h]] | Toggle visibility of the form at point | -| [[kbd:][ H]] | hides all top level functions | +| [[kbd:][ h]] | Toggle visibility of the form at point | +| [[kbd:][ H]] | hides all top level functions | * TODO Configuration #+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 After installing your preferred formatter, make sure to set @@ -91,5 +96,5 @@ Make sure to configure the lsp to use your perfered formatter, e.g.: * TODO Appendix #+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 diff --git a/modules/lang/haskell/packages.el b/modules/lang/haskell/packages.el index a6b80c28f..6eecc104d 100644 --- a/modules/lang/haskell/packages.el +++ b/modules/lang/haskell/packages.el @@ -1,8 +1,8 @@ ;; -*- no-byte-compile: t; -*- ;;; lang/haskell/packages.el -(package! haskell-mode :pin "3e146c1a89db257bb75c7b33fa2a5a1a85aabd51") +(package! haskell-mode :pin "79eaf444a72109f93f552abb53f834cc63bbf9f2") (when (and (modulep! +lsp) (not (modulep! :tools lsp +eglot))) - (package! lsp-haskell :pin "918ffa2516a59c90f909b584f7c9968716c0e006")) + (package! lsp-haskell :pin "89d16370434e9a247e95b8b701f524f5abfc884b")) diff --git a/modules/lang/hy/README.org b/modules/lang/hy/README.org index d5e177b1c..23d8de8fb 100644 --- a/modules/lang/hy/README.org +++ b/modules/lang/hy/README.org @@ -29,12 +29,12 @@ This module requires [[https://docs.hylang.org/en/alpha/][Hy]]. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -45,5 +45,5 @@ This module requires [[https://docs.hylang.org/en/alpha/][Hy]]. * TODO Appendix #+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 diff --git a/modules/lang/hy/config.el b/modules/lang/hy/config.el index aac5bcdc1..647bcd5a1 100644 --- a/modules/lang/hy/config.el +++ b/modules/lang/hy/config.el @@ -5,4 +5,5 @@ :interpreter "hy" :config (set-repl-handler! 'hy-mode #'hy-shell-start-or-switch-to-shell) + (set-formatter! 'lisp-indent #'apheleia-indent-lisp-buffer :modes '(hy-mode)) (set-company-backend! 'hy-mode 'company-hy)) diff --git a/modules/lang/idris/README.org b/modules/lang/idris/README.org index a8c5bc309..60dae66a8 100644 --- a/modules/lang/idris/README.org +++ b/modules/lang/idris/README.org @@ -26,12 +26,12 @@ This module adds rudimentary [[https://www.idris-lang.org/][Idris]] support to D [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] #+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 * TODO Usage #+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 In addition to ~idris-mode~ goodness, adds frequently used functions under the @@ -39,7 +39,7 @@ In addition to ~idris-mode~ goodness, adds frequently used functions under the * TODO Configuration #+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 * Troubleshooting @@ -50,5 +50,5 @@ In addition to ~idris-mode~ goodness, adds frequently used functions under the * TODO Appendix #+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 diff --git a/modules/lang/java/README.org b/modules/lang/java/README.org index 4f61fb98b..5dabda6a9 100644 --- a/modules/lang/java/README.org +++ b/modules/lang/java/README.org @@ -98,9 +98,21 @@ JAVA_HOME=~/.jabba/jdk/adopt@1.11.0-3 And then run ~$ direnv allow .~ in the project directory. The [[doom-module::tools direnv]] module will automatically source this environment before activating LSP servers. +** Formatter + +[[doom-module::editor format]] uses [[https://github.com/google/google-java-format][google-java-format]] to handle formatting. + +To install, grab the latest =all-deps.jar= release from the above, put it +somewhere and create a script similar to the below: + +=/usr/local/bin/google-java-format= +#+begin_src shell +java -jar /path/to/google-java-format-all-deps.jar +#+end_src + * TODO Usage #+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 ** [[doom-module:+lsp]] features @@ -142,7 +154,7 @@ According to [[https://github.com/mopemope/meghanada-emacs/]], you get: * TODO Configuration #+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 ** [[doom-module:+lsp]] @@ -166,5 +178,5 @@ Enable the [[doom-module::tools debugger +lsp]] module to get test runner suppor * TODO Appendix #+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 diff --git a/modules/lang/java/packages.el b/modules/lang/java/packages.el index 8bbde7eaf..e9ec41e84 100644 --- a/modules/lang/java/packages.el +++ b/modules/lang/java/packages.el @@ -2,10 +2,10 @@ ;;; lang/java/packages.el (package! android-mode :pin "d5332e339a1f5e30559a53feffb8442ca79265d6") -(package! groovy-mode :pin "c612ac1e9f742856914ad6e8eb9e9dc169f489ab") +(package! groovy-mode :pin "7b8520b2e2d3ab1d62b35c426e17ac25ed0120bb") (when (modulep! +meghanada) - (package! meghanada :pin "59c46cabb7eee715fe810ce59424934a1286df84")) + (package! meghanada :pin "fb29746e442e3d7b903759d15977d142a4bf2131")) (when (modulep! +eclim) (package! eclim :pin "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100") @@ -14,4 +14,4 @@ (when (modulep! +lsp) (unless (modulep! :tools lsp +eglot) - (package! lsp-java :pin "dbe448a886e2f4fb5d3a616f4499adbe643ba7a5"))) + (package! lsp-java :pin "449673da7221a30f1b1756cedcc48b9a2b52a51e"))) diff --git a/modules/lang/javascript/README.org b/modules/lang/javascript/README.org index a732c48a0..419d37c2f 100644 --- a/modules/lang/javascript/README.org +++ b/modules/lang/javascript/README.org @@ -42,7 +42,7 @@ This module adds [[https://www.javascript.com/][JavaScript]] and [[https://www.t ** TODO Hacks #+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 ** TODO Changelog @@ -58,9 +58,13 @@ This module requires [[https://nodejs.org/en/][NodeJS]] and one of [[https://www - Arch Linux: ~$ pacman --needed --noconfirm -S nodejs npm~ - openSUSE: ~$ zypper install nodejs npm~ +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]]. + * TODO Usage #+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 ~rjsx-mode~ is used for all javascript buffers. @@ -148,7 +152,7 @@ This module requires [[https://nodejs.org/en/][NodeJS]] and one of [[https://www * TODO Configuration #+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 * Troubleshooting @@ -159,5 +163,5 @@ This module requires [[https://nodejs.org/en/][NodeJS]] and one of [[https://www * TODO Appendix #+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 diff --git a/modules/lang/javascript/config.el b/modules/lang/javascript/config.el index 212ba6dd0..2e4dbd0c8 100644 --- a/modules/lang/javascript/config.el +++ b/modules/lang/javascript/config.el @@ -299,7 +299,6 @@ to tide." "e" #'skewer-html-eval-tag)) -;;;###package npm-mode (use-package! npm-mode :hook ((js-mode typescript-mode) . npm-mode) :config diff --git a/modules/lang/json/README.org b/modules/lang/json/README.org index c3d6ed960..996335237 100644 --- a/modules/lang/json/README.org +++ b/modules/lang/json/README.org @@ -32,16 +32,18 @@ This module adds [[https://www.json.org/json-en.html][JSON]] support to Doom Ema * Installation [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] -/This module has no external requirements./ +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]]. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -52,5 +54,5 @@ This module adds [[https://www.json.org/json-en.html][JSON]] support to Doom Ema * TODO Appendix #+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 diff --git a/modules/lang/julia/README.org b/modules/lang/julia/README.org index bb685d1a2..38e019278 100644 --- a/modules/lang/julia/README.org +++ b/modules/lang/julia/README.org @@ -101,7 +101,7 @@ But to let [[doom-package:eglot-jl]] use the environment bundled with it, set it * TODO Usage #+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 ** Language Server @@ -124,7 +124,7 @@ described above. * TODO Configuration #+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 ** Change the default environment for the Julia language server @@ -144,5 +144,5 @@ v1.6 by default as it is the current LTS: * TODO Appendix #+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 diff --git a/modules/lang/kotlin/README.org b/modules/lang/kotlin/README.org index 49e97a93e..af35162ab 100644 --- a/modules/lang/kotlin/README.org +++ b/modules/lang/kotlin/README.org @@ -25,21 +25,31 @@ This module adds [[https://kotlinlang.org/][Kotlin]] support to Doom Emacs. # This section will be machine generated. Don't edit it by hand. /This module does not have a changelog yet./ -* TODO Installation +* Installation [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] -#+begin_quote - 🔨 /This module's prerequisites are not documented./ [[doom-contrib-module:][Document them?]] -#+end_quote +Install kotlin through your distribution's package manager, eg: + +#+begin_src shell +sudo apt install kotlin # Ubuntu +sudo pacman -S kotlin # Arch Linux +brew install kotlin # MacOS +#+end_src + +or by getting the [[https://github.com/JetBrains/kotlin/releases/latest][latest]] release and adding to your =$PATH= manually. + +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://pinterest.github.io/ktlint/install/cli/][ktlint]]. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -50,5 +60,5 @@ This module adds [[https://kotlinlang.org/][Kotlin]] support to Doom Emacs. * TODO Appendix #+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 diff --git a/modules/lang/latex/README.org b/modules/lang/latex/README.org index 6ba4c5637..7de0b851b 100644 --- a/modules/lang/latex/README.org +++ b/modules/lang/latex/README.org @@ -47,7 +47,7 @@ Provide a helping hand when working with LaTeX documents. ** TODO Hacks #+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 ** TODO Changelog @@ -61,7 +61,7 @@ This module requires ghostscript and a latex compiler. These are provided by the =texlive= bundle, available through many OS package managers. #+begin_quote - 🚧 Ghostscript <= 9.27 is [[/auctex/manual/preview-latex/No-images-are-displayed-with-gs-9_002e27-and-earlier.html][reportedly buggy]] and doesn't work with auctex's math +  Ghostscript <= 9.27 is [[/auctex/manual/preview-latex/No-images-are-displayed-with-gs-9_002e27-and-earlier.html][reportedly buggy]] and doesn't work with auctex's math previews. (You can check you ghostscript version with ~$ gs --version~.) Most package managers already have newer versions, but if not you might have to build gs from source. @@ -85,7 +85,7 @@ brew install --cask mactex # WARNING: large 4gb download! #+end_src #+begin_quote - 🔨 This has not been verified. + 󱌣 This has not been verified. #+end_quote ** NixOS @@ -93,9 +93,13 @@ brew install --cask mactex # WARNING: large 4gb download! environment.systemPackages = [ pkgs.texlive.combined.scheme-medium ]; #+end_src +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://github.com/cmhughes/latexindent.pl][latexindent]]. + * TODO Usage #+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 * Configuration @@ -151,5 +155,5 @@ in latex buffers. * TODO Appendix #+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 diff --git a/modules/lang/latex/config.el b/modules/lang/latex/config.el index 3bc13b18b..ed8e59fd5 100644 --- a/modules/lang/latex/config.el +++ b/modules/lang/latex/config.el @@ -102,16 +102,23 @@ If no viewer is found, `latex-preview-pane-mode' is used.") (add-hook! '(tex-mode-local-vars-hook latex-mode-local-vars-hook) :append #'lsp!)) + ;; Define a function to compile the project. + (defun +latex/compile () + (interactive) + (TeX-save-document (TeX-master-file)) + (TeX-command TeX-command-default 'TeX-master-file -1)) (map! :localleader :map latex-mode-map :desc "View" "v" #'TeX-view - :desc "Compile" "c" #'TeX-command-run-all + :desc "Compile" "c" #'+latex/compile + :desc "Run all" "a" #'TeX-command-run-all :desc "Run a command" "m" #'TeX-command-master) (map! :after latex :localleader :map LaTeX-mode-map :desc "View" "v" #'TeX-view - :desc "Compile" "c" #'TeX-command-run-all + :desc "Compile" "c" #'+latex/compile + :desc "Run all" "a" #'TeX-command-run-all :desc "Run a command" "m" #'TeX-command-master)) diff --git a/modules/lang/lean/README.org b/modules/lang/lean/README.org index fd316a6d3..cf2f92fff 100644 --- a/modules/lang/lean/README.org +++ b/modules/lang/lean/README.org @@ -18,7 +18,7 @@ This module adds support for the [[https://leanprover.github.io/about/][Lean pro ** TODO Hacks #+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 ** TODO Changelog @@ -29,17 +29,17 @@ This module adds support for the [[https://leanprover.github.io/about/][Lean pro [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] #+begin_quote -🔨 /This module's prerequisites are not documented./ [[doom-contrib-module:][Document them?]] + 󱌣 /This module's prerequisites are not documented./ [[doom-contrib-module:][Document them?]] #+end_quote * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -50,5 +50,5 @@ This module adds support for the [[https://leanprover.github.io/about/][Lean pro * TODO Appendix #+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 diff --git a/modules/lang/ledger/README.org b/modules/lang/ledger/README.org index 6a57abff4..3666c809f 100644 --- a/modules/lang/ledger/README.org +++ b/modules/lang/ledger/README.org @@ -50,12 +50,12 @@ ledgers. * TODO Usage #+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 * TODO Configuration #+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 Please refer to ~ledger-mode~'s documentation for information on how to @@ -69,5 +69,5 @@ configure it. You can do so within emacs with [[kbd:][C-h i]] * TODO Appendix #+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 diff --git a/modules/lang/lua/README.org b/modules/lang/lua/README.org index 749f074e6..a07e0ecec 100644 --- a/modules/lang/lua/README.org +++ b/modules/lang/lua/README.org @@ -75,14 +75,18 @@ Eglot currently only supports one of the above servers out of the box: =$EMACSDIR/.local/etc/lsp/lua-language-server/=. See ~+lua-lsp-dir~ variable to change this. +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://github.com/JohnnyMorganz/StyLua#installation][Stylua]]. + * TODO Usage #+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 * TODO Configuration #+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 - lua-lsp-dir :: This must be set when using [[doom-module:+lsp]] and using [[https://github.com/sumneko/lua-language-server][lua-language-server]]. @@ -101,5 +105,5 @@ lua-language-server on non-VSCode platforms. * TODO Appendix #+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 diff --git a/modules/lang/lua/config.el b/modules/lang/lua/config.el index b87b6ad4d..f93a10611 100644 --- a/modules/lang/lua/config.el +++ b/modules/lang/lua/config.el @@ -64,6 +64,7 @@ lua-language-server.") (use-package! fennel-mode :when (modulep! +fennel) :mode "\\.fenneldoc\\'" + :hook (fennel-mode . rainbow-delimiters-mode) :config (set-lookup-handlers! 'fennel-mode :definition #'fennel-find-definition diff --git a/modules/lang/markdown/README.org b/modules/lang/markdown/README.org index c07e06bae..686df4a04 100644 --- a/modules/lang/markdown/README.org +++ b/modules/lang/markdown/README.org @@ -115,9 +115,13 @@ installed through your OS's package manager: + MacOS: ~$ brew install multimarkdown~ + Arch Linux: [[https://aur.archlinux.org/packages/multimarkdown/][multimarkdown]] is available on the AUR +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]]. + * TODO Usage #+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 ** Markdown preview @@ -128,7 +132,7 @@ Alternatively, you can use ~grip-mode~ through [[doom-module:+grip]]. * Configuration #+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 ** Changing how markdown is compiled @@ -169,5 +173,5 @@ Otherwise, you can change ~markdown-command~ directly: * TODO Appendix #+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 diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 6602d1339..6182d8eb1 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -26,10 +26,6 @@ capture, the end position, and the output buffer.") markdown-make-gfm-checkboxes-buttons t markdown-fontify-whole-heading-line t - ;; HACK Due to jrblevin/markdown-mode#578, invoking `imenu' throws a - ;; 'wrong-type-argument consp nil' error if you use native-comp. - markdown-nested-imenu-heading-index (not (ignore-errors (native-comp-available-p))) - ;; `+markdown-compile' offers support for many transpilers (see ;; `+markdown-compile-functions'), which it tries until one succeeds. markdown-command #'+markdown-compile diff --git a/modules/lang/markdown/packages.el b/modules/lang/markdown/packages.el index 1afd00040..cc59bb7fc 100644 --- a/modules/lang/markdown/packages.el +++ b/modules/lang/markdown/packages.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; -*- ;;; lang/markdown/packages.el -(package! markdown-mode :pin "c765b73b370f0fcaaa3cee28b2be69652e2d2c39") +(package! markdown-mode :pin "b1a862f0165b7bafe0f874738a55be1b1720dd7d") (package! markdown-toc :pin "3d724e518a897343b5ede0b976d6fb46c46bcc01") (package! edit-indirect :pin "f80f63822ffae78de38dbe72cacaeb1aaa96c732") diff --git a/modules/lang/nim/README.org b/modules/lang/nim/README.org index b61d87eeb..166e0f6da 100644 --- a/modules/lang/nim/README.org +++ b/modules/lang/nim/README.org @@ -51,14 +51,18 @@ Alternatively, nim is usually available through your OS's package manager: - Arch Linux: ~$ pacman --needed --noconfirm -S nim nimble~ - openSUSE: ~$ zypper install nim~ +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://github.com/FedericoCeratto/nimfmt#installation][nimfmt]]. + * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -69,5 +73,5 @@ Alternatively, nim is usually available through your OS's package manager: * TODO Appendix #+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 diff --git a/modules/lang/nim/config.el b/modules/lang/nim/config.el index 377154627..d15c271c5 100644 --- a/modules/lang/nim/config.el +++ b/modules/lang/nim/config.el @@ -12,6 +12,8 @@ nimsuggest isn't installed." (when (and nimsuggest-path (file-executable-p nimsuggest-path)) (nimsuggest-mode)))) + (set-formatter! 'nmfmt '("nimfmt" filepath) :modes '(nim-mode)) + (when IS-WINDOWS ;; TODO File PR/report upstream (https://github.com/nim-lang/nim-mode) (defadvice! +nim--suggest-get-temp-file-name-a (path) diff --git a/modules/lang/nim/doctor.el b/modules/lang/nim/doctor.el index 788238c98..32980d7ed 100644 --- a/modules/lang/nim/doctor.el +++ b/modules/lang/nim/doctor.el @@ -1,4 +1,4 @@ -;; -*- lexical-binding: t; no-byte-compile: t; -*- + ;;; lang/nim/doctor.el (unless (executable-find "nimsuggest") @@ -7,3 +7,6 @@ (unless (executable-find "nim") (warn! "Could not find nim executable; build commands will be disabled.")) +(when (modulep! :editor format) + (unless (executable-find "nimfmt") + (warn! "Could not find nimfmt. Formatting will be disabled."))) diff --git a/modules/lang/nim/packages.el b/modules/lang/nim/packages.el index b085dcde7..30993cbcc 100644 --- a/modules/lang/nim/packages.el +++ b/modules/lang/nim/packages.el @@ -3,7 +3,7 @@ ;;; requires nim nimsuggest nimble -(package! nim-mode :pin "744e076f0bea1c5ddc49f92397d9aa98ffa7eff8") +(package! nim-mode :pin "1338e5b0d5e111ad932efb77d3cad680cc3b86c9") (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) diff --git a/modules/lang/nix/README.org b/modules/lang/nix/README.org index 87999483c..1752a3b84 100644 --- a/modules/lang/nix/README.org +++ b/modules/lang/nix/README.org @@ -22,6 +22,12 @@ Includes: - +tree-sitter :: Leverages tree-sitter for better syntax highlighting and structural text editing. Requires [[doom-module::tools tree-sitter]]. +- +lsp :: + Enable an LSP hook for ~nix-mode~. Requires [[doom-module::tools lsp]] and a language + server (one of either ~nil~ or ~rnix-lsp~). + + You can still start a nix lsp manually without this flag, this just adds + a hook to always start the lsp when loading ~nix-mode~. ** Packages - [[doom-package:company-nixos-options]] if [[doom-module::completion company]] @@ -50,7 +56,7 @@ This module requires: * TODO Usage #+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 ** Keybindings @@ -66,7 +72,7 @@ This module requires: * TODO Configuration #+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 * Troubleshooting @@ -77,5 +83,5 @@ This module requires: * TODO Appendix #+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 diff --git a/modules/lang/ocaml/README.org b/modules/lang/ocaml/README.org index 1627a080d..07e4922bc 100644 --- a/modules/lang/ocaml/README.org +++ b/modules/lang/ocaml/README.org @@ -60,7 +60,7 @@ This module requires the following packages available through [[http://opam.ocam * TODO Usage #+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 - The following files should have syntax highlighting support: ~.ml{i,p,y,}~, @@ -83,7 +83,7 @@ This module requires the following packages available through [[http://opam.ocam * TODO Configuration #+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 - If [[doom-module::completion company]] is enabled then autocomplete is provided by [[doom-package:merlin]] @@ -110,5 +110,5 @@ missing tools. * TODO Appendix #+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 diff --git a/modules/lang/ocaml/config.el b/modules/lang/ocaml/config.el index 965955dce..b678437b5 100644 --- a/modules/lang/ocaml/config.el +++ b/modules/lang/ocaml/config.el @@ -1,5 +1,8 @@ ;;; lang/ocaml/config.el -*- lexical-binding: t; -*- +(after! projectile + (pushnew! projectile-project-root-files "dune-project")) + ;; ;;; Packages @@ -107,11 +110,9 @@ :commands ocamlformat :hook (tuareg-mode-local-vars . +ocaml-init-ocamlformat-h) :config - (set-formatter! 'ocamlformat #'ocamlformat - :modes '(caml-mode tuareg-mode)) ;; TODO Fix region-based formatting support (defun +ocaml-init-ocamlformat-h () - (setq +format-with 'ocp-indent) + (setq-local +format-with 'ocp-indent) (when (and (executable-find "ocamlformat") (locate-dominating-file default-directory ".ocamlformat")) (when buffer-file-name @@ -120,7 +121,7 @@ (setq-local ocamlformat-file-kind 'implementation)) ((equal ext ".eliomi") (setq-local ocamlformat-file-kind 'interface))))) - (setq +format-with 'ocamlformat)))) + (setq-local +format-with 'ocamlformat)))) ;; Tree sitter (eval-when! (modulep! +tree-sitter) diff --git a/modules/lang/org/README.org b/modules/lang/org/README.org index dd83410ec..1c923dd34 100644 --- a/modules/lang/org/README.org +++ b/modules/lang/org/README.org @@ -208,7 +208,7 @@ environment.systemPackages = with pkgs; [ * TODO Usage #+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 ** Invoking the org-capture frame from outside Emacs @@ -245,7 +245,7 @@ For =evil-mode= users, an overview of org-mode keybindings is provided [[https:/ * TODO Configuration #+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 ** Changing ~org-directory~ @@ -306,5 +306,5 @@ In order to migrate from v1 to v2 using Doom follow the next steps: * TODO Appendix #+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 diff --git a/modules/lang/org/autoload/org-capture.el b/modules/lang/org/autoload/org-capture.el index ed67ac1d6..1430d2336 100644 --- a/modules/lang/org/autoload/org-capture.el +++ b/modules/lang/org/autoload/org-capture.el @@ -84,7 +84,7 @@ If it is an absolute path return `+org-capture-todo-file' verbatim." ;;;###autoload (defun +org-capture-notes-file () "Expand `+org-capture-notes-file' from `org-directory'. -If it is an absolute path return `+org-capture-todo-file' verbatim." +If it is an absolute path return `+org-capture-notes-file' verbatim." (expand-file-name +org-capture-notes-file org-directory)) (defun +org--capture-local-root (path) diff --git a/modules/lang/org/autoload/org-link.el b/modules/lang/org/autoload/org-link.el index 0fb8464b9..aea9d0084 100644 --- a/modules/lang/org/autoload/org-link.el +++ b/modules/lang/org/autoload/org-link.el @@ -98,17 +98,14 @@ exist, and `org-link' otherwise." (when buffer-read-only (add-text-properties start end - (list 'display - (concat - #(" " 0 1 - (rear-nonsticky - t display (raise 0.05) - face (:family "github-octicons" - :inherit font-lock-variable-name-face - :height 0.8 - :box (:line-width 1 :style none))) - 1 2 (face (:height 0.2))) - var))))) + (list + 'display + (concat (nerd-icons-mdicon "nf-md-toggle_switch") ; "󰔡" + " " (propertize var + 'face + (if (boundp (intern var)) + 'font-lock-variable-name-face + 'shadow))))))) ;;;###autoload (defun +org-link--fn-link-activate-fn (start end fn _bracketed-p) @@ -116,31 +113,25 @@ exist, and `org-link' otherwise." (add-text-properties start end (list 'display - (concat - #("λ " 0 1 (face (:inherit font-lock-function-name-face - :box (:line-width 1 :style none) - :height 0.9)) - 1 2 (face (:height 0.2))) - fn))))) + (concat (nerd-icons-mdicon "nf-md-function") ; "󰊕" + " " (propertize fn + 'face + (if (fboundp (intern fn)) + 'font-lock-function-name-face + 'shadow))))))) ;;;###autoload -(defun +org-link--face-link-activate-face (start end face _bracketed-p) +(defun +org-link--face-link-activate-fn (start end face _bracketed-p) (when buffer-read-only (add-text-properties start end (list 'display - (concat - (propertize - "" - 'rear-nonsticky t - 'display '(raise -0.02) - 'face (list '(:family "file-icons" :height 1.0) - (if (facep (intern face)) - (intern face) - 'default) - '(:underline nil))) - #(" " 0 1 (face (:underline nil))) - face))))) + (concat (nerd-icons-mdicon "nf-md-format_text") ; "󰊄" + " " (propertize face + 'face + (if (facep (intern face)) + (intern face) + 'shadow))))))) (defun +org-link--command-keys (command) "Convert command reference TEXT to key binding representation." @@ -156,7 +147,7 @@ exist, and `org-link' otherwise." (concat prefix (and prefix " ") key-text))) ;;;###autoload -(defun +org-link--command-link-activate-command (start end command _bracketed-p) +(defun +org-link--command-link-activate-fn (start end command _bracketed-p) (when buffer-read-only (add-text-properties start end (list 'display (+org-link--command-keys command))))) @@ -182,51 +173,37 @@ exist, and `org-link' otherwise." (org-show-entry) (recenter))))) -;;;###autoload -(defun +org-link--doom-module-link-face-fn (module-path) - (cl-destructuring-bind (&key category module flag) - (+org-link--read-module-spec module-path) - (if (and category (doom-module-locate-path category module)) - `(:inherit org-priority - :weight bold) - 'error))) - ;;;###autoload (defun +org-link--doom-module-link-activate-fn (start end module-path _bracketed-p) (when buffer-read-only (cl-destructuring-bind (&key category module flag) (+org-link--read-module-spec module-path) (let ((overall-face - (cond - ((doom-module-p category module flag) - '((:underline nil) org-link org-block bold)) - ((and category (doom-module-locate-path category module)) - '(shadow org-block bold)) - (t '((:strike-through t) error org-block)))) + (if (and category (doom-module-locate-path category module)) + '((:underline nil) org-link org-block bold) + '(shadow org-block bold))) (icon-face - (if (doom-module-p category module flag) 'success 'error))) + (cond + ((doom-module-p category module flag) 'success) + ((and category (doom-module-locate-path category module)) 'warning) + (t 'error)))) (add-text-properties start end (list 'face overall-face 'display (concat - (propertize - " " - 'rear-nonsticky t - 'display '(raise -0.02) - 'face `(:inherit ,icon-face - :family "FontAwesome" - :height 1.0)) - module-path))))))) + (nerd-icons-octicon "nf-oct-stack" ; "" + :face icon-face) + " " module-path))))))) ;;;###autoload (defun +org-link--doom-package-link-activate-fn (start end package _bracketed-p) (when buffer-read-only (let ((overall-face (if (locate-library package) - '((:underline nil) org-link org-block italic) + '((:underline nil :weight regular) org-link org-block italic) '(shadow org-block italic))) - (pkg-face + (icon-face (cond ((featurep (intern package)) 'success) ((locate-library package) 'warning) @@ -236,16 +213,12 @@ exist, and `org-link' otherwise." (list 'face overall-face 'display (concat - (propertize - "\uf0c4" ; Octicon package symbol - 'rear-nonsticky t - 'display '(raise -0.02) - 'face `(:family "github-octicons" :height 1.0 - :inherit ,pkg-face)) + (nerd-icons-octicon "nf-oct-package" ; "" + :face icon-face) " " package)))))) ;;;###autoload -(defun +org-link-follow-doom-package-fn (pkg _prefixarg) +(defun +org-link--doom-package-link-follow-fn (pkg _prefixarg) "TODO" (doom/describe-package (intern-soft pkg))) @@ -257,17 +230,11 @@ exist, and `org-link' otherwise." start end (list 'display (concat - (propertize - "" - 'rear-nonsticky t - 'display '(raise -0.02) - 'face (list :family "all-the-icons" - :height 1.0 - :inherit (if found 'success 'error))) + (nerd-icons-octicon "nf-oct-terminal" ; "" + :face (if found 'success 'error)) " " - (propertize - executable - 'face (if found 'org-verbatim 'default)))))))) + (propertize executable + 'face (if found 'org-verbatim 'shadow)))))))) ;; ;;; Help-echo / eldoc diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index 6cd51bd45..7b318e5c2 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -371,7 +371,9 @@ see how ARG affects this command." (goto-char (point-min)) (while (not (eobp)) (org-next-visible-heading 1) - (when (outline-invisible-p (line-end-position)) + (when (memq (get-char-property (line-end-position) + 'invisible) + '(outline org-fold-outline)) (let ((level (org-outline-level))) (when (> level max) (setq max level)))))) @@ -489,7 +491,10 @@ All my (performant) foldings needs are met between this and `org-show-subtree' (or org-cycle-open-archived-trees (not (member org-archive-tag (org-get-tags)))) (or (not arg) - (setq invisible-p (outline-invisible-p (line-end-position))))) + (setq invisible-p + (memq (get-char-property (line-end-position) + 'invisible) + '(outline org-fold-outline))))) (unless invisible-p (setq org-cycle-subtree-status 'subtree)) (org-cycle-internal-local) @@ -503,7 +508,12 @@ All my (performant) foldings needs are met between this and `org-show-subtree' ;; Must be done on a timer because `org-show-set-visibility' (used by ;; `org-reveal') relies on overlays that aren't immediately available ;; when `org-mode' first initializes. - (run-at-time 0.1 nil #'org-reveal '(4)))) + (let ((buf (current-buffer))) + (unless (doom-temp-buffer-p buf) + (run-at-time 0.1 nil (lambda () + (when (buffer-live-p buf) + (with-current-buffer buf + (org-reveal '(4)))))))))) ;;;###autoload (defun +org-remove-occur-highlights-h () diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 553fc5e1a..9f614017b 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -160,7 +160,7 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default "IDEA(i)" ; An unconfirmed and unapproved task or notion "|" "DONE(d)" ; Task successfully completed - "KILL(k)") ; Task was cancelled, aborted or is no longer applicable + "KILL(k)") ; Task was cancelled, aborted, or is no longer applicable (sequence "[ ](T)" ; A task that needs doing "[-](S)" ; Task is in progress @@ -481,7 +481,9 @@ relative to `org-directory', unless it is an absolute path." ;; Autoload all these commands that org-attach doesn't autoload itself (use-package! org-attach - :commands (org-attach-new + :commands (org-attach-delete-one + org-attach-delete-all + org-attach-new org-attach-open org-attach-open-in-emacs org-attach-reveal-in-emacs @@ -548,34 +550,32 @@ relative to `org-directory', unless it is an absolute path." "var" :follow (-call-interactively #'helpful-variable) :activate-func #'+org-link--var-link-activate-fn - :face 'org-code) + :face '(font-lock-variable-name-face underline)) (org-link-set-parameters "fn" :follow (-call-interactively #'helpful-callable) :activate-func #'+org-link--fn-link-activate-fn - :face 'org-code) + :face '(font-lock-function-name-face underline)) (org-link-set-parameters "face" :follow (-call-interactively #'describe-face) - :activate-func #'+org-link--face-link-activate-face + :activate-func #'+org-link--face-link-activate-fn :face '(font-lock-type-face underline)) (org-link-set-parameters "cmd" :follow (-call-interactively #'describe-command) - :activate-func #'+org-link--command-link-activate-command + :activate-func #'+org-link--command-link-activate-fn :face 'help-key-binding :help-echo #'+org-link-doom--help-echo-from-textprop) (org-link-set-parameters "doom-package" - :follow #'+org-link-follow-doom-package-fn + :follow #'+org-link--doom-package-link-follow-fn :activate-func #'+org-link--doom-package-link-activate-fn - :face (lambda (_) '(:inherit org-priority :slant italic)) :help-echo #'+org-link-doom--help-echo-from-textprop) (org-link-set-parameters "doom-module" - :follow #'+org-link-follow-doom-module-fn + :follow #'+org-link--doom-module-link-follow-fn :activate-func #'+org-link--doom-module-link-activate-fn - :face #'+org-link--doom-module-link-face-fn :help-echo #'+org-link-doom--help-echo-from-textprop) (org-link-set-parameters "doom-executable" @@ -614,7 +614,9 @@ relative to `org-directory', unless it is an absolute path." (format "https://github.com/%s" (string-remove-prefix "@" (+org-link-read-desc-at-point link))))) - :face (lambda (_) 'org-priority)) + :face (lambda (_) + ;; Avoid confusion with function `org-priority' + 'org-priority)) (org-link-set-parameters "doom-changelog" :follow (lambda (link) diff --git a/modules/lang/org/contrib/present.el b/modules/lang/org/contrib/present.el index dd126b0d5..efed47aac 100644 --- a/modules/lang/org/contrib/present.el +++ b/modules/lang/org/contrib/present.el @@ -22,7 +22,7 @@ headings as titles, and you have more freedom to place them wherever you like.") (use-package! org-re-reveal :after ox :config - (setq org-re-reveal-root (expand-file-name "../../" (locate-library "dist/reveal.js" t)) + (setq org-re-reveal-root (concat "file://" (expand-file-name "../../" (locate-library "dist/reveal.js" t))) org-re-reveal-revealjs-version "4")) diff --git a/modules/lang/org/contrib/roam2.el b/modules/lang/org/contrib/roam2.el index 2aee84126..4463a3d46 100644 --- a/modules/lang/org/contrib/roam2.el +++ b/modules/lang/org/contrib/roam2.el @@ -78,7 +78,7 @@ In case of failure, fail gracefully." org-roam-node-display-template (format "${doom-hierarchy:*} %s %s" (propertize "${doom-type:12}" 'face 'font-lock-keyword-face) - (propertize "${doom-tags:42}" 'face 'org-tag)) + (propertize "${doom-tags:42}" 'face '(:inherit org-tag :box nil))) org-roam-completion-everywhere t org-roam-db-gc-threshold most-positive-fixnum ;; Reverse the default to favor faster searchers over slower ones. diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index 7c054b368..ac75cc70d 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -31,19 +31,19 @@ (format "(defun org-git-version (&rest _) \"%s-??-%s\")\n" version (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD"))) "(provide 'org-version)\n"))))) - :pin "d6f3aed7b1b01df7b092a47099205847b34fdd37") + :pin "57b94f3447b9046dac2f9238e24ad902510056cc") (package! org-contrib :recipe (:host github :repo "emacsmirror/org-contrib") - :pin "4ac1a280c740df121bcefb2ec99ddba945e857d3") + :pin "79286861ae3f4a47fbc66ce97cd527196f60c4a8") (package! avy) (package! htmlize :pin "dd27bc3f26efd728f2b1f01f9e4ac4f61f2ffbf9") (package! org-yt :recipe (:host github :repo "TobiasZawada/org-yt") - :pin "158e20204cd952a77c1e561552f1cdbfb1a5acb6") + :pin "56166f48e04d83668f70ed84706b7a4d8b1e5438") (package! ox-clip :pin "ff117cf3c619eef12eccc0ccbfa3f11adb73ea68") -(package! toc-org :pin "bf2e4b358efbd860ecafe6e74776de0885d9d100") +(package! toc-org :pin "6d3ae0fc47ce79b1ea06cabe21a3c596395409cd") (package! org-cliplink :pin "13e0940b65d22bec34e2de4bc8cba1412a7abfbc") ;; TODO Adjust when this is added to GNU ELPA @@ -56,7 +56,7 @@ (when (and IS-MAC (modulep! :os macos)) - (package! org-mac-link :pin "3a30a937e135a6637a5126e2ac096b6c90584045")) + (package! org-mac-link :pin "e30171a6e98db90787ab8a23b3a7dc4fd13b10f9")) (when (modulep! +passwords) (package! org-passwords @@ -69,11 +69,11 @@ :recipe (:host github :repo "hlissner/evil-org-mode") :pin "a9706da260c45b98601bcd72b1d2c0a24a017700")) (when (modulep! :tools pdf) - (package! org-pdftools :pin "967f48fb5038bba32915ee9da8dc4e8b10ba3376")) + (package! org-pdftools :pin "4e420233a153a9c4ab3d1a7e1d7d3211c836f0ac")) (when (modulep! :tools magit) - (package! orgit :pin "4a585029875a1dbbe96d8ac157bd2fd02875f289") + (package! orgit :pin "b60efabc4a1b15d7eacaabc5bdfe6f3c20fee161") (when (modulep! :tools magit +forge) - (package! orgit-forge :pin "8ba92a54aee9693b1bf03baf14f83550a7c89b18"))) + (package! orgit-forge :pin "f595a30aa75af55522b1203cd29198fb9aa3a0a5"))) (when (modulep! +brain) (package! org-brain :pin "2bad7732aae1a3051e2a14de2e30f970bbe43c25")) (when (modulep! +dragndrop) @@ -84,27 +84,27 @@ (when (modulep! +ipython) ; DEPRECATED (package! ob-ipython :pin "7147455230841744fb5b95dcbe03320313a77124")) (when (modulep! +jupyter) - (package! jupyter :pin "1baabc8f2d0631f8f4308400f9a53f1aadd58d14")) + (package! jupyter :pin "0a92c0c978ab12bd31a50a7e8b1295f5d1767e20")) (when (modulep! +journal) - (package! org-journal :pin "18df4d5ae5e15580df42562c143d007c6d28d75f")) + (package! org-journal :pin "a306f76ee2b0292946a20530bd9114aefc85a263")) (when (modulep! +noter) - (package! org-noter :pin "f9710c976823c180070cee4e958e0dc4531ba0de")) + (package! org-noter :pin "a4296d8338d46b5c863d3d339b50e201172f218c")) (when (modulep! +pomodoro) (package! org-pomodoro :pin "3f5bcfb80d61556d35fc29e5ddb09750df962cc6")) (when (modulep! +pretty) - (package! org-appear :pin "eb9f9db40aa529fe4b977235d86494b115281d17") + (package! org-appear :pin "81eba5d7a5b74cdb1bad091d85667e836f16b997") (package! org-superstar :pin "54c81c27dde2a6dc461bb064e79a8b2089093a2e") (package! org-fancy-priorities :pin "7f677c6c14ecf05eab8e0efbfe7f1b00ae68eb1d")) (when (modulep! +present) (package! centered-window :recipe (:host github :repo "anler/centered-window-mode") :pin "80965f6c6afe8d918481433984b493de72af5399") - (package! org-tree-slide :pin "97273dbb1718e9f63d338468e4c310167a846a67") - (package! org-re-reveal :pin "592985019905447d5f1fd6e24d14bfa9f4adf2f3") + (package! org-tree-slide :pin "e2599a106a26ce5511095e23df4ea04be6687a8a") + (package! org-re-reveal :pin "e7895dae9807df38b6e17b6c24e1e824caad6c46") (package! revealjs :recipe (:host github :repo "hakimel/reveal.js" :files ("css" "dist" "js" "plugin")) - :pin "12f5ba4c9d53c500ec20aea2cc8b8f66e725026a")) + :pin "d5896c968b2406126ca0beafecdffe219230b6b4")) (cond ((modulep! +roam) (package! org-roam @@ -152,7 +152,7 @@ :recipe (:host github :repo "DEADB17/ob-racket") :pin "d8fd51bddb019b0eb68755255f88fc800cfe03cb")) (when (modulep! :lang rest) - (package! ob-restclient :pin "ded3b7eb7b0592328a7a08ecce6f25278cba4a1d")) + (package! ob-restclient :pin "1a127eb0165f10bb9d33606aa8529051118805e7")) (when (modulep! :lang scala) (package! ob-ammonite :pin "39937dff395e70aff76a4224fa49cf2ec6c57cca")) diff --git a/modules/lang/php/README.org b/modules/lang/php/README.org index 1856be345..a0de2d973 100644 --- a/modules/lang/php/README.org +++ b/modules/lang/php/README.org @@ -16,7 +16,7 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs. - [[https://github.com/hlissner/doom-snippets/tree/master/php-mode][Snippets]] #+begin_quote - 💬 PHP was the first programming language I got paid to code in, back in the + 󰟶 PHP was the first programming language I got paid to code in, back in the Cretaceous period (2003). My sincerest apologies go out to all the programmers who inherited my earliest PHP work. I know you're out there, writhing in your straitjackets. @@ -154,7 +154,7 @@ your =$PATH=. * TODO Usage #+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 ** PHPUnit @@ -193,7 +193,7 @@ These are all run via [[kbd:][M-x]] too. * TODO Configuration #+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 ** Docker Compose @@ -252,5 +252,5 @@ And add the following to your config: * TODO Appendix #+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 diff --git a/modules/lang/php/config.el b/modules/lang/php/config.el index 20132e1da..5f9d711f3 100644 --- a/modules/lang/php/config.el +++ b/modules/lang/php/config.el @@ -30,7 +30,6 @@ (set-docsets! 'php-mode "PHP" "PHPUnit" "Laravel" "CakePHP" "CodeIgniter" "Doctrine_ORM") (set-repl-handler! 'php-mode #'+php/open-repl) (set-lookup-handlers! 'php-mode :documentation #'php-search-documentation) - (set-formatter! 'php-mode #'php-cs-fixer-fix) (set-ligatures! 'php-mode ;; Functional :lambda "function()" :lambda "fn" diff --git a/modules/lang/php/doctor.el b/modules/lang/php/doctor.el index 94f240ac5..6094a4c75 100644 --- a/modules/lang/php/doctor.el +++ b/modules/lang/php/doctor.el @@ -8,3 +8,9 @@ (assert! (or (not (modulep! +tree-sitter)) (modulep! :tools tree-sitter)) "This module requires (:tools tree-sitter)") + +(unless (executable-find "php") + (warn! "Couldn't find php in your PATH")) + +(unless (executable-find "composer") + (warn! "Couldn't find composer in your PATH")) diff --git a/modules/lang/plantuml/README.org b/modules/lang/plantuml/README.org index 3e35eb49f..1c16fdb15 100644 --- a/modules/lang/plantuml/README.org +++ b/modules/lang/plantuml/README.org @@ -31,12 +31,12 @@ This module requires =plantuml= to build diagrams with. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -47,5 +47,5 @@ This module requires =plantuml= to build diagrams with. * TODO Appendix #+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 diff --git a/modules/lang/plantuml/config.el b/modules/lang/plantuml/config.el index f55d45395..64ff4ed13 100644 --- a/modules/lang/plantuml/config.el +++ b/modules/lang/plantuml/config.el @@ -17,7 +17,11 @@ (use-package! flycheck-plantuml :when (modulep! :checkers syntax) :after plantuml-mode - :config (flycheck-plantuml-setup)) + :config + (flycheck-plantuml-setup) + (when (eq plantuml-default-exec-mode 'executable) + ;; Surprisingly, this works, even though flycheck-plantuml specifies -Djava.awt... + (setq-default flycheck-plantuml-executable plantuml-executable-path))) (after! ob-plantuml diff --git a/modules/lang/purescript/README.org b/modules/lang/purescript/README.org index e109cb0a4..11faa9751 100644 --- a/modules/lang/purescript/README.org +++ b/modules/lang/purescript/README.org @@ -26,21 +26,29 @@ This module adds [[https://www.purescript.org/][Purescript]] support to Doom Ema # This section will be machine generated. Don't edit it by hand. /This module does not have a changelog yet./ -* TODO Installation +* Installation [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] -#+begin_quote -🔨 /This module's prerequisites are not documented./ [[doom-contrib-module:][Document them?]] -#+end_quote +The main tools for PureScript are installed via npm. + +** Compiler +#+begin_src shell +npm install -g purescript spago +#+end_src + +** Formatter +#+begin_src sh +npm install -g purs-tidy +#+end_src * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -51,5 +59,5 @@ This module adds [[https://www.purescript.org/][Purescript]] support to Doom Ema * TODO Appendix #+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 diff --git a/modules/lang/purescript/config.el b/modules/lang/purescript/config.el index e05fd82bc..84d91f618 100644 --- a/modules/lang/purescript/config.el +++ b/modules/lang/purescript/config.el @@ -8,6 +8,8 @@ #'purescript-indentation-mode #'rainbow-delimiters-mode) + (set-formatter! 'purs-tidy '("purs-tidy" "format") :modes '(purescript-mode)) + (map! :localleader :map purescript-mode-map "t" #'psc-ide-show-type diff --git a/modules/lang/purescript/doctor.el b/modules/lang/purescript/doctor.el new file mode 100644 index 000000000..6dac317d3 --- /dev/null +++ b/modules/lang/purescript/doctor.el @@ -0,0 +1,5 @@ +;;; lang/purescript/doctor.el -*- lexical-binding: t; -*- + +(when (modulep! :editor format) + (unless (executable-find "purs-tidy") + (warn! "Could not find purs-tidy. Formatting will be disabled."))) diff --git a/modules/lang/python/README.org b/modules/lang/python/README.org index 6d248d200..cb70cb9e1 100644 --- a/modules/lang/python/README.org +++ b/modules/lang/python/README.org @@ -92,9 +92,13 @@ An alternative LSP server can be used by installing them through the - To install *mspyls*: ~M-x lsp-install-server RET mspyls~. - To install *pyright*: ~$ pip install pyright~ or ~$ npm i -g pyright~. +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://black.readthedocs.io/en/stable/getting_started.html#installation][black]]. + * TODO Usage #+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 This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language Server]], @@ -131,7 +135,7 @@ To enable support for auto-formatting with black enable [[doom-module::editor fo * TODO Configuration #+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 The arguments passed to the [[https://ipython.org/][ipython]] or [[https://jupyter.org/][jupyter]] shells can be altered through @@ -150,5 +154,5 @@ these two variables: * TODO Appendix #+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 diff --git a/modules/lang/qt/README.org b/modules/lang/qt/README.org index de13a0b53..2470b3b5d 100644 --- a/modules/lang/qt/README.org +++ b/modules/lang/qt/README.org @@ -33,12 +33,12 @@ This module provides language functionality for [[https://qt.io][Qt]] specific f * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -49,5 +49,5 @@ This module provides language functionality for [[https://qt.io][Qt]] specific f * TODO Appendix #+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 diff --git a/modules/lang/racket/README.org b/modules/lang/racket/README.org index 46a406e00..26e759c7e 100644 --- a/modules/lang/racket/README.org +++ b/modules/lang/racket/README.org @@ -43,14 +43,18 @@ Or, for fewer dependencies: pacman -S racket-minimal #+end_src +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://docs.racket-lang.org/fmt/][fmt]]. + * TODO Usage #+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 * TODO Configuration #+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 ** racket-smart-open-bracket-mode @@ -84,5 +88,5 @@ Once enabled, unicode input can be toggled by pressing C-\ or running * TODO Appendix #+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 diff --git a/modules/lang/racket/config.el b/modules/lang/racket/config.el index 2d890879b..ab5f90489 100644 --- a/modules/lang/racket/config.el +++ b/modules/lang/racket/config.el @@ -21,6 +21,7 @@ :dot ".") (set-rotate-patterns! 'racket-mode :symbols '(("#true" "#false"))) + (set-formatter! 'raco-fmt '("raco" "fmt") :modes '(racket-mode)) (add-hook! 'racket-mode-hook #'rainbow-delimiters-mode diff --git a/modules/lang/racket/doctor.el b/modules/lang/racket/doctor.el index cabeb0d55..6348e7406 100644 --- a/modules/lang/racket/doctor.el +++ b/modules/lang/racket/doctor.el @@ -9,3 +9,8 @@ (unless (executable-find "raco") (warn! "Could not find raco executable; commands for install packages and build libraries will not work.")) + +(when (modulep! :editor format) + (unless (and (executable-find "raco") + (eq 0 (call-process-shell-command "raco fmt --help" nil nil))) + (warn! "Couldn't find raco fmt. Formatting will be disabled."))) diff --git a/modules/lang/raku/README.org b/modules/lang/raku/README.org index 31a360f1d..d9ee09023 100644 --- a/modules/lang/raku/README.org +++ b/modules/lang/raku/README.org @@ -30,12 +30,12 @@ This module requires [[https://www.raku.org/][Raku]] for linting and evaluating * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -46,5 +46,5 @@ This module requires [[https://www.raku.org/][Raku]] for linting and evaluating * TODO Appendix #+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 diff --git a/modules/lang/rest/README.org b/modules/lang/rest/README.org index 5fe29bcbb..e28dc05e8 100644 --- a/modules/lang/rest/README.org +++ b/modules/lang/rest/README.org @@ -51,12 +51,12 @@ This module turns Emacs into a [[https://en.wikipedia.org/wiki/Representational_ * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -67,5 +67,5 @@ This module turns Emacs into a [[https://en.wikipedia.org/wiki/Representational_ * TODO Appendix #+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 diff --git a/modules/lang/rst/README.org b/modules/lang/rst/README.org index a019a62d4..5ad190be7 100644 --- a/modules/lang/rst/README.org +++ b/modules/lang/rst/README.org @@ -27,14 +27,18 @@ This module adds [[https://docutils.sourceforge.io/rst.html][ReStructured Text]] This module requires [[https://www.sphinx-doc.org/en/master/usage/installation.html][sphinx]] to build RST documents. +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://github.com/dzhu/rstfmt#usage][rstfmt]]. + * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -45,5 +49,5 @@ This module requires [[https://www.sphinx-doc.org/en/master/usage/installation.h * TODO Appendix #+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 diff --git a/modules/lang/rst/config.el b/modules/lang/rst/config.el index 34ea7a0b5..83c74b51f 100644 --- a/modules/lang/rst/config.el +++ b/modules/lang/rst/config.el @@ -1,7 +1,9 @@ ;;; lang/rst/config.el -*- lexical-binding: t; -*- (use-package! sphinx-mode - :hook (rst-mode . sphinx-mode)) + :hook (rst-mode . sphinx-mode) + :config + (set-formatter! 'rstfmt '("rstfmt") :modes '(rst-mode))) (use-package! rst :defer t diff --git a/modules/lang/rst/doctor.el b/modules/lang/rst/doctor.el new file mode 100644 index 000000000..b6b376202 --- /dev/null +++ b/modules/lang/rst/doctor.el @@ -0,0 +1,5 @@ +;;; lang/rst/doctor.el -*- lexical-binding: t; -*- + +(when (modulep! :editor format) + (unless (executable-find "rstfmt") + (warn! "Couldn't find rstfmt. Formatting will be disabled."))) diff --git a/modules/lang/ruby/README.org b/modules/lang/ruby/README.org index 137e651e6..d806e4b38 100644 --- a/modules/lang/ruby/README.org +++ b/modules/lang/ruby/README.org @@ -70,9 +70,13 @@ These guides will help you install Ruby: Then run ~$ gem install rubocop~ to install rubocop. +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]]. + * TODO Usage #+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 ** Commands @@ -107,7 +111,7 @@ The rspec-mode prefix is [[kbd:][ t]]: * TODO Configuration #+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 * Troubleshooting @@ -148,5 +152,5 @@ addressed upstream. PRs to fix them locally are welcome. * TODO Appendix #+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 diff --git a/modules/lang/ruby/packages.el b/modules/lang/ruby/packages.el index 43bfbc241..274775c9f 100644 --- a/modules/lang/ruby/packages.el +++ b/modules/lang/ruby/packages.el @@ -3,16 +3,16 @@ ;; Major modes (package! ruby-mode :built-in t) -(package! yard-mode :pin "ef3426ff55b6e91d581c8da12f5f64855d932527") +(package! yard-mode :pin "de1701753a64544c3376b015805f3661136d8038") ;; REPL -(package! inf-ruby :pin "6f1df882ab319758af43877fa20465f6566efbf3") +(package! inf-ruby :pin "03475ac1cca410ee63a523f5c63f859cfafe1aeb") (when (modulep! :completion company) (package! company-inf-ruby :pin "fe3e4863bc971fbb81edad447efad5795ead1b17")) ;; Programming environment (package! rubocop :pin "f5fd18aa810c3d3269188cbbd731ddc09006f8f5") -(package! robe :pin "b9d5ab549f73c5587415f538303fa76e0833354d") +(package! robe :pin "912ae2ba1f467bd55b2da64bfec9db3f8a723916") ;; Project tools (package! bundler :pin "43efb6be4ed118b06d787ce7fbcffd68a31732a7") @@ -27,7 +27,7 @@ (package! chruby :pin "42bc6d521f832eca8e2ba210f30d03ad5529788f")) ;; Testing frameworks -(package! rspec-mode :pin "62853a428b416e6a5fd3d8f57ff83a1798188a3f") +(package! rspec-mode :pin "29df3d081c6a1cbdf840cd13d45ea1c100c5bbaa") (package! minitest :pin "ddd152c990a528ad09a696bfad23afa4330ea4d7") ;; Rails diff --git a/modules/lang/rust/README.org b/modules/lang/rust/README.org index 3a7474bfe..93179ad59 100644 --- a/modules/lang/rust/README.org +++ b/modules/lang/rust/README.org @@ -53,7 +53,7 @@ $ rustup update --no-self-update To install and manage Rust on Windows, consult [[https://forge.rust-lang.org/infra/other-installation-methods.html][Rust's official documentation]]. #+begin_quote - 📌 Once installed, I recommended that you add Cargo's executable to your + 󰐃 Once installed, I recommended that you add Cargo's executable to your ~$PATH~, so that the Emacs utilities that depend on it -- or any tools installed through it -- can easily locate them (without any added configuration on your part). @@ -64,7 +64,7 @@ To install and manage Rust on Windows, consult [[https://forge.rust-lang.org/inf ** Other Requirements - If [[doom-module::editor format]] is enabled, you'll need =rustfmt=: ~$ rustup component add - rustfmt-preview~. + rustfmt~. - Users with [[doom-module:+lsp]] enabled will need [[github:rust-analyzer/rust-analyzer][rust-analyzer]] (rls is supported, but [[https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html][deprecated]]). - Using the following commands requires: @@ -73,7 +73,7 @@ To install and manage Rust on Windows, consult [[https://forge.rust-lang.org/inf * TODO Usage #+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 ** LSP support (rust-analyzer) @@ -111,7 +111,7 @@ Enable [[doom-module::editor format +onsave]] to get formatting on save with * TODO Configuration #+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 ** Enabling eglot support for Rust @@ -134,5 +134,5 @@ To fix this your project needs a =rustfmt.toml= with ~edition = "2018"~ in it. * TODO Appendix #+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 diff --git a/modules/lang/rust/config.el b/modules/lang/rust/config.el index 571a63077..9ed0483e3 100644 --- a/modules/lang/rust/config.el +++ b/modules/lang/rust/config.el @@ -30,6 +30,7 @@ (add-hook 'rustic-mode-hook #'rainbow-delimiters-mode) (set-docsets! 'rustic-mode "Rust") (set-popup-rule! "^\\*rustic-compilation" :vslot -1) + (set-popup-rule! "^\\*cargo-run" :vslot -1) (setq rustic-indent-method-chain t) diff --git a/modules/lang/scala/README.org b/modules/lang/scala/README.org index 813fe83ea..e6107a387 100644 --- a/modules/lang/scala/README.org +++ b/modules/lang/scala/README.org @@ -95,14 +95,18 @@ coursier bootstrap \ yay -S metals #+end_src +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://scalameta.org/scalafmt/docs/installation.html#cli][scalafmt]]. + * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -119,5 +123,5 @@ yay -S metals * TODO Appendix #+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 diff --git a/modules/lang/scala/config.el b/modules/lang/scala/config.el index c78a23b3f..d42e879db 100644 --- a/modules/lang/scala/config.el +++ b/modules/lang/scala/config.el @@ -22,6 +22,8 @@ (when (modulep! +tree-sitter) (add-hook 'scala-mode-local-vars-hook #'tree-sitter! 'append)) + (set-formatter! 'scalafmt '("scalafmt" "--stdin") :modes '(scala-mode)) + (set-ligatures! 'scala-mode ;; Functional :def "def" diff --git a/modules/lang/scala/doctor.el b/modules/lang/scala/doctor.el index 917a129bd..fc72e2f18 100644 --- a/modules/lang/scala/doctor.el +++ b/modules/lang/scala/doctor.el @@ -11,3 +11,7 @@ (if (and (modulep! +lsp) (not (executable-find "metals"))) (warn! "metals isn't installed")) + +(when (modulep! :editor format) + (unless (executable-find "scalafmt") + (warn! "Couldn't find scalafmt. Formatting will be disabled."))) diff --git a/modules/lang/scala/packages.el b/modules/lang/scala/packages.el index 2acdf10b8..ba727aef4 100644 --- a/modules/lang/scala/packages.el +++ b/modules/lang/scala/packages.el @@ -4,5 +4,6 @@ (package! sbt-mode :pin "9fe1e8807c22cc1dc56a6233e000969518907f4d") (package! scala-mode :pin "5d7cf21c37e345c49f921fe5111a49fd54efd1e0") -(when (modulep! +lsp) - (package! lsp-metals :pin "a2df7263ece6ac69214e41c52d66aab8d3f650eb")) +(when (and (modulep! +lsp) + (not (modulep! :tools lsp +eglot))) + (package! lsp-metals :pin "da7e54ed65f4e153c94b9c54689908dce142ef37")) diff --git a/modules/lang/scheme/README.org b/modules/lang/scheme/README.org index c0e917d61..73abceab3 100644 --- a/modules/lang/scheme/README.org +++ b/modules/lang/scheme/README.org @@ -57,7 +57,7 @@ Their executables must be present in your =$PATH= for [[doom-package:geiser]] to * TODO Usage #+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 | command | key / ex command | description | @@ -66,7 +66,7 @@ Their executables must be present in your =$PATH= for [[doom-package:geiser]] to * TODO Configuration #+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 * Troubleshooting @@ -77,5 +77,5 @@ Their executables must be present in your =$PATH= for [[doom-package:geiser]] to * TODO Appendix #+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 diff --git a/modules/lang/scheme/autoload.el b/modules/lang/scheme/autoload.el index 47d664680..75796492d 100644 --- a/modules/lang/scheme/autoload.el +++ b/modules/lang/scheme/autoload.el @@ -1,22 +1,5 @@ ;;; lang/scheme/autoload.el -*- lexical-binding: t; -*- -;; HACK `geiser' has poor autoload etiquette. It calls -;; `geiser-activate-implementation' and `geiser-implementation-extension' -;; in their autoloads files. Sure, these functions are autoloaded, but this -;; needlessly (and unavoidably) pulls in the `geiser-impl' package (et co) -;; when geiser-X's autoloads are read (i.e. at startup). -;; -;; I rectify this by inlining calls to these two functions (and the -;; `geiser-impl--add-to-alist' sub-call in -;; `geiser-implementation-extension'), and autoloading the two variables -;; they operate on. I do this from our autoloads file (which is -;; byte-compiled and read at startup before package autoloads). -;; TODO At some point, PR this behavior upstream (but not verbatim!) -;;;###autoload (defvar geiser-active-implementations ()) -;;;###autoload (defvar geiser-implementations-alist ()) -;;;###autoload (eval-and-compile (dolist (sym '(geiser-impl--add-to-alist geiser-activate-implementation geiser-implementation-extension)) (put sym 'byte-optimizer 'byte-compile-inline-expand))) - - (defvar calculate-lisp-indent-last-sexp) ;; Adapted from https://github.com/alezost/emacs-config/blob/master/utils/al-scheme.el#L76-L123 ;;;###autoload diff --git a/modules/lang/scheme/config.el b/modules/lang/scheme/config.el index 47fa31337..f76496225 100644 --- a/modules/lang/scheme/config.el +++ b/modules/lang/scheme/config.el @@ -3,7 +3,9 @@ (use-package! scheme :interpreter ("scsh" . scheme-mode) :hook (scheme-mode . rainbow-delimiters-mode) - :config (advice-add #'scheme-indent-function :override #'+scheme-indent-function-a)) + :config + (set-formatter! 'lisp-indent #'apheleia-indent-lisp-buffer :modes '(scheme-mode)) + (advice-add #'scheme-indent-function :override #'+scheme-indent-function-a)) (use-package! geiser diff --git a/modules/lang/scheme/packages.el b/modules/lang/scheme/packages.el index 449e3c8a6..5486dba71 100644 --- a/modules/lang/scheme/packages.el +++ b/modules/lang/scheme/packages.el @@ -4,12 +4,12 @@ (when (< emacs-major-version 29) (package! scheme :recipe (:host gitlab :repo "flatwhatson/scheme-mode") - :pin "aaef1f88cc34e8b6e07c207f9b8caff33f6e0740")) + :pin "51e586e5f1ddb5ea71d2cac8d401faf718c4627e")) -(when (package! geiser :pin "e54d5e6dc659c252d10c4280f4c4d78d38623df5") +(when (package! geiser :pin "49d12a14482ce9a193c049a5ccdd2fed90b0bdbe") (package! macrostep-geiser :pin "f6a2d5bb96ade4f23df557649af87ebd0cc45125") (when (modulep! +chez) - (package! geiser-chez :pin "246ec4c8bc4e7f64414e5cbe0fa66f0e5ef7d527")) + (package! geiser-chez :pin "605a81ff7b2d2b275a3ec68e3ce7e5b50f85014d")) (when (modulep! +chibi) (package! geiser-chibi :pin "5a6a5a580ea45cd4974df21629a8d50cbe3d6e99")) (when (modulep! +chicken) @@ -19,12 +19,12 @@ (when (modulep! +gauche) (package! geiser-gauche :pin "8ff743f6416f00751e24aef8b9791501a40f5421")) (when (modulep! +guile) - (package! geiser-guile :pin "24ce15de235c105daf5ecfb818200dae1c9815ee") + (package! geiser-guile :pin "ee33af6b4ef8fdaccbdf93c62b50fe17c07a1ade") (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) (package! flycheck-guile :recipe (:host github :repo "flatwhatson/flycheck-guile") - :pin "e23a4d7813179124fd98abf1c2f4190a72569bee"))) + :pin "dd7bbdc48fd21cf8d270c913c56cd580f8ec3d03"))) (when (modulep! +kawa) (package! geiser-kawa :pin "5896b19642923f74f718eb68d447560b2d26d797")) (when (modulep! +mit) diff --git a/modules/lang/sh/README.org b/modules/lang/sh/README.org index 6cd1c5a79..130aed01c 100644 --- a/modules/lang/sh/README.org +++ b/modules/lang/sh/README.org @@ -49,15 +49,17 @@ This module has several optional dependencies: - With the [[doom-module::tools debugger]] module - [[http://bashdb.sourceforge.net/][bashdb]]: Enables debugging for bash scripts - [[https://github.com/rocky/zshdb][zshdb]]: Enables debugging for zsh scripts +- With the [[doom-module::editor format]] module + - [[https://github.com/patrickvane/shfmt][shfmt]]: Enables formatting for {posix,ba,mk}sh scripts * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -68,5 +70,5 @@ This module has several optional dependencies: * TODO Appendix #+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 diff --git a/modules/lang/sh/config.el b/modules/lang/sh/config.el index 34b7032d5..5a5cd7ed5 100755 --- a/modules/lang/sh/config.el +++ b/modules/lang/sh/config.el @@ -17,10 +17,10 @@ :config (set-docsets! 'sh-mode "Bash") (set-electric! 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;")) - (set-formatter! 'shfmt - '("shfmt" "-ci" - ("-i" "%d" (unless indent-tabs-mode tab-width)) - ("-ln" "%s" (pcase sh-shell (`bash "bash") (`mksh "mksh") (_ "posix"))))) + (set-formatter! 'shfmt '("shfmt" "-ci" + (unless indent-tabs-mode + (list "-i" (number-to-string tab-width))))) + (set-repl-handler! 'sh-mode #'+sh/open-repl) (set-lookup-handlers! 'sh-mode :documentation #'+sh-lookup-documentation-handler) (set-ligatures! 'sh-mode @@ -85,10 +85,6 @@ ;; whatis lookups are exceptionally slow on macOS (#5860) company-shell-dont-fetch-meta IS-MAC)) -(use-package! fish-mode - :when (modulep! +fish) - :defer t - :config (set-formatter! 'fish-mode #'fish_indent)) (use-package! powershell :when (modulep! +powershell) diff --git a/modules/lang/sml/README.org b/modules/lang/sml/README.org index 150043776..745651e02 100644 --- a/modules/lang/sml/README.org +++ b/modules/lang/sml/README.org @@ -28,14 +28,18 @@ THis module adds [[https://smlfamily.github.io/][SML (Standard ML) programming l This module requires =sml= and =MLton=. +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://github.com/jluningp/smlformat#installation][smlformat]]. + * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -46,5 +50,5 @@ This module requires =sml= and =MLton=. * TODO Appendix #+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 diff --git a/modules/lang/sml/config.el b/modules/lang/sml/config.el index 7a5d69e04..9755cd33e 100644 --- a/modules/lang/sml/config.el +++ b/modules/lang/sml/config.el @@ -4,6 +4,7 @@ :mode "\\.s\\(?:ml\\|ig\\)\\'" :config (set-repl-handler! 'sml-mode #'run-sml) + (set-formatter! 'smlformat '("smlformat") :modes '(sml-mode)) ;; don't auto-close apostrophes (type 'a = foo) and backticks (`Foo) (sp-with-modes 'sml-mode diff --git a/modules/lang/sml/doctor.el b/modules/lang/sml/doctor.el new file mode 100644 index 000000000..de483c420 --- /dev/null +++ b/modules/lang/sml/doctor.el @@ -0,0 +1,5 @@ +;;; lang/sml/doctor.el -*- lexical-binding: t; -*- + +(when (modulep! :editor format) + (unless (executable-find "smlformat") + (warn! "Couldn't find smlformat. Formatting will be disabled."))) diff --git a/modules/lang/solidity/README.org b/modules/lang/solidity/README.org index 3a66e940a..680028883 100644 --- a/modules/lang/solidity/README.org +++ b/modules/lang/solidity/README.org @@ -55,14 +55,18 @@ can set it to your own =.soliumrc.json= with: (setq flycheck-solidity-solium-soliumrcfile "~/.soliumrc.json") #+end_src +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://github.com/prettier-solidity/prettier-plugin-solidity#installation-and-usage][prettier]]. + * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -73,5 +77,5 @@ can set it to your own =.soliumrc.json= with: * TODO Appendix #+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 diff --git a/modules/lang/solidity/config.el b/modules/lang/solidity/config.el index d53d8ca3d..330333f9d 100644 --- a/modules/lang/solidity/config.el +++ b/modules/lang/solidity/config.el @@ -7,6 +7,7 @@ (setq solidity-comment-style 'slash) (set-docsets! 'solidity-mode "Solidity") (set-company-backend! 'solidity-mode 'company-solidity) + (set-formatter! 'prettier-solidity '(npx "prettier" "--stdin-filepath" filepath "--parser=solidity") :modes '(solidity-mode)) (use-package! solidity-flycheck ; included with solidity-mode :when (and (modulep! :checkers syntax) diff --git a/modules/lang/swift/README.org b/modules/lang/swift/README.org index 380ae1165..510653c2b 100644 --- a/modules/lang/swift/README.org +++ b/modules/lang/swift/README.org @@ -35,18 +35,22 @@ This module adds support for the [[https://developer.apple.com/swift/][Swift pro * TODO Installation [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://github.com/nicklockwood/SwiftFormat#command-line-tool][swiftformat]]. + #+begin_quote -🔨 /This module's prerequisites are not documented./ [[doom-contrib-module:][Document them?]] + 󱌣 /This module's prerequisites are not documented./ [[doom-contrib-module:][Document them?]] #+end_quote * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -57,5 +61,5 @@ This module adds support for the [[https://developer.apple.com/swift/][Swift pro * TODO Appendix #+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 diff --git a/modules/lang/swift/config.el b/modules/lang/swift/config.el index 2e721ec18..ab66f2c48 100644 --- a/modules/lang/swift/config.el +++ b/modules/lang/swift/config.el @@ -2,7 +2,10 @@ (after! swift-mode (set-repl-handler! 'swift-mode #'run-swift) + (set-eglot-client! 'swift-mode '("sourcekit-lsp")) + (when (modulep! +lsp) + (add-hook 'swift-mode-local-vars-hook #'lsp! 'append)) (when (modulep! +tree-sitter) (add-hook 'swift-mode-local-vars-hook #'tree-sitter! 'append))) @@ -23,10 +26,11 @@ (use-package! lsp-sourcekit - :when (modulep! +lsp) + :when (and (modulep! +lsp) (not (modulep! :tools lsp +eglot))) :after swift-mode :init (add-hook 'swift-mode-local-vars-hook #'lsp! 'append) :config + (set-formatter! 'swiftformat '("swiftformat" "--output" "stdout")) (setq lsp-sourcekit-executable (cl-find-if #'executable-find (list lsp-sourcekit-executable ; 'sourcekit-lsp' by default diff --git a/modules/lang/swift/doctor.el b/modules/lang/swift/doctor.el index 15b420de4..3e2881b5b 100644 --- a/modules/lang/swift/doctor.el +++ b/modules/lang/swift/doctor.el @@ -3,3 +3,7 @@ (assert! (or (not (modulep! +tree-sitter)) (modulep! :tools tree-sitter)) "This module requires (:tools tree-sitter)") + +(when (modulep! :editor format) + (unless (executable-find "swiftformat") + (warn! "Couldn't find swiftformat. Formatting will be disabled."))) diff --git a/modules/lang/swift/packages.el b/modules/lang/swift/packages.el index 4ff56d17d..e3ed615bd 100644 --- a/modules/lang/swift/packages.el +++ b/modules/lang/swift/packages.el @@ -4,7 +4,8 @@ (package! swift-mode :pin "1244ee48de1895d33f55fed81fc90acda0c901f1") (if (modulep! +lsp) - (package! lsp-sourcekit :pin "468c641e35877e4e843f6b7c52a35937de562995") + (unless (modulep! :tools lsp +eglot) + (package! lsp-sourcekit :pin "468c641e35877e4e843f6b7c52a35937de562995")) (when (modulep! :completion company) (package! company-sourcekit :pin "a1860ad4dd3a542acd2fa0dfac2a388cbdf4af0c")) (when (and (modulep! :checkers syntax) diff --git a/modules/lang/terra/README.org b/modules/lang/terra/README.org index 52918e2ce..7cd3f8025 100644 --- a/modules/lang/terra/README.org +++ b/modules/lang/terra/README.org @@ -27,17 +27,17 @@ [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] #+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 * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -48,5 +48,5 @@ * TODO Appendix #+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 diff --git a/modules/lang/web/+html.el b/modules/lang/web/+html.el index 2dd0a881d..7baff19db 100644 --- a/modules/lang/web/+html.el +++ b/modules/lang/web/+html.el @@ -27,15 +27,15 @@ ;; tidy is already defined by the format-all package. We redefine it to add ;; more sensible arguments to the tidy command. - (set-formatter! 'html-tidy - '("tidy" "-q" "-indent" - "--tidy-mark" "no" - "--drop-empty-elements" "no" - ("--show-body-only" "%s" (if +format-region-p "true" "auto")) - ("--indent-spaces" "%d" tab-width) - ("--indent-with-tabs" "%s" (if indent-tabs-mode "yes" "no")) - ("-xml" (memq major-mode '(nxml-mode xml-mode)))) - :ok-statuses '(0 1)) + ;; (set-formatter! 'html-tidy + ;; '("tidy" "-q" "-indent" + ;; "--tidy-mark" "no" + ;; "--drop-empty-elements" "no" + ;; ("--show-body-only" "%s" (if +format-region-p "true" "auto")) + ;; ("--indent-spaces" "%d" tab-width) + ;; ("--indent-with-tabs" "%s" (if indent-tabs-mode "yes" "no")) + ;; ("-xml" (memq major-mode '(nxml-mode xml-mode)))) + ;; :ok-statuses '(0 1)) (setq web-mode-enable-html-entities-fontification t web-mode-auto-close-style 1) diff --git a/modules/lang/web/README.org b/modules/lang/web/README.org index b24116eed..4418f522b 100644 --- a/modules/lang/web/README.org +++ b/modules/lang/web/README.org @@ -38,7 +38,7 @@ ReactJS, Wordpress, Jekyll, Phaser, AngularJS, Djano, and more. ** TODO Hacks #+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 ** TODO Changelog @@ -48,18 +48,22 @@ ReactJS, Wordpress, Jekyll, Phaser, AngularJS, Djano, and more. * TODO Installation [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]]. + #+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 * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -70,5 +74,5 @@ ReactJS, Wordpress, Jekyll, Phaser, AngularJS, Djano, and more. * TODO Appendix #+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 diff --git a/modules/lang/yaml/README.org b/modules/lang/yaml/README.org index dd87f1fd0..7d9542f6c 100644 --- a/modules/lang/yaml/README.org +++ b/modules/lang/yaml/README.org @@ -30,16 +30,18 @@ This module provides support for the [[https://yaml.org/][YAML file format]] to * Installation [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] -/This module has no external requirements./ +** Formatter + +Formatting is handled using the [[doom-module::editor format]] module via [[https://prettier.io/docs/en/install.html][prettier]]. * TODO Usage #+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 * TODO Configuration #+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 * TODO Troubleshooting @@ -50,5 +52,5 @@ This module provides support for the [[https://yaml.org/][YAML file format]] to * TODO Appendix #+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 diff --git a/modules/lang/zig/README.org b/modules/lang/zig/README.org index 025870913..4a0e7aa70 100644 --- a/modules/lang/zig/README.org +++ b/modules/lang/zig/README.org @@ -45,7 +45,7 @@ systems are available for download from [[https://ziglang.org/download/]] or fro * TODO Usage #+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 ** LSP support @@ -65,7 +65,7 @@ This module supports LSP integration. For it to work you'll need: * TODO Configuration #+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 ** Customize zls path @@ -83,5 +83,5 @@ To customize the path of the =zls= executable, modify ~lsp-zig-zls-executable~: * TODO Appendix #+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 diff --git a/modules/lang/zig/config.el b/modules/lang/zig/config.el index 71f2b7657..ae69af00c 100644 --- a/modules/lang/zig/config.el +++ b/modules/lang/zig/config.el @@ -11,6 +11,7 @@ :hook (zig-mode . rainbow-delimiters-mode) :config (setq zig-format-on-save nil) ; rely on :editor format instead + (set-formatter! 'zigfmt '("zig" "fmt" "--stdin") :modes '(zig-mode)) (when (modulep! +lsp) (add-hook 'zig-mode-local-vars-hook #'lsp! 'append)) @@ -20,12 +21,13 @@ (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) - (flycheck-define-checker zig - "A zig syntax checker using zig's `ast-check` command." - :command ("zig" "ast-check" (eval (buffer-file-name))) - :error-patterns - ((error line-start (file-name) ":" line ":" column ": error: " (message) line-end)) - :modes zig-mode) + (eval '(flycheck-define-checker zig + "A zig syntax checker using zig's `ast-check` command." + :command ("zig" "ast-check" (eval (buffer-file-name))) + :error-patterns + ((error line-start (file-name) ":" line ":" column ": error: " (message) line-end)) + :modes zig-mode) + t) (add-to-list 'flycheck-checkers 'zig)) (map! :localleader diff --git a/modules/lang/zig/doctor.el b/modules/lang/zig/doctor.el index 361e4d69c..48668cef3 100644 --- a/modules/lang/zig/doctor.el +++ b/modules/lang/zig/doctor.el @@ -10,7 +10,10 @@ "This module requires (:tools tree-sitter)") (unless (executable-find "zig") - (warn! "Couldn't find zig binary")) + (warn! "Couldn't find zig binary") + + (unless (modulep! :editor format) + (warn! "Formatting will be disabled"))) (when (modulep! +lsp) (unless (executable-find "zls") diff --git a/modules/os/macos/README.org b/modules/os/macos/README.org index 97646a049..15439f307 100644 --- a/modules/os/macos/README.org +++ b/modules/os/macos/README.org @@ -30,7 +30,7 @@ This module requires a macOS environment. * TODO Usage #+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 ** "Open with X" @@ -51,7 +51,7 @@ To support GitHub Forge add an internet password like this to your keychain: * TODO Configuration #+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 * Troubleshooting @@ -62,5 +62,5 @@ To support GitHub Forge add an internet password like this to your keychain: * TODO Appendix #+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 diff --git a/modules/os/tty/README.org b/modules/os/tty/README.org index 35a063f06..6d210c05b 100644 --- a/modules/os/tty/README.org +++ b/modules/os/tty/README.org @@ -56,12 +56,12 @@ need: * TODO Usage #+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 * TODO Configuration #+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 ** True-color and italic support @@ -76,5 +76,5 @@ terminal Emacs. * TODO Appendix #+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 diff --git a/modules/term/eshell/README.org b/modules/term/eshell/README.org index 2c53aa762..837b8ecce 100644 --- a/modules/term/eshell/README.org +++ b/modules/term/eshell/README.org @@ -45,7 +45,7 @@ This module requires either [[https://fishshell.com/][Fish shell]] or [[https:// * TODO Usage #+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 - Command completion with Company @@ -55,7 +55,7 @@ This module requires either [[https://fishshell.com/][Fish shell]] or [[https:// * TODO Configuration #+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 ** TERM name @@ -71,5 +71,5 @@ will not always work 100%. Modifying ~eshell-term-name~ to your liking may help. * TODO Appendix #+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 diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index 41ca9f523..cf2beb9b2 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -69,7 +69,7 @@ You should use `set-eshell-alias!' to change this.") ;; TODO Use `eshell-input-filter-initial-space' when Emacs 25 support is dropped eshell-input-filter (lambda (input) (not (string-match-p "\\`\\s-+" input))) ;; em-prompt - eshell-prompt-regexp "^.* λ " + eshell-prompt-regexp "^[^#$\n]* [#$λ] " eshell-prompt-function #'+eshell-default-prompt-fn ;; em-glob eshell-glob-case-insensitive t @@ -105,13 +105,17 @@ You should use `set-eshell-alias!' to change this.") ;; cursor comes close to the left/right edges of the window. (setq-hook! 'eshell-mode-hook hscroll-margin 0) + ;; Recognize prompts as Imenu entries. + (setq-hook! 'eshell-mode-hook + imenu-generic-expression + `((,(propertize "λ" 'face 'eshell-prompt) + ,(concat eshell-prompt-regexp "\\(.*\\)") 1))) + ;; Don't auto-write our aliases! Let us manage our own `eshell-aliases-file' ;; or configure `+eshell-aliases' via elisp. (advice-add #'eshell-write-aliases-list :override #'ignore) - ;; REVIEW In Emacs 27 and newer, waiting for esh-module is unnecessary. - (after! esh-module - (add-to-list 'eshell-modules-list 'eshell-tramp)) + (add-to-list 'eshell-modules-list 'eshell-tramp) ;; Visual commands require a proper terminal. Eshell can't handle that, so ;; it delegates these commands to a term buffer. @@ -122,7 +126,51 @@ You should use `set-eshell-alias!' to change this.") (setq +eshell--default-aliases eshell-command-aliases-list eshell-command-aliases-list (append eshell-command-aliases-list - +eshell-aliases)))) + +eshell-aliases))) + + ;; HACK: Fixes #3817, where eshell completion after quotes is broken on Emacs + ;; 28 and older. + ;; CREDIT: Extracted from `cape''s cape-wrap-silent and cape-wrap-purify. + ;; REVIEW: Remove when Doom drops 28 support. + (when (< emacs-major-version 29) + (defadvice! +eshell--silent-a (capf) + "Call CAPF and silence it (no messages, no errors). +This function can be used as an advice around an existing Capf." + :around #'pcomplete-completions-at-point + (letf! ((defmacro silent (&rest body) `(quiet! (ignore-errors ,@body))) + (defmacro wrapped-table (wrap body) + `(lambda (str pred action) + (,@body + (let ((result (complete-with-action action table str pred))) + (when + (and (eq action 'completion--unquote) + (functionp (cadr result))) + (cl-callf ,wrap (cadr result))) + result)))) + (defun* silent-table (table) (wrapped-table silent-table (silent)))) + (pcase (silent (funcall capf)) + (`(,beg ,end ,table . ,plist) + `(,beg ,end ,(silent-table table) ,@plist))))) + + (defadvice! +eshell--purify-a (capf) + "Call CAPF and ensure that it does not illegally modify the buffer. This +function can be used as an advice around an existing Capf. It has been +introduced mainly to fix the broken `pcomplete-completions-at-point' function in +Emacs versions < 29." + ;; bug#50470: Fix Capfs which illegally modify the buffer or which + ;; illegally call `completion-in-region'. The workaround here was proposed + ;; by @jakanakaevangeli and is used in his capf-autosuggest package. + :around #'pcomplete-completions-at-point + (catch 'illegal-completion-in-region + (condition-case nil + (let ((buffer-read-only t) + (inhibit-read-only nil) + (completion-in-region-function + (lambda (beg end coll pred) + (throw 'illegal-completion-in-region + (list beg end coll :predicate pred))))) + (funcall capf)) + (buffer-read-only nil)))))) (after! esh-mode @@ -188,7 +236,9 @@ You should use `set-eshell-alias!' to change this.") (use-package eshell-syntax-highlighting - :hook (eshell-mode . eshell-syntax-highlighting-mode)) + :hook (eshell-mode . eshell-syntax-highlighting-mode) + :init + (add-hook 'eshell-syntax-highlighting-elisp-buffer-setup-hook #'highlight-quoted-mode)) (use-package! fish-completion diff --git a/modules/term/eshell/packages.el b/modules/term/eshell/packages.el index 8abed67b5..4bbff9fe5 100644 --- a/modules/term/eshell/packages.el +++ b/modules/term/eshell/packages.el @@ -6,8 +6,8 @@ (package! shrink-path :pin "c14882c8599aec79a6e8ef2d06454254bb3e1e41") (package! esh-help :pin "417673ed18a983930a66a6692dbfb288a995cb80") (package! eshell-did-you-mean :pin "80cd8c4b186a2fb29621cf634bcf2bcd914f1e3d") -(package! eshell-syntax-highlighting :pin "1ba39a9ffb2298cd716a4314cf3f369028c7bafe") +(package! eshell-syntax-highlighting :pin "4ac27eec6595ba116a6151dfaf0b0e0440101e10") (unless IS-WINDOWS - (package! fish-completion :pin "10384881817b5ae38cf6197a077a663420090d2c") - (package! bash-completion :pin "25611eed1e086c4e8cdd335dbd38b1d796be5b8d")) + (package! fish-completion :pin "df42e153082927536763bdf408184152a7c938c3") + (package! bash-completion :pin "f1daac0386c24cbe8a244a62c7588cc6847b07ae")) diff --git a/modules/term/shell/README.org b/modules/term/shell/README.org index 78d4f3c88..c7b13f453 100644 --- a/modules/term/shell/README.org +++ b/modules/term/shell/README.org @@ -40,12 +40,12 @@ Provides a REPL for your shell. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -56,5 +56,5 @@ Provides a REPL for your shell. * TODO Appendix #+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 diff --git a/modules/term/term/README.org b/modules/term/term/README.org index 08e622e44..4e0c43b6c 100644 --- a/modules/term/term/README.org +++ b/modules/term/term/README.org @@ -29,12 +29,12 @@ * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -45,5 +45,5 @@ * TODO Appendix #+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 diff --git a/modules/term/vterm/README.org b/modules/term/vterm/README.org index 0cc3c9ef4..86796970b 100644 --- a/modules/term/vterm/README.org +++ b/modules/term/vterm/README.org @@ -119,7 +119,7 @@ There are several ways to manually install the module: #+end_src #+begin_quote - 🚧 Emacs will hang during the compilation. It may take a while. +  Emacs will hang during the compilation. It may take a while. #+end_quote 2. You can compile and install the module yourself. Go to the vterm installation @@ -140,7 +140,7 @@ There are several ways to manually install the module: * TODO Usage #+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 The following commands are available to open it: @@ -151,7 +151,7 @@ The following commands are available to open it: * TODO Configuration #+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 * Troubleshooting @@ -162,5 +162,5 @@ The following commands are available to open it: * TODO Appendix #+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 diff --git a/modules/term/vterm/packages.el b/modules/term/vterm/packages.el index cb4e88537..74efc3bcd 100644 --- a/modules/term/vterm/packages.el +++ b/modules/term/vterm/packages.el @@ -3,4 +3,4 @@ (package! vterm :built-in 'prefer - :pin "3e5a9b754b8e61850bb7d1b63b090b9fbf6687f3") + :pin "94e2b0b2b4a750e7907dacd5b4c0584900846dd1") diff --git a/modules/tools/ansible/README.org b/modules/tools/ansible/README.org index 74de1be2e..494cd6a82 100644 --- a/modules/tools/ansible/README.org +++ b/modules/tools/ansible/README.org @@ -33,12 +33,12 @@ This module requires [[https://www.ansible.com/][Ansible]]. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -49,5 +49,5 @@ This module requires [[https://www.ansible.com/][Ansible]]. * TODO Appendix #+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 diff --git a/modules/tools/biblio/README.org b/modules/tools/biblio/README.org index 230d23958..3f70459d2 100644 --- a/modules/tools/biblio/README.org +++ b/modules/tools/biblio/README.org @@ -137,5 +137,5 @@ in-depth instructions. * TODO Appendix #+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 diff --git a/modules/tools/biblio/config.el b/modules/tools/biblio/config.el index 5d9b89a41..a37263e7e 100644 --- a/modules/tools/biblio/config.el +++ b/modules/tools/biblio/config.el @@ -26,36 +26,36 @@ (when (modulep! :completion vertico +icons) (defvar citar-indicator-files-icons (citar-indicator-create - :symbol (all-the-icons-faicon - "file-o" - :face 'all-the-icons-green + :symbol (nerd-icons-faicon + "nf-fa-file_o" + :face 'nerd-icons-green :v-adjust -0.1) :function #'citar-has-files :padding " " ; need this because the default padding is too low for these icons :tag "has:files")) (defvar citar-indicator-links-icons (citar-indicator-create - :symbol (all-the-icons-octicon - "link" - :face 'all-the-icons-orange + :symbol (nerd-icons-faicon + "nf-fa-link" + :face 'nerd-icons-orange :v-adjust 0.01) :function #'citar-has-links :padding " " :tag "has:links")) (defvar citar-indicator-notes-icons (citar-indicator-create - :symbol (all-the-icons-material - "speaker_notes" - :face 'all-the-icons-blue + :symbol (nerd-icons-codicon + "nf-cod-note" + :face 'nerd-icons-blue :v-adjust -0.3) :function #'citar-has-notes :padding " " :tag "has:notes")) (defvar citar-indicator-cited-icons (citar-indicator-create - :symbol (all-the-icons-faicon - "circle-o" - :face 'all-the-icon-green) + :symbol (nerd-icons-faicon + "nf-fa-circle_o" + :face 'nerd-icon-green) :function #'citar-is-cited :padding " " :tag "is:cited")) diff --git a/modules/tools/collab/config.el b/modules/tools/collab/config.el index 32dc2ebfe..427abefe1 100644 --- a/modules/tools/collab/config.el +++ b/modules/tools/collab/config.el @@ -3,6 +3,6 @@ (use-package! crdt :commands (crdt-share-buffer crdt-connect) :init - (when (featurep! +tunnel) + (when (modulep! +tunnel) (setq crdt-use-tuntox t) (setq crdt-tuntox-password-in-url t))) diff --git a/modules/tools/collab/doctor.el b/modules/tools/collab/doctor.el index 8d5caacb9..a133e2389 100644 --- a/modules/tools/collab/doctor.el +++ b/modules/tools/collab/doctor.el @@ -1,4 +1,5 @@ ;;; tools/collab/doctor.el -*- lexical-binding: t; -*- -(when (and (featurep! +tunnel) (not (executable-find "tuntox"))) +(when (and (modulep! +tunnel) + (not (executable-find "tuntox"))) (warn! "Couldn't find tuntox command. This needs to be on your path for the +tunnel flag to work properly.")) diff --git a/modules/tools/debugger/README.org b/modules/tools/debugger/README.org index 11f21e568..862febc63 100644 --- a/modules/tools/debugger/README.org +++ b/modules/tools/debugger/README.org @@ -35,7 +35,7 @@ there is still not *enough* documentation for it. * TODO Installation #+begin_quote - 🔨 /This module's prerequisites documentation is incomplete./ [[doom-contrib-module:][Complete it?]] + 󱌣 /This module's prerequisites documentation is incomplete./ [[doom-contrib-module:][Complete it?]] #+end_quote [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] @@ -127,7 +127,7 @@ using the mode-specific way. ** TODO realgud #+begin_quote - 🔨 Instructions for realgud haven't been written yet. [[doom-contrib-module:][Write some?]] + 󱌣 Instructions for realgud haven't been written yet. [[doom-contrib-module:][Write some?]] #+end_quote ** dap-mode @@ -198,7 +198,7 @@ The hydra is defined as follows: * TODO Configuration #+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 * Troubleshooting @@ -213,5 +213,5 @@ This currently is not supported by realgud. * TODO Appendix #+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 diff --git a/modules/tools/debugger/packages.el b/modules/tools/debugger/packages.el index 308ff670e..208504513 100644 --- a/modules/tools/debugger/packages.el +++ b/modules/tools/debugger/packages.el @@ -1,10 +1,10 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/debugger/packages.el -(when (package! realgud :pin "220ce2c348dab6cfc1cfa3c3f59644e777f9e8ff") +(when (package! realgud :pin "365063ea8ce8ec6a852cb388088d84147421c3c2") (when (modulep! :lang javascript) (package! realgud-trepan-ni :pin "0ec088ea343835e24ae73da09bea96bfb02a3130"))) (when (modulep! +lsp) - (package! dap-mode :pin "de41d62fc4f94f61ffdf7713a043dca9c02297c8") + (package! dap-mode :pin "755845ae053bbfdd3f7b3dca13efa4be480370b5") (package! posframe :pin "017deece88360c7297265680d78a0bb316470716")) diff --git a/modules/tools/direnv/README.org b/modules/tools/direnv/README.org index 7e66b2007..9ff377eab 100644 --- a/modules/tools/direnv/README.org +++ b/modules/tools/direnv/README.org @@ -7,7 +7,7 @@ This module integrates direnv into Emacs. #+begin_quote - 📌 direnv is an environment switcher for the shell. It knows how to hook into + 󰐃 direnv is an environment switcher for the shell. It knows how to hook into bash, zsh, tcsh, fish shell and elvish to load or unload environment variables depending on the current directory. This allows project-specific environment variables without cluttering the ~/.profile file. @@ -65,7 +65,7 @@ Or ~$ nix-env -i direnv~ * TODO Usage #+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 To make use of direnv you need a =.envrc= file in a directory. Any time you open @@ -74,7 +74,7 @@ activate the local env, and inject it into Emacs for the current buffer. * TODO Configuration #+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 * Troubleshooting @@ -92,5 +92,5 @@ services.lorri.enable = true; * TODO Appendix #+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 diff --git a/modules/tools/direnv/packages.el b/modules/tools/direnv/packages.el index 4f79e87f5..2b955547d 100644 --- a/modules/tools/direnv/packages.el +++ b/modules/tools/direnv/packages.el @@ -1,4 +1,4 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/direnv/packages.el -(package! envrc :pin "1954e8c0b5c8440ea9852eeb7c046a677fa544f6") +(package! envrc :pin "33d01388ce7ff14cb209015ce6f0d1a5bda6eb07") diff --git a/modules/tools/docker/README.org b/modules/tools/docker/README.org index 07596c85c..3af7085c8 100644 --- a/modules/tools/docker/README.org +++ b/modules/tools/docker/README.org @@ -40,10 +40,11 @@ installed and accessible from your PATH. Optionally, this module also uses the following programs: - =docker-langserver= (for LSP users): ~$ npm install -g dockerfile-language-server-nodejs~ +- =dockfmt= for [[doom-module::editor format]]: https://github.com/jessfraz/dockfmt#installation * TODO Usage #+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 ** Docker control @@ -87,7 +88,7 @@ C-x C-f /docker:$USER@$CONTAINER:/path/to/file * TODO Configuration #+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 ** Popups @@ -144,5 +145,5 @@ For older versions of TRAMP you can dump [[https://github.com/emacs-pe/docker-tr * TODO Appendix #+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 diff --git a/modules/tools/docker/config.el b/modules/tools/docker/config.el index 5f520a7d6..d030acd85 100644 --- a/modules/tools/docker/config.el +++ b/modules/tools/docker/config.el @@ -2,6 +2,7 @@ (after! dockerfile-mode (set-docsets! 'dockerfile-mode "Docker") + (set-formatter! 'dockfmt '("dockfmt" "fmt" filepath) :modes '(dockerfile-mode)) (when (modulep! +lsp) (add-hook 'dockerfile-mode-local-vars-hook #'lsp! 'append))) diff --git a/modules/tools/docker/doctor.el b/modules/tools/docker/doctor.el new file mode 100644 index 000000000..d84713e7c --- /dev/null +++ b/modules/tools/docker/doctor.el @@ -0,0 +1,5 @@ +;;; tools/docker/doctor.el -*- lexical-binding: t; -*- + +(when (modulep! :editor format) + (unless (executable-find "dockfmt") + (warn! "Couldn't find dockfmt. Formatting will be disabled."))) diff --git a/modules/tools/docker/packages.el b/modules/tools/docker/packages.el index 29d369fe0..22f158c64 100644 --- a/modules/tools/docker/packages.el +++ b/modules/tools/docker/packages.el @@ -1,8 +1,8 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/docker/packages.el -(package! docker :pin "cc0046e6a557dce0ccc4108dd22e04f21ba8b0dc") +(package! docker :pin "6997c86a24d440fa04035aa8c9499a52df6e655d") ;; tramp-container (included with Emacs 29+) replaces docker-tramp (when (< emacs-major-version 29) - (package! docker-tramp :pin "930d7b46c180d8a13240a028c1b40af84f2a3219")) + (package! docker-tramp :pin "19d0771db4e6b89e19c00af5806438e315779c15")) (package! dockerfile-mode :pin "52c6c00da1d31c0b6c29c74335b3af63ed6bf06c") diff --git a/modules/tools/editorconfig/README.org b/modules/tools/editorconfig/README.org index 0f1f1187f..967df04f8 100644 --- a/modules/tools/editorconfig/README.org +++ b/modules/tools/editorconfig/README.org @@ -50,7 +50,7 @@ in the root of your project) you can find out about all the properties [[https:/ * TODO Configuration #+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 ** Adding support for more major modes @@ -83,5 +83,5 @@ session of Emacs. Look for variables that have the words =indent=, =offset= or * TODO Appendix #+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 diff --git a/modules/tools/editorconfig/packages.el b/modules/tools/editorconfig/packages.el index c0e1f709b..e991a7e1e 100644 --- a/modules/tools/editorconfig/packages.el +++ b/modules/tools/editorconfig/packages.el @@ -3,4 +3,4 @@ (package! editorconfig :recipe (:nonrecursive t) - :pin "6f6b5c1a95a7fd326915fedcf6de634fe0d79999") + :pin "2fed9599bcfea5d1aa9fb57dc9118d0f82b6c999") diff --git a/modules/tools/ein/README.org b/modules/tools/ein/README.org index a4944073c..f62c1fda7 100644 --- a/modules/tools/ein/README.org +++ b/modules/tools/ein/README.org @@ -26,19 +26,19 @@ Adds [[https://jupyter.org/][Jupyter]] notebook integration into Emacs. [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] #+begin_quote - 🔨 /This module's prerequisites are not documented./ [[doom-contrib-module:][Document them?]] + 󱌣 /This module's prerequisites are not documented./ [[doom-contrib-module:][Document them?]] #+end_quote * TODO Usage #+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 Refer to [[https://github.com/millejoh/emacs-ipython-notebook][millejoh/emacs-ipython-notebook's README]]. * TODO Configuration #+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 * Troubleshooting @@ -49,5 +49,5 @@ Refer to [[https://github.com/millejoh/emacs-ipython-notebook][millejoh/emacs-ip * TODO Appendix #+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 diff --git a/modules/tools/ein/packages.el b/modules/tools/ein/packages.el index ce6bff87a..311930d76 100644 --- a/modules/tools/ein/packages.el +++ b/modules/tools/ein/packages.el @@ -1,4 +1,4 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/ein/packages.el -(package! ein :pin "b2410dc96f61aa806a7934099d8f1e40c8f6ca18") +(package! ein :pin "998ba22660be2035cd23bed1555e47748c4da8a2") diff --git a/modules/tools/eval/README.org b/modules/tools/eval/README.org index ea641cf2e..5e9184f5a 100644 --- a/modules/tools/eval/README.org +++ b/modules/tools/eval/README.org @@ -40,7 +40,7 @@ documentation of their respective [[doom-module::lang]] module for instructions. * TODO Usage #+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 ** Inline Code Evaluation @@ -62,7 +62,7 @@ Invoked via: * TODO Configuration #+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 ** Register a REPL for a major-mode @@ -130,5 +130,5 @@ Or if you'd rather run an elisp command: * TODO Appendix #+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 diff --git a/modules/tools/eval/packages.el b/modules/tools/eval/packages.el index 3c3cac810..c03341c3d 100644 --- a/modules/tools/eval/packages.el +++ b/modules/tools/eval/packages.el @@ -1,6 +1,6 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/eval/packages.el -(package! quickrun :pin "7a89313c07a21eae9cd69a1a98e2a134d559e04f") +(package! quickrun :pin "6f963189305e8311c8193ba774f4244eb1315f57") (when (modulep! +overlay) - (package! eros :pin "dd8910279226259e100dab798b073a52f9b4233a")) + (package! eros :pin "a9a92bdc6be0521a6a06eb464be55ed61946639c")) diff --git a/modules/tools/gist/README.org b/modules/tools/gist/README.org index 2893e3f34..c2f09021a 100644 --- a/modules/tools/gist/README.org +++ b/modules/tools/gist/README.org @@ -4,7 +4,7 @@ #+since: 2.0.3 #+begin_quote - 🚧 *This module is deprecated.* gist.el has been abandoned and is generally +  *This module is deprecated.* gist.el has been abandoned and is generally buggy. This may be replaced by a more general pastebin module that interfaces with various pastebin servers. #+end_quote @@ -35,12 +35,12 @@ Adds the ability to manage, pull from, or push to your [[https://gist.github.com * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -51,5 +51,5 @@ Adds the ability to manage, pull from, or push to your [[https://gist.github.com * TODO Appendix #+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 diff --git a/modules/tools/lookup/README.org b/modules/tools/lookup/README.org index aeca1c623..9a8452f96 100644 --- a/modules/tools/lookup/README.org +++ b/modules/tools/lookup/README.org @@ -218,7 +218,7 @@ Emacs): #+end_src #+begin_quote - 📌 ~+lookup/in-docsets~ consults ~dash-docs-browser-func~ instead, which is + 󰐃 ~+lookup/in-docsets~ consults ~dash-docs-browser-func~ instead, which is already set to ~#'eww~ by default. #+end_quote @@ -241,7 +241,7 @@ with Xwidgets support): * TODO Appendix #+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 ** Commands diff --git a/modules/tools/lsp/+eglot.el b/modules/tools/lsp/+eglot.el index 95294f5eb..5b56b600e 100644 --- a/modules/tools/lsp/+eglot.el +++ b/modules/tools/lsp/+eglot.el @@ -16,6 +16,12 @@ (setq eglot-sync-connect 1 eglot-autoshutdown t eglot-send-changes-idle-time 0.5 + ;; NOTE This setting disable the eglot-events-buffer enabling more + ;; consistent performance on long running emacs instance. + ;; Default is 2000000 lines. After each new event the whole buffer + ;; is pretty printed which causes steady performance decrease over time. + ;; CPU is spent on pretty priting and Emacs GC is put under high pressure. + eglot-events-buffer-size 0 ;; NOTE We disable eglot-auto-display-help-buffer because :select t in ;; its popup rule causes eglot to steal focus too often. eglot-auto-display-help-buffer nil) @@ -32,7 +38,7 @@ :type-definition #'eglot-find-typeDefinition :documentation #'+eglot-lookup-documentation) - (add-to-list 'doom-debug-variables '(eglot-events-buffer-size . 0)) + (add-to-list 'doom-debug-variables '(eglot-events-buffer-size . 2000000)) (defadvice! +lsp--defer-server-shutdown-a (fn &optional server) "Defer server shutdown for a few seconds. diff --git a/modules/tools/lsp/+lsp.el b/modules/tools/lsp/+lsp.el index cfc8a15df..5ae4a417d 100644 --- a/modules/tools/lsp/+lsp.el +++ b/modules/tools/lsp/+lsp.el @@ -134,7 +134,7 @@ server getting expensively restarted when reverting buffers." (label (if workspaces "LSP Connected" "LSP Disconnected"))) (setq lsp-modeline-icon (concat " " - (+modeline-format-icon 'faicon "rocket" "" face label -0.0575) + (+modeline-format-icon 'faicon "nf-fa-rocket" "" face label -0.0575) " ")) (add-to-list 'global-mode-string '(t (:eval lsp-modeline-icon)) diff --git a/modules/tools/lsp/README.org b/modules/tools/lsp/README.org index cf8c3c1a5..afc2978f9 100644 --- a/modules/tools/lsp/README.org +++ b/modules/tools/lsp/README.org @@ -80,7 +80,7 @@ including instructions to register your own. * TODO Usage #+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 ** LSP-powered project search @@ -109,7 +109,7 @@ it can only be compared in (very) broad strokes: with TRAMP out-of-the-box (lsp-mode needs some extra configuration). #+begin_quote - 💬 I recommend beginners use lsp-mode. More experienced users may also opt to + 󰟶 I recommend beginners use lsp-mode. More experienced users may also opt to disable many of [[https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/][its inessential features]] to gain back some ground on performance and complexity costs. #+end_quote @@ -119,7 +119,7 @@ in/out the [[doom-module:+lsp]] or [[doom-module:+eglot]] flag when [[id:01cffea * TODO Configuration #+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 ** Turn off lsp-mode's intrusive features @@ -151,5 +151,5 @@ Follow [[https://emacs-lsp.github.io/lsp-mode/page/performance/#tuning][lsp-tuni * TODO Appendix #+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 diff --git a/modules/tools/lsp/packages.el b/modules/tools/lsp/packages.el index f184ccdf6..8ca5f8cd5 100644 --- a/modules/tools/lsp/packages.el +++ b/modules/tools/lsp/packages.el @@ -3,13 +3,13 @@ (if (modulep! +eglot) (progn - (package! eglot :pin "a399fc0d035833d93da5e6424674f0dbdd631fb0") + (package! eglot :pin "2b145778ba5e57f393e50aea76b28e518c401828") (when (modulep! :completion vertico) (package! consult-eglot :pin "db9d41c9812a5a8a7b9a22fa7f3c314e37584d41")) (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) (package! flycheck-eglot :pin "9ff8d0068be59b1450964b390349d75a68af21ed"))) - (package! lsp-mode :pin "0dfe2145734f91c79aa3bbe666327736982811d7") + (package! lsp-mode :pin "d441f3d268a31a4a514af2db506a5eec47ee617d") (package! lsp-ui :pin "0dd39900c8ed8145d207985cb2f65cedd1ffb410") (when (modulep! :completion ivy) (package! lsp-ivy :pin "9ecf4dd9b1207109802bd1882aa621eb1c385106")) diff --git a/modules/tools/magit/README.org b/modules/tools/magit/README.org index 48caabf1c..2a66243a5 100644 --- a/modules/tools/magit/README.org +++ b/modules/tools/magit/README.org @@ -46,7 +46,7 @@ This module requires: * TODO Usage #+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 Start magit with [[kbd:][ g g]] (~M-x magit-status~). @@ -55,7 +55,7 @@ If you are new to Magit, see the [[https://github.com/magit/magit#getting-starte * TODO Configuration #+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 ** Enable Gravatars @@ -95,5 +95,5 @@ machine api.github.com login yourlogin^code-review password MYTOKENGOESHERE * TODO Appendix #+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 diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index 5878ae688..988cd2143 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -50,10 +50,6 @@ Only has an effect in GUI Emacs.") ;; ...then refresh the rest only when we switch to them, not all at once. (add-hook 'doom-switch-buffer-hook #'+magit-revert-buffer-maybe-h) - ;; Center the target file, because it's poor UX to have it at the bottom of - ;; the window after invoking `magit-status-here'. - (advice-add #'magit-status-here :after #'doom-recenter-a) - ;; The default location for git-credential-cache is in ;; ~/.cache/git/credential. However, if ~/.git-credential-cache/ exists, then ;; it is used instead. Magit seems to be hardcoded to use the latter, so here diff --git a/modules/tools/make/README.org b/modules/tools/make/README.org index a3ffbe4e1..8a3c10ecc 100644 --- a/modules/tools/make/README.org +++ b/modules/tools/make/README.org @@ -29,7 +29,7 @@ This module requires ~make~. * TODO Usage #+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 To invoke a make command: ~M-x +make/run~ @@ -38,7 +38,7 @@ To rerun the last make command: ~M-x +make/run-last~ * TODO Configuration #+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 * Troubleshooting @@ -49,5 +49,5 @@ To rerun the last make command: ~M-x +make/run-last~ * TODO Appendix #+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 diff --git a/modules/tools/make/packages.el b/modules/tools/make/packages.el index bb5038a0b..94ceb365b 100644 --- a/modules/tools/make/packages.el +++ b/modules/tools/make/packages.el @@ -1,4 +1,4 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/make/packages.el -(package! makefile-executor :pin "170d14d834a0d163cd618d642d4580ff75b014be") +(package! makefile-executor :pin "d1d98eaf522a767561f6c7cbd8d2526be58b3ec5") diff --git a/modules/tools/pass/README.org b/modules/tools/pass/README.org index e34b615ae..47b676161 100644 --- a/modules/tools/pass/README.org +++ b/modules/tools/pass/README.org @@ -34,7 +34,7 @@ This module requires [[https://www.passwordstore.org/][pass]], [[https://gnupg.o * TODO Usage #+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 Start using this module with ~M-x pass~. @@ -49,7 +49,7 @@ Start using this module with ~M-x pass~. * TODO Configuration #+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 * Troubleshooting @@ -60,5 +60,5 @@ Start using this module with ~M-x pass~. * TODO Appendix #+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 diff --git a/modules/tools/pass/packages.el b/modules/tools/pass/packages.el index d90c8d328..5e0816c15 100644 --- a/modules/tools/pass/packages.el +++ b/modules/tools/pass/packages.el @@ -1,8 +1,8 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/pass/packages.el -(package! pass :pin "5651da53137db9adcb125b4897c2fe27eeb4368d") -(package! password-store :pin "26d2dae04bb76a87be6960861c10432820cd5d55") +(package! pass :pin "c721604b3bd0c7ce7870f1a9fa0aa71f352a1009") +(package! password-store :pin "28cec11f1dbe6c4273d30370af45b69c9f408386") (package! password-store-otp :pin "be3a00a981921ed1b2f78012944dc25eb5a0beca") (when (modulep! :completion ivy) diff --git a/modules/tools/pdf/README.org b/modules/tools/pdf/README.org index aec680dcc..4f96c5223 100644 --- a/modules/tools/pdf/README.org +++ b/modules/tools/pdf/README.org @@ -27,7 +27,7 @@ for details and videos. ** TODO Hacks #+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 ** TODO Changelog @@ -99,12 +99,12 @@ build the =epdfinfo= program on Windows. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -115,5 +115,5 @@ build the =epdfinfo= program on Windows. * TODO Appendix #+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 diff --git a/modules/tools/pdf/packages.el b/modules/tools/pdf/packages.el index adf70231f..4bca3a0e1 100644 --- a/modules/tools/pdf/packages.el +++ b/modules/tools/pdf/packages.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/pdf/packages.el -(package! pdf-tools :pin "bc2ba117e8c3196ff9adf0da4fa1e63a8da3d7c8") -(package! saveplace-pdf-view :pin "54ed966b842501c3c092dbf57b372e37b033c578") +(package! pdf-tools :pin "c69e7656a4678fe25afbd29f3503dd19ee7f9896") +(package! saveplace-pdf-view :pin "abfb5e1f463cffc18218a0f7f2fa141a271b1813") diff --git a/modules/tools/prodigy/README.org b/modules/tools/prodigy/README.org index b34345883..599a970c2 100644 --- a/modules/tools/prodigy/README.org +++ b/modules/tools/prodigy/README.org @@ -30,12 +30,12 @@ Emacs. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -46,5 +46,5 @@ Emacs. * TODO Appendix #+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 diff --git a/modules/tools/rgb/README.org b/modules/tools/rgb/README.org index 9873d4b34..5e35fb60b 100644 --- a/modules/tools/rgb/README.org +++ b/modules/tools/rgb/README.org @@ -4,7 +4,7 @@ #+since: 21.12.0 #+begin_quote - 🚧 *This module is deprecated.* The module is too trivial to warrant a module. +  *This module is deprecated.* The module is too trivial to warrant a module. #+end_quote * Description :unfold: @@ -57,5 +57,5 @@ disable it only when =rainbow-mode= is active, you can add the following hook: * TODO Appendix #+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 diff --git a/modules/tools/rgb/packages.el b/modules/tools/rgb/packages.el index 0eddf08b1..587095dc8 100644 --- a/modules/tools/rgb/packages.el +++ b/modules/tools/rgb/packages.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/rgb/packages.el -(package! rainbow-mode :pin "8e96388fb4d616a9dde23e712bad0d9cd048fbf0") -(package! kurecolor :pin "ac67ceba85839ab1ced96fad605bf023b697263f") +(package! rainbow-mode :pin "24437ec2c66a889643c5c5b3fbd27c239a68976c") +(package! kurecolor :pin "fbf98e1e384dd11bbb5764ae54b36353f0691d1e") diff --git a/modules/tools/taskrunner/README.org b/modules/tools/taskrunner/README.org index 36ee42237..ce5806e95 100644 --- a/modules/tools/taskrunner/README.org +++ b/modules/tools/taskrunner/README.org @@ -4,7 +4,7 @@ #+since: 21.12.0 #+begin_quote - 🚧 *This module is deprecated.* The module is too trivial and taskrunner is no +  *This module is deprecated.* The module is too trivial and taskrunner is no longer maintained. #+end_quote @@ -37,7 +37,7 @@ from build systems like make, gradle, npm and the like. * TODO Usage #+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 Keybindings: @@ -46,7 +46,7 @@ Keybindings: * TODO Configuration #+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 * Troubleshooting @@ -57,5 +57,5 @@ Keybindings: * TODO Appendix #+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 diff --git a/modules/tools/terraform/README.org b/modules/tools/terraform/README.org index 0c53827cb..36506eb99 100644 --- a/modules/tools/terraform/README.org +++ b/modules/tools/terraform/README.org @@ -12,7 +12,9 @@ run Terraform commands directly from Emacs. /This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]] ** Module flags -/This module has no flags./ +- +lsp :: + Enable LSP support for ~terraform-mode~. Requires [[doom-module::tools lsp]] and a langserver + (supports terraform-ls or terraform-lsp). ** Packages - [[doom-package:company-terraform]] if [[doom-package::completion company]] @@ -64,7 +66,7 @@ Terraform operations: * TODO Configuration #+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 * Troubleshooting @@ -75,5 +77,5 @@ Terraform operations: * TODO Appendix #+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 diff --git a/modules/tools/tmux/README.org b/modules/tools/tmux/README.org index 8dd78e818..ed976f94a 100644 --- a/modules/tools/tmux/README.org +++ b/modules/tools/tmux/README.org @@ -29,12 +29,12 @@ This module provides an API for talking to Tmux sessions. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -45,5 +45,5 @@ This module provides an API for talking to Tmux sessions. * TODO Appendix #+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 diff --git a/modules/tools/tree-sitter/README.org b/modules/tools/tree-sitter/README.org index 09a14cee4..a13d58a9d 100644 --- a/modules/tools/tree-sitter/README.org +++ b/modules/tools/tree-sitter/README.org @@ -7,7 +7,7 @@ This module adds [[https://tree-sitter.github.io/tree-sitter/][tree-sitter]] support to Doom Emacs. #+begin_quote - 💬 Tree sitter is a parser generator tool and an incremental parsing library. + 󰟶 Tree sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. This allows for features of the editor to become syntax aware. @@ -47,7 +47,7 @@ out what you're missing. * TODO Usage #+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 ** Language support @@ -63,7 +63,7 @@ Not all languages support all text objects (yet). [[https://github.com/nvim-tree object languages support]]. #+begin_quote - 🚧 Only languages with parsers in Emacs have text object support at the moment. +  Only languages with parsers in Emacs have text object support at the moment. #+end_quote Currently text objects are bound to: @@ -97,7 +97,7 @@ Currently keys are bound to: * TODO Configuration #+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 ** Rebind text objects @@ -159,5 +159,5 @@ current key bound) or [[https://github.com/nvim-treesitter/nvim-treesitter-texto * TODO Appendix #+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 diff --git a/modules/tools/tree-sitter/packages.el b/modules/tools/tree-sitter/packages.el index 342ac913a..6be4f7141 100644 --- a/modules/tools/tree-sitter/packages.el +++ b/modules/tools/tree-sitter/packages.el @@ -2,9 +2,9 @@ ;;; tools/tree-sitter/packages.el (package! tree-sitter :pin "3cfab8a0e945db9b3df84437f27945746a43cc71") -(package! tree-sitter-langs :pin "944a734b7c3a5922a7e9a2009a9165e2dc195b18") +(package! tree-sitter-langs :pin "5eb24557f542d5fa18e7baaf07969cf7f297bfcd") (package! tree-sitter-indent :pin "4ef246db3e4ff99f672fe5e4b416c890f885c09e") (when (modulep! :editor evil +everywhere) (package! evil-textobj-tree-sitter - :pin "e8bb9d63deeb2953ff9600e1633de667b3d7673e")) + :pin "9a9edd42a2dca9dfd0bc6026d47f689fa117b90f")) diff --git a/modules/tools/upload/README.org b/modules/tools/upload/README.org index a1b423be9..ecd373ca1 100644 --- a/modules/tools/upload/README.org +++ b/modules/tools/upload/README.org @@ -38,26 +38,26 @@ The idea for this plug-in was to mimic the behavior of PhpStorm deployment funct * TODO Usage #+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 Uses ~ssh-deploy~ to map a local folder to a remote one. Set ~ssh-deploy-root-remote~ and ~ssh-deploy-root-local~ in a =.dir-locals.el= file to establish this mapping. E.g. #+begin_src emacs-lisp -((nil . ((ssh-deploy-root-local . "/local/path/to/project") +((nil . ((ssh-deploy-root-local . "/local/path/to/project/") (ssh-deploy-root-remote . "/ssh:user@server:/remote/project/") - (ssh-deploy-on-explicit-save . t)))) + (ssh-deploy-on-explicit-save . 1)))) #+end_src #+begin_quote - 📌 ~ssh-deploy-root-local~ is optional, and will resort to ~doom-project-root~ + 󰐃 ~ssh-deploy-root-local~ is optional, and will resort to ~doom-project-root~ if unspecified. #+end_quote * TODO Configuration #+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 Check out [[https://github.com/cjohansson/emacs-ssh-deploy#deployment-configuration-examples][Deployment configuration examples]] for some ideas of what's possible. @@ -66,7 +66,7 @@ Check out [[https://github.com/cjohansson/emacs-ssh-deploy#deployment-configurat ** ~root-local~ and ~root-remote~ must match The final directory names much match: #+begin_src emacs-lisp -((nil . ((ssh-deploy-root-local . "/local/path/to/example-project") +((nil . ((ssh-deploy-root-local . "/local/path/to/example-project/") (ssh-deploy-root-remote . "/ssh:user@server:/remote/example-project/") #+end_src @@ -75,5 +75,5 @@ The final directory names much match: * TODO Appendix #+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 diff --git a/modules/tools/upload/config.el b/modules/tools/upload/config.el index dadc824c7..25e2829be 100644 --- a/modules/tools/upload/config.el +++ b/modules/tools/upload/config.el @@ -37,7 +37,8 @@ (add-hook! 'after-save-hook (defun +upload-init-after-save-h () (when (and (bound-and-true-p ssh-deploy-root-remote) - ssh-deploy-on-explicit-save) + (integerp ssh-deploy-on-explicit-save) + (> ssh-deploy-on-explicit-save 0)) (ssh-deploy-upload-handler ssh-deploy-force-on-explicit-save)))) ;; Enable ssh-deploy if variables are set, and check for changes on open file diff --git a/modules/tools/upload/packages.el b/modules/tools/upload/packages.el index 958f8f113..cfbbf6d6e 100644 --- a/modules/tools/upload/packages.el +++ b/modules/tools/upload/packages.el @@ -1,4 +1,4 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/upload/packages.el -(package! ssh-deploy :pin "94b56c0428fa0c788578161edc9e7992b13cd400") +(package! ssh-deploy :pin "95fb076c9b657c5f1bfad3ee5bf1f8691c50d428") diff --git a/modules/ui/deft/README.org b/modules/ui/deft/README.org index 66eeeb997..332c152f6 100644 --- a/modules/ui/deft/README.org +++ b/modules/ui/deft/README.org @@ -31,12 +31,12 @@ quickly jot down thoughts and easily retrieve them later. * TODO Usage #+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 * TODO Configuration #+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 To use deft, you first need to specify the directory in which your notes are @@ -71,5 +71,5 @@ https://github.com/jrblevin/deft#other-customizations * TODO Appendix #+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 diff --git a/modules/ui/doom-dashboard/README.org b/modules/ui/doom-dashboard/README.org index 4eb180ba0..8f69efc3f 100644 --- a/modules/ui/doom-dashboard/README.org +++ b/modules/ui/doom-dashboard/README.org @@ -41,9 +41,9 @@ Besides eye candy, the dashboard serves two other purposes: * Installation [[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]] -This module only requires that ~all-the-icons~'s icon fonts are installed, which +This module only requires that ~nerd-icons~'s icon fonts are installed, which should've been installed when you ran ~$ doom install~. Otherwise, use ~M-x -all-the-icons-install-fonts~ to install them. +nerd-icons-install-fonts~ to install them. * Usage Once this module is enabled, the dashboard will present itself after opening a @@ -53,7 +53,7 @@ You can forcibly open the dashboard with ~M-x +doom-dashboard/open~. * TODO Configuration #+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 ** A custom banner @@ -63,7 +63,7 @@ To use a custom image as your banner, change ~fancy-splash-image~: #+end_src #+begin_quote - 📌 Doom will fall back to its ASCII banner in Terminal Emacs. To replace the + 󰐃 Doom will fall back to its ASCII banner in Terminal Emacs. To replace the ASCII banner, replace the ~doom-dashboard-widget-banner~ function in ~+doom-dashboard-functions~ with a function that inserts your new banner into the current file. @@ -75,7 +75,7 @@ redraw. Add your own functions to operate on the buffer and potentially add whatever you like to Doom's splash screen. #+begin_quote - 🚧 Keep in mind that inserting text from expensive sources, e.g. your org +  Keep in mind that inserting text from expensive sources, e.g. your org agenda, will negate most of Doom's startup benefits. #+end_quote @@ -88,7 +88,7 @@ color from the theme) you can make use of ~custom-set-faces!~ or (custom-set-faces! '(doom-dashboard-banner :foreground "red" :background "#000000" :weight bold) '(doom-dashboard-footer :inherit font-lock-constant-face) - '(doom-dashboard-footer-icon :inherit all-the-icons-red) + '(doom-dashboard-footer-icon :inherit nerd-icons-red) '(doom-dashboard-loaded :inherit font-lock-warning-face) '(doom-dashboard-menu-desc :inherit font-lock-string-face) '(doom-dashboard-menu-title :inherit font-lock-function-name-face)) @@ -99,7 +99,7 @@ or for a per-theme setting (custom-theme-set-faces! 'doom-tomorrow-night '(doom-dashboard-banner :foreground "red" :background "#000000" :weight bold) '(doom-dashboard-footer :inherit font-lock-constant-face) - '(doom-dashboard-footer-icon :inherit all-the-icons-red) + '(doom-dashboard-footer-icon :inherit nerd-icons-red) '(doom-dashboard-loaded :inherit font-lock-warning-face) '(doom-dashboard-menu-desc :inherit font-lock-string-face) '(doom-dashboard-menu-title :inherit font-lock-function-name-face)) @@ -113,5 +113,5 @@ or for a per-theme setting * TODO Appendix #+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 diff --git a/modules/ui/doom-dashboard/config.el b/modules/ui/doom-dashboard/config.el index 1ba86334a..613e331f5 100644 --- a/modules/ui/doom-dashboard/config.el +++ b/modules/ui/doom-dashboard/config.el @@ -47,32 +47,31 @@ Possible values: (defvar +doom-dashboard-menu-sections '(("Recently opened files" - :icon (all-the-icons-octicon "file-text" :face 'doom-dashboard-menu-title) - :face (:inherit (doom-dashboard-menu-title bold)) + :icon (nerd-icons-faicon "nf-fa-file_text" :face 'doom-dashboard-menu-title) :action recentf-open-files) ("Reload last session" - :icon (all-the-icons-octicon "history" :face 'doom-dashboard-menu-title) + :icon (nerd-icons-octicon "nf-oct-history" :face 'doom-dashboard-menu-title) :when (cond ((modulep! :ui workspaces) (file-exists-p (expand-file-name persp-auto-save-fname persp-save-dir))) ((require 'desktop nil t) (file-exists-p (desktop-full-file-name)))) :action doom/quickload-session) ("Open org-agenda" - :icon (all-the-icons-octicon "calendar" :face 'doom-dashboard-menu-title) + :icon (nerd-icons-octicon "nf-oct-calendar" :face 'doom-dashboard-menu-title) :when (fboundp 'org-agenda) :action org-agenda) ("Open project" - :icon (all-the-icons-octicon "briefcase" :face 'doom-dashboard-menu-title) + :icon (nerd-icons-octicon "nf-oct-briefcase" :face 'doom-dashboard-menu-title) :action projectile-switch-project) ("Jump to bookmark" - :icon (all-the-icons-octicon "bookmark" :face 'doom-dashboard-menu-title) + :icon (nerd-icons-octicon "nf-oct-bookmark" :face 'doom-dashboard-menu-title) :action bookmark-jump) ("Open private configuration" - :icon (all-the-icons-octicon "tools" :face 'doom-dashboard-menu-title) + :icon (nerd-icons-octicon "nf-oct-tools" :face 'doom-dashboard-menu-title) :when (file-directory-p doom-user-dir) :action doom/open-private-config) ("Open documentation" - :icon (all-the-icons-octicon "book" :face 'doom-dashboard-menu-title) + :icon (nerd-icons-octicon "nf-oct-book" :face 'doom-dashboard-menu-title) :action doom/help)) "An alist of menu buttons used by `doom-dashboard-widget-shortmenu'. Each element is a cons cell (LABEL . PLIST). LABEL is a string to display after the @@ -98,9 +97,6 @@ PLIST can have the following properties: (defvar +doom-dashboard--pwd-alist ()) (defvar +doom-dashboard--reload-timer nil) -(defvar all-the-icons-scale-factor) -(defvar all-the-icons-default-adjust) - ;; ;;; Bootstrap @@ -151,7 +147,7 @@ PLIST can have the following properties: "Face used for the footer on the dashboard" :group 'doom-dashboard) -(defface doom-dashboard-footer-icon '((t (:inherit all-the-icons-green))) +(defface doom-dashboard-footer-icon '((t (:inherit nerd-icons-green))) "Face used for the icon of the footer on the dashboard" :group 'doom-dashboard) @@ -456,60 +452,58 @@ What it is set to is controlled by `+doom-dashboard-pwd-policy'." "\n"))) (defun doom-dashboard-widget-shortmenu () - (let ((all-the-icons-scale-factor 1.45) - (all-the-icons-default-adjust -0.02)) - (insert "\n") - (dolist (section +doom-dashboard-menu-sections) - (cl-destructuring-bind (label &key icon action when face key) section - (when (and (fboundp action) - (or (null when) - (eval when t))) - (insert - (+doom-dashboard--center - (- +doom-dashboard--width 1) - (let ((icon (if (stringp icon) icon (eval icon t)))) - (format (format "%s%%s%%-10s" (if icon "%3s\t" "%3s")) - (or icon "") - (with-temp-buffer - (insert-text-button - label - 'action - `(lambda (_) - (call-interactively (or (command-remapping #',action) - #',action))) - 'face (or face 'doom-dashboard-menu-title) - 'follow-link t - 'help-echo - (format "%s (%s)" label - (propertize (symbol-name action) 'face 'doom-dashboard-menu-desc))) - (format "%-37s" (buffer-string))) - ;; Lookup command keys dynamically - (propertize - (or key - (when-let* - ((keymaps - (delq - nil (list (when (bound-and-true-p evil-local-mode) - (evil-get-auxiliary-keymap +doom-dashboard-mode-map 'normal)) - +doom-dashboard-mode-map))) - (key - (or (when keymaps - (where-is-internal action keymaps t)) - (where-is-internal action nil t)))) - (with-temp-buffer - (save-excursion (insert (key-description key))) - (while (re-search-forward "<\\([^>]+\\)>" nil t) - (let ((str (match-string 1))) - (replace-match - (upcase (if (< (length str) 3) - str - (substring str 0 3)))))) - (buffer-string))) - "") - 'face 'doom-dashboard-menu-desc)))) - (if (display-graphic-p) - "\n\n" - "\n"))))))) + (insert "\n") + (dolist (section +doom-dashboard-menu-sections) + (cl-destructuring-bind (label &key icon action when face key) section + (when (and (fboundp action) + (or (null when) + (eval when t))) + (insert + (+doom-dashboard--center + (- +doom-dashboard--width 1) + (let ((icon (if (stringp icon) icon (eval icon t)))) + (format (format "%s%%s%%-10s" (if icon "%3s\t" "%3s")) + (or icon "") + (with-temp-buffer + (insert-text-button + label + 'action + `(lambda (_) + (call-interactively (or (command-remapping #',action) + #',action))) + 'face (or face 'doom-dashboard-menu-title) + 'follow-link t + 'help-echo + (format "%s (%s)" label + (propertize (symbol-name action) 'face 'doom-dashboard-menu-desc))) + (format "%-37s" (buffer-string))) + ;; Lookup command keys dynamically + (propertize + (or key + (when-let* + ((keymaps + (delq + nil (list (when (bound-and-true-p evil-local-mode) + (evil-get-auxiliary-keymap +doom-dashboard-mode-map 'normal)) + +doom-dashboard-mode-map))) + (key + (or (when keymaps + (where-is-internal action keymaps t)) + (where-is-internal action nil t)))) + (with-temp-buffer + (save-excursion (insert (key-description key))) + (while (re-search-forward "<\\([^>]+\\)>" nil t) + (let ((str (match-string 1))) + (replace-match + (upcase (if (< (length str) 3) + str + (substring str 0 3)))))) + (buffer-string))) + "") + 'face 'doom-dashboard-menu-desc)))) + (if (display-graphic-p) + "\n\n" + "\n")))))) (defun doom-dashboard-widget-footer () (insert @@ -517,7 +511,7 @@ What it is set to is controlled by `+doom-dashboard-pwd-policy'." (+doom-dashboard--center (- +doom-dashboard--width 2) (with-temp-buffer - (insert-text-button (or (all-the-icons-octicon "octoface" :face 'doom-dashboard-footer-icon :height 1.3 :v-adjust -0.15) + (insert-text-button (or (nerd-icons-codicon "nf-cod-octoface" :face 'doom-dashboard-footer-icon :height 1.3 :v-adjust -0.15) (propertize "github" 'face 'doom-dashboard-footer)) 'action (lambda (_) (browse-url "https://github.com/hlissner/doom-emacs")) 'follow-link t diff --git a/modules/ui/doom-quit/README.org b/modules/ui/doom-quit/README.org index fb67ff468..3b98dea43 100644 --- a/modules/ui/doom-quit/README.org +++ b/modules/ui/doom-quit/README.org @@ -37,7 +37,7 @@ Quit Emacs with [[kbd:][ q q]] and watch it go. The prompt only happens have (real) buffers open. #+begin_quote - 🚧 This module won't kick in when killing daemon frames (because that isn't +  This module won't kick in when killing daemon frames (because that isn't actually “quitting” Emacs). #+end_quote diff --git a/modules/ui/doom-quit/config.el b/modules/ui/doom-quit/config.el index 89f54f7b8..3e6f69702 100644 --- a/modules/ui/doom-quit/config.el +++ b/modules/ui/doom-quit/config.el @@ -1,10 +1,13 @@ ;;; ui/doom-quit/config.el -*- lexical-binding: t; -*- (defvar +doom-quit-messages - '(;; from Doom 1 + `(;; from Doom 1 "Please don't leave, there's more demons to toast!" "Let's beat it -- This is turning into a bloodbath!" - "I wouldn't leave if I were you. DOS is much worse." + ,(format "I wouldn't leave if I were you. %s is much worse." + (if (member system-type '(ms-dos-windows-nt cygwin)) + "DOS" + "UNIX")) "Don't leave yet -- There's a demon around that corner!" "Ya know, next time you come in here I'm gonna toast ya." "Go ahead and leave. See if I care." diff --git a/modules/ui/doom/README.org b/modules/ui/doom/README.org index 9e6cb9bc0..b46335d87 100644 --- a/modules/ui/doom/README.org +++ b/modules/ui/doom/README.org @@ -37,12 +37,12 @@ This module gives Doom its signature look: powered by the [[doom-package:doom-th * TODO Usage #+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 * TODO Configuration #+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 ** Changing theme @@ -71,13 +71,13 @@ core/core-ui.el has four relevant variables: - ~doom-big-font~ :: the font to use when ~doom-big-font-mode~ is enabled. - ~doom-variable-pitch-font~ :: the font to use when ~variable-pitch-mode~ is active (or where the ~variable-pitch~ face is used). -- ~doom-unicode-font~ :: the font used to display unicode symbols. This is +- ~doom-symbol-font~ :: the font used to display unicode symbols. This is ignored if the [[doom-module::ui unicode]] module is enabled. #+begin_src emacs-lisp (setq doom-font (font-spec :family "Fira Mono" :size 12) doom-variable-pitch-font (font-spec :family "Fira Sans") - doom-unicode-font (font-spec :family "DejaVu Sans Mono") + doom-symbol-font (font-spec :family "JuliaMono") doom-big-font (font-spec :family "Fira Mono" :size 19)) #+end_src @@ -86,8 +86,8 @@ core/core-ui.el has four relevant variables: ** Strange font symbols If you're seeing strange unicode symbols, this is likely because you don't have -~all-the-icons~'s font icon installed. You can install them with ~M-x -all-the-icons-install-fonts~. +~nerd-icons~'s font icon installed. You can install them with ~M-x +nerd-icons-install-fonts~. ** Ugly background colors in tty Emacs for daemon users [[doom-package:solaire-mode]] is an aesthetic plugin that makes non-file-visiting buffers darker @@ -111,5 +111,5 @@ solaire-mode package: * TODO Appendix #+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 diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index 0e4d50c92..c39c1bd5d 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -14,9 +14,7 @@ (add-hook 'doom-load-theme-hook #'doom-themes-neotree-config) (setq doom-themes-neotree-enable-variable-pitch t doom-themes-neotree-file-icons 'simple - doom-themes-neotree-line-spacing 2)) - (when (modulep! :ui treemacs) - (add-hook 'doom-load-theme-hook #'doom-themes-treemacs-config))) + doom-themes-neotree-line-spacing 2))) (use-package! solaire-mode diff --git a/modules/ui/doom/packages.el b/modules/ui/doom/packages.el index 22b2103ac..edbc97da6 100644 --- a/modules/ui/doom/packages.el +++ b/modules/ui/doom/packages.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; -*- ;;; ui/doom/packages.el -(package! doom-themes :pin "e4f0b006a516a35f53df2dce2ec116876c5cd7f9") +(package! doom-themes :pin "4aee1f5a0e54552669f747aa7c25e6027e73d76d") (package! solaire-mode :pin "8af65fbdc50b25ed3214da949b8a484527c7cc14") diff --git a/modules/ui/emoji/README.org b/modules/ui/emoji/README.org index f9ac07af7..cda1b56ca 100644 --- a/modules/ui/emoji/README.org +++ b/modules/ui/emoji/README.org @@ -4,9 +4,14 @@ #+since: 21.12.0 * Description :unfold: -This module gives Emacs the ability to display and insert emojis (ASCII, Github -style, or unicode styles), as well as convert certain text patterns (e.g. -=:smile:=) into emojis. +This module can redisplay ASCII/GitHub emoticon strings as corresponding Unicode +emoji. In addition, a completion command is provided to insert these strings as +well as the typical Unicode representations. + +Note: Emacs 29 provides [[https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29.1#n884][native support]] for inserting Unicode emojis. This module +only remains useful if you want ASCII/GitHub emoticon string +insertion/conversion or need PNG/ASCII emoji rendering on a system with limited +font configuration. ** Maintainers *This module needs a maintainer.* [[doom-contrib-maintainer:][Become a maintainer?]] @@ -47,12 +52,12 @@ PNG support might require some additional steps to on Windows, you might find * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -63,5 +68,5 @@ PNG support might require some additional steps to on Windows, you might find * TODO Appendix #+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 diff --git a/modules/ui/hl-todo/README.org b/modules/ui/hl-todo/README.org index 642b25b62..c369c3104 100644 --- a/modules/ui/hl-todo/README.org +++ b/modules/ui/hl-todo/README.org @@ -32,7 +32,7 @@ This module adds syntax highlighting for various tags in code comments, such as * TODO Usage #+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 By enabling this module, the following keywords will be highlighted if they @@ -62,7 +62,7 @@ occur in code comments: * TODO Configuration #+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 To add your own ITEMS you would need to configure them using @@ -83,5 +83,5 @@ To add your own ITEMS you would need to configure them using * TODO Appendix #+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 diff --git a/modules/ui/hl-todo/packages.el b/modules/ui/hl-todo/packages.el index ab0a665d5..c0f5daa24 100644 --- a/modules/ui/hl-todo/packages.el +++ b/modules/ui/hl-todo/packages.el @@ -1,4 +1,4 @@ ;; -*- no-byte-compile: t; -*- ;;; ui/hl-todo/packages.el -(package! hl-todo :pin "0faf8569b67f5b23891416d9e7a67e3843338f2a") +(package! hl-todo :pin "70ce48470c85f1441de2c9428a240c3287995846") diff --git a/modules/ui/hydra/README.org b/modules/ui/hydra/README.org index 1218fb403..688bf4f4b 100644 --- a/modules/ui/hydra/README.org +++ b/modules/ui/hydra/README.org @@ -4,7 +4,7 @@ #+since: 2.0.0 #+begin_quote - 🚧 *This module is deprecated.* The module is too trivially small, and it's +  *This module is deprecated.* The module is too trivially small, and it's always been unclear how hydra fits into Doom's vision for its UI. It's been decided that Doom will head toward Embark, transient, or hercules instead. #+end_quote @@ -39,12 +39,12 @@ start with: * TODO Usage #+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 * TODO Configuration #+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 Configuring this module is only setting bindings to the provided hydra, or @@ -58,5 +58,5 @@ creating your own ones! * TODO Appendix #+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 diff --git a/modules/ui/indent-guides/README.org b/modules/ui/indent-guides/README.org index 9101396f4..d0496e9df 100644 --- a/modules/ui/indent-guides/README.org +++ b/modules/ui/indent-guides/README.org @@ -29,12 +29,12 @@ * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -45,5 +45,5 @@ * TODO Appendix #+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 diff --git a/modules/ui/ligatures/+fira.el b/modules/ui/ligatures/+fira.el deleted file mode 100644 index 191dabe1e..000000000 --- a/modules/ui/ligatures/+fira.el +++ /dev/null @@ -1,123 +0,0 @@ -;;; ui/ligatures/+fira.el -*- lexical-binding: t; -*- - -(+ligatures--def-font fira - ("Fira Code Symbol" - :range '(#Xe100 . #Xe16f) - :url "https://github.com/tonsky/FiraCode/raw/13234c0/distr/ttf/%s" - :files '("FiraCode-Bold.ttf" - "FiraCode-Light.ttf" - "FiraCode-Medium.ttf" - "FiraCode-Regular.ttf" - "FiraCode-Retina.ttf")) - ("www" . #Xe100) - ("**" . #Xe101) - ("***" . #Xe102) - ("**/" . #Xe103) - ("*>" . #Xe104) - ("*/" . #Xe105) - ("\\\\" . #Xe106) - ("\\\\\\" . #Xe107) - ("{-" . #Xe108) - ("[]" . #Xe109) - ("::" . #Xe10a) - (":::" . #Xe10b) - (":=" . #Xe10c) - ("!!" . #Xe10d) - ("!=" . #Xe10e) - ("!==" . #Xe10f) - ("-}" . #Xe110) - ("--" . #Xe111) - ("---" . #Xe112) - ("-->" . #Xe113) - ("->" . #Xe114) - ("->>" . #Xe115) - ("-<" . #Xe116) - ("-<<" . #Xe117) - ("-~" . #Xe118) - ("#{" . #Xe119) - ("#[" . #Xe11a) - ("##" . #Xe11b) - ("###" . #Xe11c) - ("####" . #Xe11d) - ("#(" . #Xe11e) - ("#?" . #Xe11f) - ("#_" . #Xe120) - ("#_(" . #Xe121) - (".-" . #Xe122) - (".=" . #Xe123) - (".." . #Xe124) - ("..<" . #Xe125) - ("..." . #Xe126) - ("?=" . #Xe127) - ("??" . #Xe128) - (";;" . #Xe129) - ("/*" . #Xe12a) - ("/**" . #Xe12b) - ("/=" . #Xe12c) - ("/==" . #Xe12d) - ("/>" . #Xe12e) - ("//" . #Xe12f) - ("///" . #Xe130) - ("&&" . #Xe131) - ("||" . #Xe132) - ("||=" . #Xe133) - ("|=" . #Xe134) - ("|>" . #Xe135) - ("^=" . #Xe136) - ("$>" . #Xe137) - ("++" . #Xe138) - ("+++" . #Xe139) - ("+>" . #Xe13a) - ("=:=" . #Xe13b) - ("==" . #Xe13c) - ("===" . #Xe13d) - ("==>" . #Xe13e) - ("=>" . #Xe13f) - ("=>>" . #Xe140) - ("=<" . #Xe141) - ("=<<" . #Xe142) - ("=/=" . #Xe143) - (">-" . #Xe144) - (">=" . #Xe145) - (">=>" . #Xe146) - (">>" . #Xe147) - (">>-" . #Xe148) - (">>=" . #Xe149) - (">>>" . #Xe14a) - ("<*" . #Xe14b) - ("<*>" . #Xe14c) - ("<|" . #Xe14d) - ("<|>" . #Xe14e) - ("<$" . #Xe14f) - ("<$>" . #Xe150) - ("" . #Xe101) - ("<--->" . #Xe102) - ("<---->" . #Xe103) - ("<----->" . #Xe104) - ;; Double-ended equals arrows - ("<=>" . #Xe105) - ("<==>" . #Xe106) - ("<===>" . #Xe107) - ("<====>" . #Xe108) - ("<=====>" . #Xe109) - ;; Double-ended asterisk operators - ("<**>" . #Xe10a) - ("<***>" . #Xe10b) - ("<****>" . #Xe10c) - ("<*****>" . #Xe10d) - ;; HTML comments - ("" . #Xe152) - ("-->-" . #Xe153) - ("-->--" . #Xe154) - ("-->>" . #Xe155) - ("-->>-" . #Xe156) - ("-->>--" . #Xe157) - ("-->>>" . #Xe158) - ("-->>>-" . #Xe159) - ("-->>>--" . #Xe15a) - (">-" . #Xe15b) - (">--" . #Xe15c) - (">>-" . #Xe15d) - (">>--" . #Xe15e) - (">>>-" . #Xe15f) - (">>>--" . #Xe160) - ("=>" . #Xe161) - ("=>=" . #Xe162) - ("=>==" . #Xe163) - ("=>>" . #Xe164) - ("=>>=" . #Xe165) - ("=>>==" . #Xe166) - ("=>>>" . #Xe167) - ("=>>>=" . #Xe168) - ("=>>>==" . #Xe169) - ("==>" . #Xe16a) - ("==>=" . #Xe16b) - ("==>==" . #Xe16c) - ("==>>" . #Xe16d) - ("==>>=" . #Xe16e) - ("==>>==" . #Xe16f) - ("==>>>" . #Xe170) - ("==>>>=" . #Xe171) - ("==>>>==" . #Xe172) - (">=" . #Xe173) - (">==" . #Xe174) - (">>=" . #Xe175) - (">>==" . #Xe176) - (">>>=" . #Xe177) - (">>>==" . #Xe178) - ("<-" . #Xe179) - ("-<-" . #Xe17a) - ("--<-" . #Xe17b) - ("<<-" . #Xe17c) - ("-<<-" . #Xe17d) - ("--<<-" . #Xe17e) - ("<<<-" . #Xe17f) - ("-<<<-" . #Xe180) - ("--<<<-" . #Xe181) - ("<--" . #Xe182) - ("-<--" . #Xe183) - ("--<--" . #Xe184) - ("<<--" . #Xe185) - ("-<<--" . #Xe186) - ("--<<--" . #Xe187) - ("<<<--" . #Xe188) - ("-<<<--" . #Xe189) - ("--<<<--" . #Xe18a) - ("-<" . #Xe18b) - ("--<" . #Xe18c) - ("-<<" . #Xe18d) - ("--<<" . #Xe18e) - ("-<<<" . #Xe18f) - ("--<<<" . #Xe190) - ("<=" . #Xe191) - ("=<=" . #Xe192) - ("==<=" . #Xe193) - ("<<=" . #Xe194) - ("=<<=" . #Xe195) - ("==<<=" . #Xe196) - ("<<<=" . #Xe197) - ("=<<<=" . #Xe198) - ("==<<<=" . #Xe199) - ("<==" . #Xe19a) - ("=<==" . #Xe19b) - ("==<==" . #Xe19c) - ("<<==" . #Xe19d) - ("=<<==" . #Xe19e) - ("==<<==" . #Xe19f) - ("<<<==" . #Xe1a0) - ("=<<<==" . #Xe1a1) - ("==<<<==" . #Xe1a2) - ("=<" . #Xe1a3) - ("==<" . #Xe1a4) - ("=<<" . #Xe1a5) - ("==<<" . #Xe1a6) - ("=<<<" . #Xe1a7) - ("==<<<" . #Xe1a8) - ;; Monadic operators - (">=>" . #Xe1a9) - (">->" . #Xe1aa) - (">-->" . #Xe1ab) - (">==>" . #Xe1ac) - ("<=<" . #Xe1ad) - ("<-<" . #Xe1ae) - ("<--<" . #Xe1af) - ("<==<" . #Xe1b0) - ;; Composition operators - (">>" . #Xe1b1) - (">>>" . #Xe1b2) - ("<<" . #Xe1b3) - ("<<<" . #Xe1b4) - ;; Lens operators - (":+" . #Xe1b5) - (":-" . #Xe1b6) - (":=" . #Xe1b7) - ("+:" . #Xe1b8) - ("-:" . #Xe1b9) - ("=:" . #Xe1ba) - ("=^" . #Xe1bb) - ("=+" . #Xe1bc) - ("=-" . #Xe1bd) - ("=*" . #Xe1be) - ("=/" . #Xe1bf) - ("=%" . #Xe1c0) - ("^=" . #Xe1c1) - ("+=" . #Xe1c2) - ("-=" . #Xe1c3) - ("*=" . #Xe1c4) - ("/=" . #Xe1c5) - ("%=" . #Xe1c6) - ;; Logical - ("/\\" . #Xe1c7) - ("\\/" . #Xe1c8) - ;; Semigroup/monoid operators - ("<>" . #Xe1c9) - ("<+" . #Xe1ca) - ("<+>" . #Xe1cb) - ("+>" . #Xe1cc)) diff --git a/modules/ui/ligatures/+pragmata-pro.el b/modules/ui/ligatures/+pragmata-pro.el deleted file mode 100644 index eff991ac9..000000000 --- a/modules/ui/ligatures/+pragmata-pro.el +++ /dev/null @@ -1,259 +0,0 @@ -;;; ui/ligatures/+pragmata-pro.el -*- lexical-binding: t; -*- - -(+ligatures--def-font pragmata-pro - ("PragmataPro") - ;; Double-ended hyphen arrows - ("[INFO]" . #Xe2b0) - ("[WARN]" . #Xe2b1) - ("[PASS]" . #Xe2b2) - ("[VERBOSE]" . #Xe2b3) - ("[KO]" . #Xe2b4) - ("[OK]" . #Xe2b5) - ("[PASS]" . #Xe2b6) - ("[ERROR]" . #Xe2c0) - ("[DEBUG]" . #Xe2c1) - ("[INFO]" . #Xe2c2) - ("[WARN]" . #Xe2c3) - ("[WARNING]" . #Xe2c4) - ("[ERR]" . #Xe2c5) - ("[FATAL]" . #Xe2c6) - ("[TRACE]" . #Xe2c7) - ("[FIXME]" . #Xe2c8) - ("[TODO]" . #Xe2c9) - ("[BUG]" . #Xe2ca) - ("[NOTE]" . #Xe2cb) - ("[HACK]" . #Xe2cc) - ("[MARK]" . #Xe2cd) - ("[FAIL]" . #Xe2ce) - ("// ERROR" . #Xe2e0) - ("// DEBUG" . #Xe2e1) - ("// INFO" . #Xe2e2) - ("// WARN" . #Xe2e3) - ("// WARNING" . #Xe2e4) - ("// ERR" . #Xe2e5) - ("// FATAL" . #Xe2e6) - ("// TRACE" . #Xe2e7) - ("// FIXME" . #Xe2e8) - ("// TODO" . #Xe2e9) - ("// BUG" . #Xe2ea) - ("// NOTE" . #Xe2eb) - ("// HACK" . #Xe2ec) - ("// MARK" . #Xe2ed) - ("// FAIL" . #Xe2ee) - ("# ERROR" . #Xe2f0) - ("# DEBUG" . #Xe2f1) - ("# INFO" . #Xe2f2) - ("# WARN" . #Xe2f3) - ("# WARNING" . #Xe2f4) - ("# ERR" . #Xe2f5) - ("# FATAL" . #Xe2f6) - ("# TRACE" . #Xe2f7) - ("# FIXME" . #Xe2f8) - ("# TODO" . #Xe2f9) - ("# BUG" . #Xe2fa) - ("# NOTE" . #Xe2fb) - ("# HACK" . #Xe2fc) - ("# MARK" . #Xe2fd) - ("# FAIL" . #Xe2fe) - ("!=" . #Xe900) - ("!==" . #Xe901) - ("!≡" . #Xe902) - ("!≡≡" . #Xe903) - ("!=<" . #Xe904) - ("#(" . #Xe90c) - ("#_" . #Xe90d) - ("#{" . #Xe90e) - ("#?" . #Xe90f) - ("##" . #Xe910) - ("#_(" . #Xe911) - ("#[" . #Xe912) - ("%=" . #Xe920) - ("&%" . #Xe92c) - ("&&" . #Xe92d) - ("&+" . #Xe92e) - ("&-" . #Xe92f) - ("&/" . #Xe930) - ("&=" . #Xe931) - ("&&&" . #Xe932) - ("$>" . #Xe93a) - ("(|" . #Xe940) - ("*>" . #Xe946) - ("++" . #Xe94c) - ("+++" . #Xe94d) - ("+=" . #Xe94e) - ("+>" . #Xe94f) - ("++=" . #Xe950) - ("--" . #Xe960) - ("-<" . #Xe961) - ("-<<" . #Xe962) - ("-=" . #Xe963) - ("->" . #Xe964) - ("->>" . #Xe965) - ("---" . #Xe966) - ("-->" . #Xe967) - ("-+-" . #Xe968) - ("-\\/" . #Xe969) - ("-|>" . #Xe96a) - ("-<|" . #Xe96b) - ("->-" . #Xe96c) - ("-<-" . #Xe96d) - ("-|" . #Xe96e) - ("-||" . #Xe96f) - ("-|:" . #Xe970) - (".=" . #Xe979) - ("//=" . #Xe994) - ("/=" . #Xe995) - ("/==" . #Xe996) - ("/-\\" . #Xe997) - ("/-:" . #Xe998) - ("/->" . #Xe999) - ("/=>" . #Xe99a) - ("/-<" . #Xe99b) - ("/=<" . #Xe99c) - ("/=:" . #Xe99d) - (":=" . #Xe9ac) - (":≡" . #Xe9ad) - (":=>" . #Xe9ae) - (":-\\" . #Xe9af) - (":=\\" . #Xe9b0) - (":-/" . #Xe9b1) - (":=/" . #Xe9b2) - (":-|" . #Xe9b3) - (":=|" . #Xe9b4) - (":|-" . #Xe9b5) - (":|=" . #Xe9b6) - ("<$>" . #Xe9c0) - ("<*" . #Xe9c1) - ("<*>" . #Xe9c2) - ("<+>" . #Xe9c3) - ("<-" . #Xe9c4) - ("<<=" . #Xe9c5) - ("<=" . #Xe9c6) - ("<=>" . #Xe9c7) - ("<>" . #Xe9c8) - ("<|>" . #Xe9c9) - ("<<-" . #Xe9ca) - ("<|" . #Xe9cb) - ("<=<" . #Xe9cc) - ("<~" . #Xe9cd) - ("<~~" . #Xe9ce) - ("<<~" . #Xe9cf) - ("<$" . #Xe9d0) - ("<+" . #Xe9d1) - ("" . #Xe9d2) - ("<@>" . #Xe9d3) - ("<#>" . #Xe9d4) - ("<%>" . #Xe9d5) - ("<^>" . #Xe9d6) - ("<&>" . #Xe9d7) - ("" . #Xe9d8) - ("<.>" . #Xe9d9) - ("" . #Xe9da) - ("<\\>" . #Xe9db) - ("<\">" . #Xe9dc) - ("<:>" . #Xe9dd) - ("<~>" . #Xe9de) - ("<**>" . #Xe9df) - ("<<^" . #Xe9e0) - ("<=" . #Xe9e1) - ("<->" . #Xe9e2) - ("" . #Xe9eb) - ("<<==" . #Xe9ec) - ("<==" . #Xe9ed) - ("<-\\" . #Xe9ee) - ("<-/" . #Xe9ef) - ("<=\\" . #Xe9f0) - ("<=/" . #Xe9f1) - ("=<<" . #Xea00) - ("==" . #Xea01) - ("===" . #Xea02) - ("==>" . #Xea03) - ("=>" . #Xea04) - ("=~" . #Xea05) - ("=>>" . #Xea06) - ("=~=" . #Xea07) - ("==>>" . #Xea08) - ("=>=" . #Xea09) - ("=<=" . #Xea0a) - ("=<" . #Xea0b) - ("==<" . #Xea0c) - ("=<|" . #Xea0d) - ("=/" . #Xea0e) - ("=/=" . #Xea0f) - ("=/<" . #Xea10) - ("=|" . #Xea11) - ("=||" . #Xea12) - ("=|:" . #Xea13) - (">-" . #Xea20) - (">=" . #Xea21) - (">>-" . #Xea22) - (">>=" . #Xea23) - (">=>" . #Xea24) - (">>^" . #Xea25) - (">>|" . #Xea26) - (">!=" . #Xea27) - (">->" . #Xea28) - (">==" . #Xea29) - (">=" . #Xea2a) - (">/=" . #Xea2b) - (">-|" . #Xea2c) - (">=|" . #Xea2d) - (">-\\" . #Xea2e) - (">=\\" . #Xea2f) - (">-/" . #Xea30) - (">=/" . #Xea31) - (">λ=" . #Xea32) - ("?." . #Xea3f) - ("^=" . #Xea43) - ("^^" . #Xea44) - ("^<<" . #Xea48) - ("^>>" . #Xea49) - ("\\=" . #Xea54) - ("\\==" . #Xea55) - ("\\/-" . #Xea56) - ("\\-/" . #Xea57) - ("\\-:" . #Xea58) - ("\\->" . #Xea59) - ("\\=>" . #Xea5a) - ("\\-<" . #Xea5b) - ("\\=<" . #Xea5c) - ("\\=:" . #Xea5d) - ("|=" . #Xea69) - ("|>=" . #Xea6a) - ("|>" . #Xea6b) - ("|+|" . #Xea6c) - ("|->" . #Xea6d) - ("|-->" . #Xea6e) - ("|=>" . #Xea6f) - ("|==>" . #Xea70) - ("|>-" . #Xea71) - ("|<<" . #Xea72) - ("||>" . #Xea73) - ("|>>" . #Xea74) - ("|-" . #Xea75) - ("||-" . #Xea76) - ("||=" . #Xea77) - ("|)" . #Xea78) - ("|]" . #Xea79) - ("|-:" . #Xea7a) - ("|=:" . #Xea7b) - ("|-<" . #Xea7c) - ("|=<" . #Xea7d) - ("|--<" . #Xea7e) - ("|==<" . #Xea7f) - ("~=" . #Xea8a) - ("~>" . #Xea8b) - ("~~>" . #Xea8c) - ("~>>" . #Xea8d) - ("[[" . #Xea8f) - ("[|" . #Xea90) - ("_|_" . #Xea97) - ("]]" . #Xeaa0)) diff --git a/modules/ui/ligatures/README.org b/modules/ui/ligatures/README.org index 4ea059781..8cd7a4478 100644 --- a/modules/ui/ligatures/README.org +++ b/modules/ui/ligatures/README.org @@ -4,39 +4,40 @@ #+since: 21.12.0 * Description :unfold: -This module enables ligatures and arbitrary symbol substitutions with -~mac-auto-operator-composition-mode~ (on supported macOS systems) or composition -tables (harfbuzz on Emacs 28), falling back on ~prettify-symbols-mode~ -otherwise. +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module flags]] + - [[#packages][Packages]] + - [[#hacks][Hacks]] + - [[#changelog][Changelog]] +- [[#installation][Installation]] +- [[#usage][Usage]] + - [[#mathematical-symbols-replacement][Mathematical symbols replacement]] + - [[#coding-ligatures][Coding ligatures]] + - [[#details][Details]] +- [[#configuration][Configuration]] + - [[#symbol-replacements-λ-for-lambda][Symbol replacements (λ for "lambda"...)]] + - [[#font-ligatures-turning--into-an-arrow][Font ligatures (turning "=>" into an arrow...)]] + - [[#setting-ligatures-for-specific-font-or-major-mode][Setting ligatures for specific font or major mode]] + - [[#overwriting-all-default-ligatures][Overwriting all default ligatures]] +- [[#troubleshooting][Troubleshooting]] + - [[#some-symbols-are-not-rendering-correctly][Some symbols are not rendering correctly]] +- [[#frequently-asked-questions][Frequently asked questions]] +- [[#appendix][Appendix]] ** Maintainers -/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]] +- [[doom-user:][@gagbo]] + +[[doom-contrib-maintainer:][Become a maintainer?]] ** Module flags - +extra :: Enables extra symbol substitutions in certain modes, for example ~lambda~ in lisps are replaced with ~λ~. -- +fira :: - Enable =Fira Code= ligatures. This requires Fira Code Symbol and [[id:a7e7402b-e202-4860-878b-d1933cff1d16][a patched - version of Fira Code]]. -- +hasklig :: - Enable =Hasklig= ligatures. This requires [[id:a7e7402b-e202-4860-878b-d1933cff1d16][a patched version of the HaskLig - font]]. -- +iosevka :: - Enable =Iosevka= ligatures. This requires [[id:a7e7402b-e202-4860-878b-d1933cff1d16][a patched version of the Iosevka - font]]. -- +pragmata-pro :: - Enable =Pragmata Pro= ligatures. This requires the [[https://www.fsd.it/shop/fonts/pragmatapro/][Pragmata Pro font]]. - -#+begin_quote - 🚧 Font flags are ignored _if_ you're sporting either a) Emacs 28+ with - Harfbuzz support (which can compose ligatures natively), or b) Mitsuharu's - =emacs-mac= build on macOS (which uses - ~mac-auto-operator-composition-mode~). -#+end_quote ** Packages -/This module doesn't install any packages./ +- [[https://github.com/mickeynp/ligature.el][ligature.el]] (on Emacs 28+ with Harfbuzz) ** Hacks /No hacks documented for this module./ @@ -55,63 +56,20 @@ This module requires one of three setups for ligatures to work: - Mitsuharu's =emacs-mac= build on macOS (available on Homebrew), or - A patched font for Doom's fallback ligature support. -** Mutsuharu's emacs-mac port or Emacs 28+ with Harfbuzz support -Ligatures should be handled without any additional configuration. + /This module does not have specific installation instructions/ -** Not Emacs-mac and Emacs <= 27 -:PROPERTIES: -:ID: a7e7402b-e202-4860-878b-d1933cff1d16 -:END: -1. Enable one of the four ligature font flags: =+fira=, =+hasklig=, =+iosevka= - or =+pragmata-pro=. -2. Install the patched version of the associated font with ~M-x - +ligatures/install-patched-font~. Note: Pragmata Pro cannot be installed this - way because it is a non-free font and must be purchased and installed - manually. + ~doom doctor~ will tell you if the module is incompatible with your current + Emacs version, and what you can do to remediate. -* TODO Usage +* Usage #+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 -** TODO Mathematical symbols replacement - -** Coding ligatures -This module includes configuration to compose combinations like =->= or =::= -into prettier glyphs (called a ligature). Depending on the current version of -emacs, this is implemented in two different ways : - -- prettify-symbols-mode method :: this is the "legacy" method. It uses a font - which haves the ligatures as separate unicode symbols, and using - prettify-symbols-mode, =->=-like combinations are manually listed and replaced - with the correct symbol. The mapping between =->=-like sequences and unicode - values in the font are font-specific ; therefore [[doom-module:+fira]], [[doom-module:+iosevka]]... files and - specific fonts are necessary for it to work. -- composition-function-table method :: regexps are used to match all the usual - sequences which are composed into ligatures. These regexps are passed to emacs - directly, which asks Harfbuzz to shape it. Ligatures are obtained - automatically depending on the capabilities of the font, and no font-specific - configuration is necessary. - -Emacs-mac port implements the /composition-function-table/ method in [[https://bitbucket.org/mituharu/emacs-mac/src/26c8fd9920db9d34ae8f78bceaec714230824dac/lisp/term/mac-win.el?at=master#lines-345:805][its code]], -nothing is necessary on Doom side; otherwise, Doom implements the -/composition-function-table/ for emacs 28+ built with Harfbuzz support, and the -/prettify-symbols-mode/ method otherwise. - -Even though harfbuzz has been included in emacs 27, there is currently a [[https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-04/msg01121.html][bug -(#40864)]] which prevents a safe usage of /composition-function-table/ method in -emacs 27. - -* TODO Configuration -#+begin_quote - 🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]] -#+end_quote - -** Setting ligatures -If you want to set ligatures for modules that don't have them by default you can -use the ~set-ligatures!~ macro: -#+begin_src emacs-lisp -;; in $DOOMDIR/config.el +** Mathematical symbols replacement +If you want to set symbol replacements for modules that don't have them by +default you can use the ~set-ligatures!~ function in your config.el file +#+BEGIN_SRC emacs-lisp (after! PACKAGE (set-ligatures! 'MAJOR-MODE :symbol "keyword")) @@ -128,7 +86,7 @@ E.g. :int "int" :str "string" :float "float" :bool "bool" :for "for" - :return "return" :yeild "yeild")) + :return "return" :yield "yield")) #+end_src You can set these symbols out of the box: @@ -146,7 +104,7 @@ You can set these symbols out of the box: :int "int keyword" :float "float keyword" :str "string keyword" - :bool "boolean keywork" + :bool "boolean keyword" :list "list keyword" ;; Flow :not "not operator" @@ -163,7 +121,7 @@ You can set these symbols out of the box: :intersect "Intersect keyword" :diff "diff keyword" :tuple "Tuple Keyword " - :pipe "Pipe Keyword" ;; FIXME: find a non-private char + :pipe "Pipe Keyword" :dot "Dot operator") #+end_src @@ -174,7 +132,38 @@ If you have multiple versions of the same keyword you can set the symbol twice: :null "None") #+end_src -** Changing ligatures + +** Coding ligatures +This module includes configuration to compose combinations like =->= or =::= +into prettier glyphs (called a ligature), specific for your font, or specific +for the major modes that you want to use. + +As these ligatures come from the font itself instead of elisp symbols, we use +=set-font-ligatures!= + +#+begin_src elisp +(set-font-ligatures! '(haskell-mode clojure-mode) ">>=" ">>-") +#+end_src + +*** Details +Ligatures are implemented using a **composition-function-table** method: regexps are +used to match all the usual sequences which are composed into ligatures. These +regexps are passed to emacs directly, which asks Harfbuzz to shape it. Ligatures +are obtained automatically depending on the capabilities of the font, and no +font-specific configuration is necessary. + +Emacs-mac port implements the same method natively in [[https://bitbucket.org/mituharu/emacs-mac/src/26c8fd9920db9d34ae8f78bceaec714230824dac/lisp/term/mac-win.el?at=master#lines-345:805][its code]], nothing is +necessary on Doom side; otherwise, Doom uses the [[https://github.com/mickeynp/ligature.el][ligature.el]] package that +implements this method for Emacs 28+ built with Harfbuzz support. Therefore, the +module will not work with Emacs 27 or previous. + +Even though harfbuzz has been included in emacs 27, there is currently a +[[https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-04/msg01121.html][bug +(#40864)]] which prevents a safe usage of the /composition-function-table/ method in +Emacs 27. + +* Configuration +** Symbol replacements (λ for "lambda"...) if you don't like the symbols chosen you can change them by using: #+begin_src emacs-lisp ;; you don't need to include all of them you can pick and mix @@ -214,25 +203,58 @@ if you don't like the symbols chosen you can change them by using: :intersect "∩" :diff "∖" :tuple "⨂" - :pipe "" ;; FIXME: find a non-private char + :pipe "" :dot "•") ;; you could also add your own if you want #+end_src +** Font ligatures (turning "=>" into an arrow...) +*** Setting ligatures for specific font or major mode +As the [[https://github.com/mickeynp/ligature.el][README]] for ligature.el states, you can manipulate the ligatures that you +want to enable, specific for your font, or specific for the major modes that you +want to use. =set-font-ligatures!= is a thin wrapper around =ligature.el= to control these. + +#+begin_src elisp +(set-font-ligatures! '(haskell-mode clojure-mode) ">>=" ">>-") +#+end_src + +This call will: +- overwrite all preceding calls to =set-font-ligatures!= + for =haskell-mode= and =clojure-mode= specifically, but +- keep the inheritance to ligatures set for all modes, or parent modes like =prog-mode= + +*** Overwriting all default ligatures +If you want to "start from scratch" and get control over all ligatures that +happen in all modes, you can use + +#+begin_src elisp +;; Set all your custom ligatures for all prog-modes here +;; This section is *out of* the after! block +;; Example: only get ligatures for "==" and "===" in programming modes +;; by default, and get only "www" in all buffers by default. +(setq +ligatures-prog-mode-list '("==" "===") + +ligatures-all-modes-list '("www")) +;; Set any of those variables to nil to wipe all defaults. + + ;; Set all your additional custom ligatures for other major modes here. + ;; Example: enable traditional ligature support in eww-mode, if the + ;; `variable-pitch' face supports it +(set-font-ligatures! 'eww-mode "ff" "fi" "ffi") +#+end_src + * Troubleshooting [[doom-report:][Report an issue?]] ** Some symbols are not rendering correctly This can usually be fixed by doing one of the following: -- Make sure Symbola (the font) is installed on your system. -- Otherwise, change [[var:doom-unicode-font]] (set to Symbola by default). -- Disable the [[doom-module::ui unicode]] module. It not only overrides [[var:doom-unicode-font]], but - should only be used as a last resort. +- Set [[var:doom-symbol-font]]. +- Disable the [[doom-module::ui unicode]] module. It overrides [[var:doom-symbol-font]] + and should only be used as a last resort. * Frequently asked questions /This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]] * TODO Appendix #+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 diff --git a/modules/ui/ligatures/autoload/install.el b/modules/ui/ligatures/autoload/install.el deleted file mode 100644 index fd7d096d2..000000000 --- a/modules/ui/ligatures/autoload/install.el +++ /dev/null @@ -1,58 +0,0 @@ -;;; ui/ligatures/autoload/install.el -*- lexical-binding: t; -*- -;;;###if (or (modulep! +fira) (modulep! +hasklig) (modulep! +iosevka)) - -(defun +ligatures--install-font (prefix name url-format fonts-alist &optional extra-fonts) - "Install fonts to the local system. - -If PREFIX is nil, will prompt whether or not to download. NAME is informational -only. URL-FORMAT is a format string that should be a url and have a single %s, -which is expanded for each font in FONTS-ALIST. FONTS-ALIST should be the -filename of each font. It is used as the source and destination filename." - (unless (or prefix - (yes-or-no-p - (format "This will download and install the %s fonts, continue?" - name))) - (user-error "Aborted")) - (let* ((font-dest - (cond (IS-LINUX - (expand-file-name - "fonts/" (or (getenv "XDG_DATA_HOME") - "~/.local/share"))) - (IS-MAC - (expand-file-name "~/Library/Fonts/")))) - (known-dest-p (stringp font-dest)) - (font-dest (or font-dest (read-directory-name "Font installation directory: " "~/")))) - (unless (file-directory-p font-dest) - (mkdir font-dest t)) - (dolist (font fonts-alist) - (url-copy-file (format url-format font) - (expand-file-name font font-dest) - t)) - (when known-dest-p - (message "Font downloaded, updating font cache... ") - (shell-command-to-string "fc-cache -f -v")) - (if IS-WINDOWS - (when (y-or-n-p "The %S font was downloaded, but Windows users must install them manually.\n\nShow files in windows explorer?") - (call-process "explorer.exe" nil nil nil font-dest)) - (message "Successfully %s %S fonts to %S!" - (if known-dest-p "installed" "downloaded") - name font-dest)))) - -;;;###autoload -(defun +ligatures/install-patched-font (font-id &optional arg) - "Install the font FONT-ID on your system. -FONT-ID must be a key from `+ligatures--font-alist'. -If PREFIX is non-nil, don't ask for confirmation and install it." - (interactive - (list - (car (cl-find (completing-read - "Install font: " - (mapcar #'cadr +ligatures--font-alist)) - +ligatures--font-alist - :key #'cadr - :test #'equal)) - current-prefix-arg)) - (cl-destructuring-bind (font-name &key _range url files) - (or (alist-get font-id +ligatures--font-alist) - (user-error "%S is not a valid font" font-id)) - (+ligatures--install-font arg font-name url files))) diff --git a/modules/ui/ligatures/autoload/ligatures.el b/modules/ui/ligatures/autoload/ligatures.el index 3711124c4..b44cc9599 100644 --- a/modules/ui/ligatures/autoload/ligatures.el +++ b/modules/ui/ligatures/autoload/ligatures.el @@ -11,40 +11,71 @@ MODES is a major mode symbol or a list of them. PLIST is a property list whose keys must match keys in `+ligatures-extra-symbols', and whose values are strings representing the text -to be replaced with that symbol. If the car of PLIST is nil, then unset any -pretty symbols previously defined for MODES. +to be replaced with that symbol. -This function accepts one special property: - - :alist ALIST - Appends ALIST to `prettify-symbols-alist' literally, without mapping text to - `+ligatures-extra-symbols'. +If the car of PLIST is nil, then unset any +pretty symbols and ligatures previously defined for MODES. For example, the rule for emacs-lisp-mode is very simple: - (set-ligatures! 'emacs-lisp-mode + (set-ligatures! \\='emacs-lisp-mode :lambda \"lambda\") This will replace any instances of \"lambda\" in emacs-lisp-mode with the symbol -assicated with :lambda in `+ligatures-extra-symbols'. +associated with :lambda in `+ligatures-extra-symbols'. Pretty symbols can be unset for emacs-lisp-mode with: - (set-ligatures! 'emacs-lisp-mode nil)" + (set-ligatures! \\='emacs-lisp-mode nil) + +Note that this will keep all ligatures in `+ligatures-prog-mode-list' active, as +`emacs-lisp-mode' is derived from `prog-mode'." (declare (indent defun)) (if (null (car-safe plist)) (dolist (mode (ensure-list modes)) (delq! mode +ligatures-extra-alist 'assq)) - (let (results) + (let ((results)) (while plist (let ((key (pop plist))) - (if (eq key :alist) - (prependq! results (pop plist)) (when-let (char (plist-get +ligatures-extra-symbols key)) - (push (cons (pop plist) char) results))))) + (push (cons (pop plist) char) results)))) (dolist (mode (ensure-list modes)) (setf (alist-get mode +ligatures-extra-alist) (if-let (old-results (alist-get mode +ligatures-extra-alist)) (dolist (cell results old-results) (setf (alist-get (car cell) old-results) (cdr cell))) results)))))) + +;;;###autodef +(defun set-font-ligatures! (modes &rest ligatures) + "Associates string patterns with ligatures in certain major-modes. + + MODES is a major mode symbol or a list of them. + LIGATURES is a list of ligatures that should be handled by the font, + like \"==\" or \"-->\". LIGATURES is a list of strings. + +For example, the rule for emacs-lisp-mode is very simple: + + (set-font-ligatures! \\='emacs-lisp-mode \"->\") + +This will ligate \"->\" into the arrow of choice according to your font. + +Font ligatures can be unset for emacs-lisp-mode with: + + (set-font-ligatures! \\='emacs-lisp-mode nil) + +Note that this will keep all ligatures in `+ligatures-prog-mode-list' active, as +`emacs-lisp-mode' is derived from `prog-mode'." + (declare (indent defun)) + ;; NOTE: Doom enforces `ligature-composition-table' to have a single mode per key in the alist. + ;; This is less efficient than what ligature.el can do (i.e. use a list of modes, or `t' as a key), + ;; but holding this invariant allows resetting with `(set-font-ligatures! 'mode nil)` to work reliably. + (if (null ligatures) + (dolist (mode (ensure-list modes)) + (delq! mode ligature-composition-table 'assq)) + (after! ligature + (dolist (mode (ensure-list modes)) + (setq ligature-ignored-major-modes (delq mode ligature-ignored-major-modes)) + (ligature-set-ligatures mode ligatures))))) + + diff --git a/modules/ui/ligatures/config.el b/modules/ui/ligatures/config.el index 8a38bc944..e11d19579 100644 --- a/modules/ui/ligatures/config.el +++ b/modules/ui/ligatures/config.el @@ -47,44 +47,25 @@ font.") (defvar +ligatures-extra-alist '((t)) "A map of major modes to symbol lists (for `prettify-symbols-alist').") -(defvar +ligatures-composition-alist - '((?! . "\\(?:!\\(?:==\\|[!=]\\)\\)") ; (regexp-opt '("!!" "!=" "!==")) - (?# . "\\(?:#\\(?:###?\\|_(\\|[#(:=?[_{]\\)\\)") ; (regexp-opt '("##" "###" "####" "#(" "#:" "#=" "#?" "#[" "#_" "#_(" "#{")) - (?$ . "\\(?:\\$>>?\\)") ; (regexp-opt '("$>" "$>>")) - (?% . "\\(?:%%%?\\)") ; (regexp-opt '("%%" "%%%")) - (?& . "\\(?:&&&?\\)") ; (regexp-opt '("&&" "&&&")) - (?* . "\\(?:\\*\\(?:\\*[*/]\\|[)*/>]\\)?\\)") ; (regexp-opt '("*" "**" "***" "**/" "*/" "*>" "*)")) - (?+ . "\\(?:\\+\\(?:\\+\\+\\|[+:>]\\)?\\)") ; (regexp-opt '("+" "++" "+++" "+>" "+:")) - (?- . "\\(?:-\\(?:-\\(?:->\\|[>-]\\)\\|<[<-]\\|>[>-]\\|[:<>|}~-]\\)\\)") ; (regexp-opt '("--" "---" "-->" "--->" "->-" "-<" "-<-" "-<<" "->" "->>" "-}" "-~" "-:" "-|")) - (?. . "\\(?:\\.\\(?:\\.[.<]\\|[.=>-]\\)\\)") ; (regexp-opt '(".-" ".." "..." "..<" ".=" ".>")) - (?/ . "\\(?:/\\(?:\\*\\*\\|//\\|==\\|[*/=>]\\)\\)") ; (regexp-opt '("/*" "/**" "//" "///" "/=" "/==" "/>")) - (?: . "\\(?::\\(?:::\\|[+:<=>]\\)?\\)") ; (regexp-opt '(":" "::" ":::" ":=" ":<" ":=" ":>" ":+")) - (?\; . ";;") ; (regexp-opt '(";;")) - (?0 . "0\\(?:\\(x[a-fA-F0-9]\\).?\\)") ; Tries to match the x in 0xDEADBEEF - ;; (?x . "x") ; Also tries to match the x in 0xDEADBEEF - ;; (regexp-opt '("" "<--->" "" "<<" "<<-" "<<<" "<<=" "<=" "<=<" "<==" "<=>" "<===>" "<>" "<|" "<|>" "<~" "<~~" "<." "<.>" "<..>")) - (?< . "\\(?:<\\(?:!--\\|\\$>\\|\\*\\(?:\\*?>\\)\\|\\+>\\|-\\(?:-\\(?:->\\|[>-]\\)\\|[>-]\\)\\|\\.\\(?:\\.?>\\)\\|/>\\|<[<=-]\\|=\\(?:==>\\|[<=>]\\)\\||>\\|~~\\|[$*+./<=>|~-]\\)\\)") - (?= . "\\(?:=\\(?:/=\\|:=\\|<[<=]\\|=[=>]\\|>[=>]\\|[=>]\\)\\)") ; (regexp-opt '("=/=" "=:=" "=<<" "==" "===" "==>" "=>" "=>>" "=>=" "=<=")) - (?> . "\\(?:>\\(?:->\\|=>\\|>[=>-]\\|[:=>-]\\)\\)") ; (regexp-opt '(">-" ">->" ">:" ">=" ">=>" ">>" ">>-" ">>=" ">>>")) - (?? . "\\(?:\\?[.:=?]\\)") ; (regexp-opt '("??" "?." "?:" "?=")) - (?\[ . "\\(?:\\[\\(?:|]\\|[]|]\\)\\)") ; (regexp-opt '("[]" "[|]" "[|")) - (?\\ . "\\(?:\\\\\\\\[\\n]?\\)") ; (regexp-opt '("\\\\" "\\\\\\" "\\\\n")) - (?^ . "\\(?:\\^==?\\)") ; (regexp-opt '("^=" "^==")) - (?w . "\\(?:wwww?\\)") ; (regexp-opt '("www" "wwww")) - (?{ . "\\(?:{\\(?:|\\(?:|}\\|[|}]\\)\\|[|-]\\)\\)") ; (regexp-opt '("{-" "{|" "{||" "{|}" "{||}")) - (?| . "\\(?:|\\(?:->\\|=>\\||=\\|[]=>|}-]\\)\\)") ; (regexp-opt '("|=" "|>" "||" "||=" "|->" "|=>" "|]" "|}" "|-")) - (?_ . "\\(?:_\\(?:|?_\\)\\)") ; (regexp-opt '("_|_" "__")) - (?\( . "\\(?:(\\*\\)") ; (regexp-opt '("(*")) - (?~ . "\\(?:~\\(?:~>\\|[=>@~-]\\)\\)")) ; (regexp-opt '("~-" "~=" "~>" "~@" "~~" "~~>")) - "An alist of all ligatures used by `+ligatures-extras-in-modes'. +(defvar +ligatures-prog-mode-list + '("|||>" "<|||" "<==>" "" "---" "-<<" + "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->" + "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "" "###" "#_(" "..<" + "..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~=" + "~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|" + "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:" + ">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:" + "<$" "<=" "<>" "<-" "<<" "<+" "" "++" "?:" + "?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)" + "\\\\" "://") + "A list of ligatures to enable in all `prog-mode' buffers.") -The car is the character ASCII number, cdr is a regex which will call -`font-shape-gstring' when matched. - -Because of the underlying code in :ui ligatures module, the regex should match a -string starting with the character contained in car. - -This variable is used only if you built Emacs with Harfbuzz on a version >= 28") +(defvar +ligatures-all-modes-list + '() + "A list of ligatures to enable in all buffers.") (defvar +ligatures-in-modes '(not special-mode comint-mode eshell-mode term-mode vterm-mode Info-mode @@ -144,8 +125,10 @@ and cannot run in." (and (modulep! +extra) (+ligatures--enable-p +ligatures-extras-in-modes)))) (when in-mode-p - (if (boundp '+ligature--composition-table) - (setq-local composition-function-table +ligature--composition-table) + ;; If ligature-mode has been installed, there's no + ;; need to do anything, we activate global-ligature-mode + ;; later and handle all settings from `set-ligatures!' later. + (unless (fboundp #'ligature-mode-turn-on) (run-hooks '+ligatures--init-font-hook) (setq +ligatures--init-font-hook nil))) (when in-mode-extras-p @@ -177,44 +160,21 @@ and cannot run in." ((and IS-MAC (fboundp 'mac-auto-operator-composition-mode)) (add-hook 'doom-init-ui-hook #'mac-auto-operator-composition-mode 'append)) - ;; Harfbuzz and Mac builds do not need font-specific ligature support - ;; if they are above emacs-27. + ;; NOTE: the module does not support Emacs 27 and less, but if we still try to enable ligatures, + ;; it will end up in catastrophic work-loss errors, so we leave the check here for safety. ((and (> emacs-major-version 27) (or (featurep 'ns) (string-match-p "HARFBUZZ" system-configuration-features)) - (featurep 'composite)) ; Emacs loads `composite' at startup - (defvar +ligature--composition-table (make-char-table nil)) + (featurep 'composite)) ; Emacs loads `composite' at startup + + (use-package! ligature + :config + ;; Enable all `+ligatures-prog-mode-list' ligatures in programming modes + (ligature-set-ligatures 'prog-mode +ligatures-prog-mode-list) + (ligature-set-ligatures 't +ligatures-all-modes-list)) + (add-hook! 'doom-init-ui-hook :append - (defun +ligature-init-composition-table-h () - (dolist (char-regexp +ligatures-composition-alist) - (set-char-table-range - +ligature--composition-table - (car char-regexp) `([,(cdr char-regexp) 0 font-shape-gstring]))) - (set-char-table-parent +ligature--composition-table composition-function-table)))) - - ;; Fallback ligature support for certain, patched fonts. Install them with - ;; `+ligatures/install-patched-font' - ((defmacro +ligatures--def-font (id font-plist &rest alist) - (declare (indent 2)) - (let ((alist-var (intern (format "+ligatures-%s-font-alist" id))) - (setup-fn (intern (format "+ligatures-init-%s-font-h" id)))) - `(progn - (setf (alist-get ',id +ligatures--font-alist) (list ,@font-plist)) - (defvar ,alist-var ',alist ,(format "Name of the %s ligature font." id)) - (defun ,setup-fn (&rest _) - (cl-destructuring-bind (name &key _url files range) - (or (alist-get ',id +ligatures--font-alist) - (error "No ligature font called %s" ',id)) - (when range - (set-fontset-font t range name nil 'prepend)) - (setq-default prettify-symbols-alist - (append (default-value 'prettify-symbols-alist) - (mapcar #'+ligatures--correct-symbol-bounds ,alist-var))))) - (add-hook '+ligatures--init-font-hook #',setup-fn)))) - - (defvar +ligatures--font-alist ()) - - (cond ((modulep! +fira) (load! "+fira")) - ((modulep! +iosevka) (load! "+iosevka")) - ((modulep! +hasklig) (load! "+hasklig")) - ((modulep! +pragmata-pro) (load! "+pragmata-pro"))))) + (defun +ligature-enable-globally-h () + "Enables ligature checks globally in all buffers. +You can also do it per mode with `ligature-mode'." + (global-ligature-mode t))))) diff --git a/modules/ui/ligatures/doctor.el b/modules/ui/ligatures/doctor.el new file mode 100644 index 000000000..9ae683ab4 --- /dev/null +++ b/modules/ui/ligatures/doctor.el @@ -0,0 +1,16 @@ +;; This cond expression mimics the activation conditional of ligatures, +;; with a fallback that triggers a warning. +(cond + ((and IS-MAC (fboundp 'mac-auto-operator-composition-mode)) + (ignore)) + + ((and (> emacs-major-version 27) + (or (featurep 'ns) + (string-match-p "HARFBUZZ" system-configuration-features)) + (featurep 'composite)) ; Emacs loads `composite' at startup + (ignore)) + + (t + (if IS-MAC + (warn! "The (:ui ligatures) module does not support your version of Emacs. Install emacs-plus with at least Emacs 28, or emacs-mac.") + (warn! "The (:ui ligatures) module does not support your version of Emacs. Make sure to have at least Emacs 28 with Harfbuzz configured (should be the default).")))) diff --git a/modules/ui/ligatures/packages.el b/modules/ui/ligatures/packages.el new file mode 100644 index 000000000..813e08649 --- /dev/null +++ b/modules/ui/ligatures/packages.el @@ -0,0 +1,5 @@ +(when (and (or (featurep 'ns) + (string-match-p "HARFBUZZ" system-configuration-features)) + (featurep 'composite)) + (package! ligature + :pin "0e5d0a8554622bcb0ec634e364795650ff4f2457")) diff --git a/modules/ui/minimap/README.org b/modules/ui/minimap/README.org index 56dbd7225..f4949135c 100644 --- a/modules/ui/minimap/README.org +++ b/modules/ui/minimap/README.org @@ -27,7 +27,7 @@ feature found in many other editors. * TODO Usage #+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 A minimap which provides an overview of the current buffer to the side, @@ -36,7 +36,7 @@ and drag to scroll along the buffer, or right-click anywhere to jump to there. * TODO Configuration #+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 There are a number of options provided by the =minimap.el= package this module @@ -55,5 +55,5 @@ Disable the minimap using [[kbd:][SPC t m]]. * TODO Appendix #+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 diff --git a/modules/ui/minimap/packages.el b/modules/ui/minimap/packages.el index b020b77c0..eb736c7cc 100644 --- a/modules/ui/minimap/packages.el +++ b/modules/ui/minimap/packages.el @@ -1,4 +1,4 @@ ;; -*- no-byte-compile: t; -*- ;;; ui/minimap/packages.el -(package! minimap :pin "ed7490652a676c0510ed57d5366c445de20a370b") +(package! minimap :pin "90aeeb5798ff2fa8b08bd4965af5e43806e01645") diff --git a/modules/ui/modeline/+light.el b/modules/ui/modeline/+light.el index fed1a341a..8f96d9bf0 100644 --- a/modules/ui/modeline/+light.el +++ b/modules/ui/modeline/+light.el @@ -113,11 +113,10 @@ side of the modeline, and whose CDR is the right-hand side.") "Build from ICON-SET the ICON with LABEL. Using optionals attributes FACE, HELP-ECHO and VOFFSET." (let ((icon-set-fn (pcase icon-set - ('octicon #'all-the-icons-octicon) - ('faicon #'all-the-icons-faicon) - ('material #'all-the-icons-material) - ('alltheicon #'all-the-icons-alltheicon) - ('fileicon #'all-the-icons-fileicon)))) + ('octicon #'nerd-icons-octicon) + ('faicon #'nerd-icons-faicon) + ('codicon #'nerd-icons-codicon) + ('material #'nerd-icons-mdicon)))) (propertize (concat (funcall icon-set-fn icon :face face @@ -290,7 +289,7 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with (evil-mc-frozen 'doom-modeline-highlight) ('doom-modeline-alternate-highlight)))) (concat (propertize " " 'face face) - (all-the-icons-faicon "i-cursor" :face face :v-adjust -0.0575) + (nerd-icons-faicon "nf-fa-i_cursor" :face face :v-adjust -0.0575) (propertize " " 'face `(:inherit (variable-pitch ,face))) (propertize (format "%d " count) 'face face))))))) @@ -332,7 +331,7 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with "Macro") 'face 'doom-modeline-highlight) sep - (all-the-icons-octicon "triangle-right" + (nerd-icons-octicon "nf-oct-triangle_right" :face 'doom-modeline-highlight :v-adjust -0.05) sep)))) @@ -418,7 +417,7 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with (let ((error (or .error 0)) (warning (or .warning 0)) (info (or .info 0))) - (+modeline-format-icon 'material "do_not_disturb_alt" + (+modeline-format-icon 'codicon "nf-cod-error" (number-to-string (+ error warning info)) (cond ((> error 0) 'error) ((> warning 0) 'warning) @@ -427,11 +426,11 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with error warning info)))) - (+modeline-format-icon 'material "check" "" 'success))) - (`running (+modeline-format-icon 'material "access_time" "*" 'mode-line-inactive "Running...")) - (`errored (+modeline-format-icon 'material "sim_card_alert" "!" 'error "Errored!")) - (`interrupted (+modeline-format-icon 'material "pause" "!" 'mode-line-inactive "Interrupted")) - (`suspicious (+modeline-format-icon 'material "priority_high" "!" 'error "Suspicious")))))) + (+modeline-format-icon 'material "nf-md-check" "" 'success))) + (`running (+modeline-format-icon 'faicon "nf-fa-hourglass" "*" 'mode-line-inactive "Running...")) + (`errored (+modeline-format-icon 'material "nf-md-sim_alert" "!" 'error "Errored!")) + (`interrupted (+modeline-format-icon 'material "nf-md-pause" "!" 'mode-line-inactive "Interrupted")) + (`suspicious (+modeline-format-icon 'material "nf-md-priority_high" "!" 'error "Suspicious")))))) @@ -532,7 +531,7 @@ lines are selected, or the NxM dimensions of a block selection.") mode-line-misc-info +modeline-modes (vc-mode (" " - ,(all-the-icons-octicon "git-branch" :v-adjust 0.0) + ,(nerd-icons-octicon "nf-oct-git_branch" :v-adjust 0.0) vc-mode " ")) " " +modeline-encoding @@ -540,8 +539,8 @@ lines are selected, or the NxM dimensions of a block selection.") (def-modeline! 'project `(" " - ,(all-the-icons-octicon - "file-directory" + ,(nerd-icons-octicon + "nf-oct-file_directory" :face 'bold :v-adjust -0.06 :height 1.1) diff --git a/modules/ui/modeline/README.org b/modules/ui/modeline/README.org index b37a41556..128babe4f 100644 --- a/modules/ui/modeline/README.org +++ b/modules/ui/modeline/README.org @@ -36,7 +36,7 @@ powered by the [[doom-package:doom-modeline]] package (where you can find screen * TODO Usage #+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 ** Hiding the modeline @@ -52,7 +52,7 @@ powered by the [[doom-package:doom-modeline]] package (where you can find screen * TODO Configuration #+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 ** TODO Changing the default modeline @@ -73,11 +73,11 @@ I rarely need to know what minor modes are active, so I removed them. ~M-x doom/describe-active-minor-mode~ was written to substitute for it. ** Icons in my modeline look strange -1. Check whether ~all-the-icons~ are installed. Run ~M-x - all-the-icons-install-fonts~ to install the resource fonts. Note that - ~all-the-icons~ only support GUI. See [[https://github.com/domtronn/all-the-icons.el][all-the-icons]] for details. +1. Check whether ~nerd-icons~ are installed. Run ~M-x + nerd-icons-install-fonts~ to install the resource fonts. Note that + ~nerd-icons~ only support GUI. See [[https://github.com/domtronn/nerd-icons.el][nerd-icons]] for details. -2. ~cnfonts~ will conflict with ~all-the-icons~. You can refer the following +2. ~cnfonts~ will conflict with ~nerd-icons~. You can refer the following workaround: #+begin_src emacs-lisp ;; See https://github.com/seagle0128/doom-modeline/issues/278#issuecomment-569510336 @@ -87,18 +87,11 @@ doom/describe-active-minor-mode~ was written to substitute for it. (add-hook 'after-setting-font-hook #'cnfonts-set-font) #+end_src -3. If ~all-the-icons~ fonts are installed while the icons cannot display - correctly, please install the non-free font [[https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/Symbola.zip][Symbola]]. This issue usually - occurs on Windows. - ** The right side of the modeline is cut off I believe the consensus is: this is due to oversized icons, i.e. a font issue. Some possible solutions: -1. Tweak ~all-the-icons-scale-factor~ (1.2 by default): ~(setq - all-the-icons-scale-factor 1.1)~ - -2. Add some padding to the modeline definition: +1. Add some padding to the modeline definition: #+begin_src emacs-lisp (after! doom-modeline (doom-modeline-def-modeline 'main @@ -106,7 +99,7 @@ Some possible solutions: '(misc-info minor-modes checker input-method buffer-encoding major-mode process vcs " "))) ; <-- added padding here #+end_src -3. Use another font for the mode line (or a different ~:height~) (source) +2. Use another font for the mode line (or a different ~:height~) (source) #+begin_src emacs-lisp (custom-set-faces! '(mode-line :family "Noto Sans" :height 0.9) @@ -139,7 +132,7 @@ Some possible solutions: * TODO Appendix #+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 ** Autodefs diff --git a/modules/ui/modeline/config.el b/modules/ui/modeline/config.el index 095a6c5b4..b58bf3eff 100644 --- a/modules/ui/modeline/config.el +++ b/modules/ui/modeline/config.el @@ -10,15 +10,6 @@ :hook (doom-modeline-mode . size-indication-mode) ; filesize in modeline :hook (doom-modeline-mode . column-number-mode) ; cursor column in modeline :init - (when (>= emacs-major-version 29) - ;; HACK: Emacs 29 treats `nil' for :background as invalid, and complains. - ;; `doom-modeline' hasn't updated its face to address this yet. - ;; REVIEW: PR this fix to doom-modeline - (defface doom-modeline-buffer-modified - '((t (:inherit (error bold) :background unspecified))) - "Face used for the \\='unsaved\\=' symbol in the mode-line." - :group 'doom-modeline-faces)) - ;; We display project info in the modeline ourselves (setq projectile-dynamic-mode-line nil) ;; Set these early so they don't trigger variable watchers @@ -37,21 +28,7 @@ (IS-WINDOWS 1) (0))) - ;; Fix modeline icons in daemon-spawned graphical frames. We have our own - ;; mechanism for disabling all-the-icons, so we don't need doom-modeline to do - ;; it for us. However, this may cause unwanted padding in the modeline in - ;; daemon-spawned terminal frames. If it bothers you, you may prefer - ;; `doom-modeline-icon' set to `nil'. - (when (daemonp) - (setq doom-modeline-icon t)) :config - ;; HACK Fix #4102 due to empty all-the-icons return value (caused by - ;; `doom--disable-all-the-icons-in-tty-a' advice) in tty daemon frames. - (defadvice! +modeline-disable-icon-in-daemon-a (fn &rest args) - :around #'doom-modeline-propertize-icon - (when (display-graphic-p) - (apply fn args))) - ;; Fix an issue where these two variables aren't defined in TTY Emacs on MacOS (defvar mouse-wheel-down-event nil) (defvar mouse-wheel-up-event nil) diff --git a/modules/ui/modeline/packages.el b/modules/ui/modeline/packages.el index 76c2b397f..274df912a 100644 --- a/modules/ui/modeline/packages.el +++ b/modules/ui/modeline/packages.el @@ -2,7 +2,7 @@ ;;; ui/modeline/packages.el (unless (modulep! +light) - (package! doom-modeline :pin "f45a5a200313568d54d73dd38bae76930c2008b5")) + (package! doom-modeline :pin "93f240f7a0bf35511cfc0a8dd75786744b4bcf77")) (package! anzu :pin "5abb37455ea44fa401d5f4c1bdc58adb2448db67") (when (modulep! :editor evil) (package! evil-anzu :pin "d1e98ee6976437164627542909a25c6946497899")) diff --git a/modules/ui/nav-flash/README.org b/modules/ui/nav-flash/README.org index bf089bc7c..155f1fada 100644 --- a/modules/ui/nav-flash/README.org +++ b/modules/ui/nav-flash/README.org @@ -48,7 +48,7 @@ is added to the jump-list (managed by [[doom-package:better-jumper]]). * TODO Configuration #+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 * Troubleshooting @@ -59,5 +59,5 @@ is added to the jump-list (managed by [[doom-package:better-jumper]]). * TODO Appendix #+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 diff --git a/modules/ui/neotree/README.org b/modules/ui/neotree/README.org index 85792b04f..f12191aa3 100644 --- a/modules/ui/neotree/README.org +++ b/modules/ui/neotree/README.org @@ -23,7 +23,7 @@ NERDTree. ** TODO Hacks #+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 ** TODO Changelog @@ -37,12 +37,12 @@ NERDTree. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -53,5 +53,5 @@ NERDTree. * TODO Appendix #+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 diff --git a/modules/ui/ophints/README.org b/modules/ui/ophints/README.org index 26b4aff43..181d82075 100644 --- a/modules/ui/ophints/README.org +++ b/modules/ui/ophints/README.org @@ -36,12 +36,12 @@ Uses [[doom-package:evil-goggles]] for evil users and [[doom-package:volatile-hi * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -52,5 +52,5 @@ Uses [[doom-package:evil-goggles]] for evil users and [[doom-package:volatile-hi * TODO Appendix #+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 diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index 8cc6a5fa6..1b040fd34 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -120,7 +120,7 @@ were followed." (setq-local evil-command-window-execute-fn execute-fn) (setq-local evil-command-window-cmd-key cmd-key) (evil-command-window-mode) - (evil-command-window-insert-commands hist))) + (evil--command-window-insert-commands hist))) (defadvice! +popup--evil-command-window-execute-a () "Execute the command under the cursor in the appropriate buffer, rather than @@ -148,7 +148,6 @@ the command buffer." (advice-add #'evil-window-move-far-right :around #'+popup-save-a)) -;;;###package help-mode (after! help-mode (defun +popup--switch-from-popup (location) (let (origin enable-local-variables) @@ -254,7 +253,6 @@ the command buffer." (apply fn args))) -;;;###package org (after! org (defadvice! +popup--suppress-delete-other-windows-a (fn &rest args) "Org has a scorched-earth window management policy I'm not fond of. i.e. it @@ -344,7 +342,6 @@ Ugh, such an ugly hack." (+popup--init window nil)))) -;;;###package pdf-tools (after! pdf-tools (setq tablist-context-window-display-action '((+popup-display-buffer-stacked-side-window-fn) @@ -375,6 +372,12 @@ Ugh, such an ugly hack." (letf! ((#'switch-to-buffer-other-window #'pop-to-buffer)) (apply fn args)))) +;;;###package wdired +(progn + ;; close the popup after you're done with a wdired buffer + (advice-add #'wdired-abort-changes :after #'+popup-close-a) + (advice-add #'wdired-finish-edit :after #'+popup-close-a)) + ;;;###package wgrep (progn ;; close the popup after you're done with a wgrep buffer @@ -382,7 +385,6 @@ Ugh, such an ugly hack." (advice-add #'wgrep-finish-edit :after #'+popup-close-a)) -;;;###package which-key (after! which-key (when (eq which-key-popup-type 'side-window) (setq which-key-popup-type 'custom diff --git a/modules/ui/popup/README.org b/modules/ui/popup/README.org index 38e4c37e7..dd810e1f0 100644 --- a/modules/ui/popup/README.org +++ b/modules/ui/popup/README.org @@ -61,12 +61,12 @@ clean up after itself and kill off buffers I mark as transient. * TODO Usage #+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 * TODO Configuration #+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 ** ~set-popup-rule!~ and ~set-popup-rules!~ @@ -81,7 +81,7 @@ buffer's name. You'll find comprehensive documentation on the other keywords in ~set-popup-rule!~'s docstring ([[kbd:][SPC h f set-popup-rule!]]). #+begin_quote - 📌 Popup rules end up in ~display-buffer-alist~, which instructs + 󰐃 Popup rules end up in ~display-buffer-alist~, which instructs ~display-buffer~ calls on how to set up windows for buffers that meet certain conditions. However, some plugins can avoid it entirely if they use ~set-buffer~ or ~switch-to-buffer~, which don't obey ~display-buffer-alist~. @@ -128,7 +128,7 @@ By default, the mode-line is hidden in popups. To disable this, you can either: * TODO Appendix #+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 ** Commands diff --git a/modules/ui/popup/autoload/popup.el b/modules/ui/popup/autoload/popup.el index 78119aec7..46bd5e2f0 100644 --- a/modules/ui/popup/autoload/popup.el +++ b/modules/ui/popup/autoload/popup.el @@ -437,9 +437,10 @@ window and return that window." (+popup--inhibit-transient t) +popup--remember-last) (+popup/close window 'force) - (if arg - (pop-to-buffer buffer) - (switch-to-buffer buffer)) + (let (display-buffer-alist) + (if arg + (pop-to-buffer buffer) + (switch-to-buffer buffer))) (selected-window))) ;;;###autoload diff --git a/modules/ui/tabs/README.org b/modules/ui/tabs/README.org index cec4965cb..8fa3c23a3 100644 --- a/modules/ui/tabs/README.org +++ b/modules/ui/tabs/README.org @@ -29,12 +29,12 @@ This module adds an Atom-esque tab bar to the Emacs UI. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -45,5 +45,5 @@ This module adds an Atom-esque tab bar to the Emacs UI. * TODO Appendix #+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 diff --git a/modules/ui/tabs/config.el b/modules/ui/tabs/config.el index fba46edd1..66504fdef 100644 --- a/modules/ui/tabs/config.el +++ b/modules/ui/tabs/config.el @@ -9,6 +9,7 @@ centaur-tabs-set-modified-marker t centaur-tabs-close-button "✕" centaur-tabs-modified-marker "•" + centaur-tabs-icon-type 'nerd-icons ;; Scrolling (with the mouse wheel) past the end of the tab list ;; replaces the tab list with that of another Doom workspace. This ;; prevents that. diff --git a/modules/ui/treemacs/README.org b/modules/ui/treemacs/README.org index f28071cb2..b3a915333 100644 --- a/modules/ui/treemacs/README.org +++ b/modules/ui/treemacs/README.org @@ -46,7 +46,7 @@ status for files. * TODO Usage #+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 The project bar can be opened using [[kbd:][SPC o p]]. @@ -58,7 +58,7 @@ The project bar can be opened using [[kbd:][SPC o p]]. * TODO Configuration #+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 The variable ~+treemacs-git-mode~ sets the type of git integration that treemacs @@ -72,7 +72,7 @@ There are 3 possible values: 3. ~'deferred~, same as extended, but highlights asynchronously. #+begin_quote - 🚧 ~+treemacs-git-mode~ must be set before treemacs is loaded. +  ~+treemacs-git-mode~ must be set before treemacs is loaded. #+end_quote * Troubleshooting @@ -83,5 +83,5 @@ There are 3 possible values: * TODO Appendix #+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 diff --git a/modules/ui/treemacs/config.el b/modules/ui/treemacs/config.el index a8d7a4d65..9f3febb6a 100644 --- a/modules/ui/treemacs/config.el +++ b/modules/ui/treemacs/config.el @@ -33,6 +33,7 @@ This must be set before `treemacs' has loaded.") (when +treemacs-git-mode ;; If they aren't supported, fall back to simpler methods (when (and (memq +treemacs-git-mode '(deferred extended)) + (not treemacs-python-executable) (not (executable-find "python3"))) (setq +treemacs-git-mode 'simple)) (treemacs-git-mode +treemacs-git-mode) @@ -42,6 +43,11 @@ This must be set before `treemacs' has loaded.") 0)))) +(use-package! treemacs-nerd-icons + :after treemacs + :config (treemacs-load-theme "nerd-icons")) + + (use-package! treemacs-evil :when (modulep! :editor evil +everywhere) :defer t diff --git a/modules/ui/treemacs/packages.el b/modules/ui/treemacs/packages.el index beba19700..97c87198d 100644 --- a/modules/ui/treemacs/packages.el +++ b/modules/ui/treemacs/packages.el @@ -1,7 +1,8 @@ ;; -*- no-byte-compile: t; -*- ;;; ui/treemacs/packages.el -(package! treemacs :pin "00e96c842f0559a4e13f433d4b513de404676671") +(package! treemacs :pin "56691a530abb61564c8df0456a18ff0f301c2055") +(package! treemacs-nerd-icons :pin "9876cb478145a0ec4e36f64ff6583f3de7126216") ;; These packages have no :pin because they're in the same repo (when (modulep! :editor evil +everywhere) (package! treemacs-evil)) @@ -10,5 +11,6 @@ (package! treemacs-magit)) (when (modulep! :ui workspaces) (package! treemacs-persp)) -(when (modulep! +lsp) +(when (and (modulep! +lsp) + (not (modulep! :tools lsp +eglot))) (package! lsp-treemacs :pin "e66ae2196503d4e84334519e56b4388feffa5060")) diff --git a/modules/ui/unicode/README.org b/modules/ui/unicode/README.org index c3b783ecc..dd7a796ec 100644 --- a/modules/ui/unicode/README.org +++ b/modules/ui/unicode/README.org @@ -13,12 +13,12 @@ emacs fontset to cover as many unicode glyphs as possible by scanning all available glyphs from all available fonts. 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. - The first time you run Emacs a unicode cache will be generated -- this will take a while! - 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 configuration or the versions of relevant packages changes. @@ -45,25 +45,25 @@ When this module is enabled: * TODO Usage #+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 * TODO Configuration #+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 The first font that will be analyzed to see if it contains the glyphs of -non-latin characters will be ~doom-unicode-font~: +non-latin characters will be ~doom-symbol-font~: #+begin_src emacs-lisp ;; in $DOOMDIR/config.el -(setq doom-unicode-font (font-spec :family "Fira Mono")) +(setq doom-symbol-font (font-spec :family "JuliaMono")) #+end_src If your ~doom-font~ provides good unicode coverage use: #+begin_src emacs-lisp ;; in $DOOMDIR/config.el -(setq doom-unicode-font doom-font) +(setq doom-symbol-font doom-font) #+end_src If your font does not provide some glyphs, this package will try its best to @@ -134,5 +134,5 @@ rm -f $EMACSDIR/.local/cache/pcache/unicode-fonts * TODO Appendix #+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 diff --git a/modules/ui/unicode/autoload.el b/modules/ui/unicode/autoload.el index 45a63ca66..7f9a857e7 100644 --- a/modules/ui/unicode/autoload.el +++ b/modules/ui/unicode/autoload.el @@ -12,14 +12,14 @@ necessary." (defun +unicode-setup-fonts-h (&optional frame) "Initialize `unicode-fonts', if in a GUI session. -If doom-unicode-font is set, add it as preferred font for all unicode blocks." +If doom-symbol-font is set, add it as a preferred font for all Unicode blocks." (when (and frame (display-multi-font-p frame)) (with-selected-frame frame (require 'unicode-fonts) - (when doom-unicode-font - (let ((doom-unicode-font-family (plist-get (font-face-attributes doom-unicode-font) :family))) + (when doom-symbol-font + (let ((doom-symbol-font-family (plist-get (font-face-attributes doom-symbol-font) :family))) (dolist (unicode-block unicode-fonts-block-font-mapping) - (push doom-unicode-font-family (cadr unicode-block))))) + (push doom-symbol-font-family (cadr unicode-block))))) ;; NOTE: will impact startup time on first run (let (inhibit-redisplay inhibit-message) (unicode-fonts-setup))))) diff --git a/modules/ui/vc-gutter/README.org b/modules/ui/vc-gutter/README.org index 3fd6f3c63..d8f56e1b4 100644 --- a/modules/ui/vc-gutter/README.org +++ b/modules/ui/vc-gutter/README.org @@ -64,12 +64,12 @@ projects version controlled by them. * TODO Usage #+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 * TODO Configuration #+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 * Troubleshooting @@ -80,5 +80,5 @@ projects version controlled by them. * TODO Appendix #+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 diff --git a/modules/ui/vc-gutter/config.el b/modules/ui/vc-gutter/config.el index 0f3b2bea1..cd78a4f59 100644 --- a/modules/ui/vc-gutter/config.el +++ b/modules/ui/vc-gutter/config.el @@ -116,6 +116,11 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'." ;; UX: update git-gutter on focus (in case I was using git externally) (add-hook 'focus-in-hook #'git-gutter:update-all-windows) + ;; Stop git-gutter doing things when we don't want + (remove-hook 'post-command-hook #'git-gutter:post-command-hook) + (advice-remove #'quit-window #'git-gutter:quit-window) + (advice-remove #'switch-to-buffer #'git-gutter:switch-to-buffer) + (add-hook! '(doom-escape-hook doom-switch-window-hook) :append (defun +vc-gutter-update-h (&rest _) "Refresh git-gutter on ESC. Return nil to prevent shadowing other @@ -130,6 +135,9 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'." (advice-add #'magit-stage-file :after #'+vc-gutter-update-h) (advice-add #'magit-unstage-file :after #'+vc-gutter-update-h) + ;; UX: update git-gutter after reverting a buffer + (add-hook 'after-revert-hook #'+vc-gutter-update-h) + ;; FIX: stop git-gutter:{next,previous}-hunk from jumping to random hunks. (defadvice! +vc-gutter--fix-linearity-of-hunks-a (diffinfos is-reverse) :override #'git-gutter:search-near-diff-index diff --git a/modules/ui/vi-tilde-fringe/README.org b/modules/ui/vi-tilde-fringe/README.org index 7302a4797..933910ac2 100644 --- a/modules/ui/vi-tilde-fringe/README.org +++ b/modules/ui/vi-tilde-fringe/README.org @@ -56,5 +56,5 @@ Or add new modes where you would like ~vi-tilde-fringe-mode~ enabled: * TODO Appendix #+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 diff --git a/modules/ui/window-select/README.org b/modules/ui/window-select/README.org index a36416922..16f92a821 100644 --- a/modules/ui/window-select/README.org +++ b/modules/ui/window-select/README.org @@ -43,12 +43,12 @@ desired. Evil users can jump to window N in [[kbd:][C-w ]] (where N is a numb * TODO Usage #+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 * TODO Configuration #+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 This module provides two backends, both providing the same functionality, but @@ -86,5 +86,5 @@ Replaces the entire buffer with large letters. * TODO Appendix #+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 diff --git a/modules/ui/workspaces/README.org b/modules/ui/workspaces/README.org index 33e068853..d99f4ea1b 100644 --- a/modules/ui/workspaces/README.org +++ b/modules/ui/workspaces/README.org @@ -29,7 +29,7 @@ for manipulating them. ** TODO Hacks #+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 ** TODO Changelog @@ -43,7 +43,7 @@ for manipulating them. * TODO Usage #+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 ** Isolated buffer-list @@ -91,7 +91,7 @@ in [[../../editor/evil/+commands.el][config/default/+evil-commands.el]]). * TODO Configuration #+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 * Troubleshooting @@ -102,7 +102,7 @@ in [[../../editor/evil/+commands.el][config/default/+evil-commands.el]]). * TODO Appendix #+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 ** API diff --git a/modules/ui/workspaces/autoload/workspaces.el b/modules/ui/workspaces/autoload/workspaces.el index 2c306d1d1..840ca1d5c 100644 --- a/modules/ui/workspaces/autoload/workspaces.el +++ b/modules/ui/workspaces/autoload/workspaces.el @@ -221,7 +221,7 @@ workspace." ;;;###autoload (defun +workspace/rename (new-name) "Rename the current workspace." - (interactive (list (read-from-minibuffer "New workspace name: "))) + (interactive (list (completing-read "New workspace name: " (list (+workspace-current-name))))) (condition-case-unless-debug ex (let* ((current-name (+workspace-current-name)) (old-name (+workspace-rename current-name new-name))) @@ -598,8 +598,9 @@ This be hooked to `projectile-after-switch-project-hook'." ;;;###autoload (defun +workspaces-load-tab-bar-data-from-file-h (&rest _) "Restores the tab bar data from file." - (tab-bar-tabs-set (persp-parameter 'tab-bar-tabs)) - (tab-bar--update-tab-bar-lines t)) + (when-let ((persp-tab-data (persp-parameter 'tab-bar-tabs))) + (tab-bar-tabs-set persp-tab-data) + (tab-bar--update-tab-bar-lines t))) ;; ;;; Advice diff --git a/modules/ui/zen/README.org b/modules/ui/zen/README.org index 0518fe94e..0911714e3 100644 --- a/modules/ui/zen/README.org +++ b/modules/ui/zen/README.org @@ -66,7 +66,7 @@ Invoke either command again to undo the change. * TODO Configuration #+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 * Troubleshooting @@ -77,5 +77,5 @@ Invoke either command again to undo the change. * TODO Appendix #+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 diff --git a/profiles/README.org b/profiles/README.org index dfc2b067f..b9bcd8348 100644 --- a/profiles/README.org +++ b/profiles/README.org @@ -113,7 +113,7 @@ There are two caveats with this profile system: 1. Delete [[https://github.com/plexus/chemacs2][Chemacs]] from =$EMACSDIR=. 2. Install Doom there: ~$ git clone https://github.com/doomemacs/doomemacs - ~/.config/emacs~ + \~/.config/emacs~ 3. Move =~/.emacs-profiles.el= to =~/.config/doom/profiles.el= and transform the string keys to symbols and adapt =env= entries like so: diff --git a/shell.nix b/shell.nix index 80ad84095..0f3954172 100644 --- a/shell.nix +++ b/shell.nix @@ -18,11 +18,15 @@ # nix-shell --argstr emacs 27.2 # 27.2 # nix-shell --argstr emacs 28.1 # 28.1 # nix-shell --argstr emacs 28.2 # 28.2 -# nix-shell --argstr emacs head # 29.0.50 +# nix-shell --argstr emacs 29.1 # 29.1 +# nix-shell --argstr emacs head # 30.0.50 # nix-shell --argstr emacs ci-26.3 # 26.3 (barebones; no GUI) # nix-shell --argstr emacs ci-27.1 # 27.1 (barebones; no GUI) # nix-shell --argstr emacs ci-27.2 # 27.2 (barebones; no GUI) -# nix-shell --argstr emacs ci-HEAD # 29.0.50 (barebones; no GUI) +# nix-shell --argstr emacs ci-28.1 # 28.1 (barebones; no GUI) +# nix-shell --argstr emacs ci-28.2 # 28.2 (barebones; no GUI) +# nix-shell --argstr emacs ci-29.1 # 29.1 (barebones; no GUI) +# nix-shell --argstr emacs ci-HEAD # 30.0.50 (barebones; no GUI) { pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/22.05.tar.gz") { @@ -37,10 +41,11 @@ emacs27-1 = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/11264a390b197b80edeffac6f20e582f3ea318bd.tar.gz") {}).emacs; emacs27-2 = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/4c87cb87a2db6b9eb43541c1cf83f2a2f725fa25.tar.gz") {}).emacs; emacs28-1 = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/54e795706d9fa90004ed1274af639a717f04a2aa.tar.gz") {}).emacs; + emacs29-1 = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/c434383f2a4866a7c674019b4cdcbfc55db3c4ab.tar.gz") {}).emacs29; }) ]; } -, emacs ? "28.2" +, emacs ? "29.1" , emacsdir ? "$(pwd)" , doomdir ? "" , doomlocaldir ? "$EMACSDIR/.local" }: @@ -50,12 +55,14 @@ let emacsPkg = (if emacs == "26.3" then pkgs.emacs26 else if emacs == "27.2" then pkgs.emacs27-2 else if emacs == "28.1" then pkgs.emacs28-1 else if emacs == "28.2" then pkgs.emacs + else if emacs == "29.1" then pkgs.emacs29-1 else if emacs == "head" then pkgs.emacsGit else if emacs == "ci-26.3" then pkgs.emacs-26-3 else if emacs == "ci-27.1" then pkgs.emacs-27-1 else if emacs == "ci-27.2" then pkgs.emacs-27-2 else if emacs == "ci-28.1" then pkgs.emacs-28-1 else if emacs == "ci-28.2" then pkgs.emacs-28-2 + else if emacs == "ci-29.1" then pkgs.emacs-29-1 else if emacs == "ci-head" then pkgs.emacs-snapshot else pkgs.emacs); in pkgs.stdenv.mkDerivation { diff --git a/templates/config.example.el b/templates/config.example.el index fa39ec981..9746b74ff 100644 --- a/templates/config.example.el +++ b/templates/config.example.el @@ -15,7 +15,7 @@ ;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable) ;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for ;; presentations or streaming. -;; - `doom-unicode-font' -- for unicode glyphs +;; - `doom-symbol-font' -- for symbols ;; - `doom-serif-font' -- for the `fixed-pitch-serif' face ;; ;; See 'C-h v doom-font' for documentation and more examples of what they diff --git a/templates/packages.example.el b/templates/packages.example.el index 839b83c58..364e6e9b7 100644 --- a/templates/packages.example.el +++ b/templates/packages.example.el @@ -7,44 +7,44 @@ ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: -;(package! some-package) +;; (package! some-package) ;; To install a package directly from a remote git repo, you must specify a ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: ;; https://github.com/radian-software/straight.el#the-recipe-format -;(package! another-package -; :recipe (:host github :repo "username/repo")) +;; (package! another-package +;; :recipe (:host github :repo "username/repo")) ;; If the package you are trying to install does not contain a PACKAGENAME.el ;; file, or is located in a subdirectory of the repo, you'll need to specify ;; `:files' in the `:recipe': -;(package! this-package -; :recipe (:host github :repo "username/repo" -; :files ("some-file.el" "src/lisp/*.el"))) +;; (package! this-package +;; :recipe (:host github :repo "username/repo" +;; :files ("some-file.el" "src/lisp/*.el"))) ;; If you'd like to disable a package included with Doom, you can do so here ;; with the `:disable' property: -;(package! builtin-package :disable t) +;; (package! builtin-package :disable t) ;; You can override the recipe of a built in package without having to specify ;; all the properties for `:recipe'. These will inherit the rest of its recipe ;; from Doom or MELPA/ELPA/Emacsmirror: -;(package! builtin-package :recipe (:nonrecursive t)) -;(package! builtin-package-2 :recipe (:repo "myfork/package")) +;; (package! builtin-package :recipe (:nonrecursive t)) +;; (package! builtin-package-2 :recipe (:repo "myfork/package")) ;; Specify a `:branch' to install a package from a particular branch or tag. ;; This is required for some packages whose default branch isn't 'master' (which ;; our package manager can't deal with; see radian-software/straight.el#279) -;(package! builtin-package :recipe (:branch "develop")) +;; (package! builtin-package :recipe (:branch "develop")) ;; Use `:pin' to specify a particular commit to install. -;(package! builtin-package :pin "1a2b3c4d5e") +;; (package! builtin-package :pin "1a2b3c4d5e") ;; Doom's packages are pinned to a specific commit and updated from release to ;; release. The `unpin!' macro allows you to unpin single packages... -;(unpin! pinned-package) +;; (unpin! pinned-package) ;; ...or multiple packages -;(unpin! pinned-package another-pinned-package) +;; (unpin! pinned-package another-pinned-package) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) -;(unpin! t) +;; (unpin! t)