From 90dae2594042ac73ea7e38fb044917e153e9ebeb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 7 Feb 2024 15:24:08 -0500 Subject: [PATCH 1/6] fix(cli): ensure $EMACSDIR/lisp/cli is in $DOOMPATH If $DOOMPATH is malformed or set to a value that does not contain a valid path to Doom's CLI library in $EMACSDIR/lisp/cli (see #7608), bin/doom no longer functions, emitting "a subcommand is required" errors. This change ensures that the CLI library is always the last (implicit) element in doom-cli-load-path, and ensures $DOOMPATH is never written to the user's envvar file (in case they try to use bin/doom from inside a terminal within a Doom Emacs session), which should ensure users -- at least -- never find themselves stranded without the Doom CLI. Fix: #7608 Co-authored-by: bpizzi --- lisp/cli/env.el | 3 ++- lisp/doom-cli.el | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/cli/env.el b/lisp/cli/env.el index 5256e7b93..e6463d893 100644 --- a/lisp/cli/env.el +++ b/lisp/cli/env.el @@ -33,7 +33,8 @@ "^SSH_\\(AUTH_SOCK\\|AGENT_PID\\)$" "^\\(SSH\\|GPG\\)_TTY$" "^GPG_AGENT_INFO$" ;; Internal Doom envvars - "^DEBUG$" "^INSECURE$" "^\\(EMACS\\|DOOM\\)DIR$" "^DOOMPROFILE$" "^__") + "^DEBUG$" "^INSECURE$" "^\\(EMACS\\|DOOM\\)DIR$" + "^DOOM\\(PATH\\|PROFILE\\)$" "^__") "Environment variables to omit from envvar files. Each string is a regexp, matched against variable names to omit from diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index 674e07e94..25c4e1216 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -92,15 +92,14 @@ :group 'doom) (defvar doom-cli-load-path - (let ((paths (split-string (or (getenv "DOOMPATH") "") path-separator))) - (if (member "" paths) - (cl-substitute (doom-path (dir!) "cli/") "" paths :test #'equal) - paths)) + (append (when-let ((doompath (getenv "DOOMPATH"))) + (cl-loop for dir in (split-string doompath path-separator) + collect (expand-file-name dir))) + (list (file-name-concat (dir!) "cli"))) "A list of paths to search for autoloaded Doom CLIs. It is prefilled by the DOOMPATH envvar (a colon-separated list on Linux/macOS, -semicolon otherwise). Empty entries in DOOMPATH are replaced with the -$EMACSDIR/cli/.") +semicolon otherwise).") ;;; CLI definition variables (defvar doom-cli-argument-types From 5ef7075f9645a784657606f34e1129c6f6f607d2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 7 Feb 2024 18:25:04 -0500 Subject: [PATCH 2/6] nit(popup): mention post-command-select-window for 30.x+ Ref: emacs-mirror/emacs@6f75d0f36dd4 --- modules/ui/popup/autoload/popup.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ui/popup/autoload/popup.el b/modules/ui/popup/autoload/popup.el index 27880b432..ba90d642f 100644 --- a/modules/ui/popup/autoload/popup.el +++ b/modules/ui/popup/autoload/popup.el @@ -139,6 +139,8 @@ the buffer is visible, then set another timer and try again later." (defun +popup--maybe-select-window (window origin) "Select a window based on `+popup--inhibit-select' and this window's `select' parameter." (unless +popup--inhibit-select + ;; REVIEW: Once our minimum version is bumped up to Emacs 30.x, replace this + ;; with `post-command-select-window' window parameter. (let ((select (+popup-parameter 'select window))) (if (functionp select) (funcall select window origin) From 15339e4671c2dfb06c8289e1ae6860e701a408b2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 8 Feb 2024 00:56:40 -0500 Subject: [PATCH 3/6] fix(lib): doom-project-find-file: cl-no-applicable-method project-root Fix: #7312 --- lisp/lib/projects.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/lib/projects.el b/lisp/lib/projects.el index ffd2aa9b1..91f528e12 100644 --- a/lisp/lib/projects.el +++ b/lisp/lib/projects.el @@ -155,8 +155,8 @@ If DIR is not a project, it will be indexed (but not cached)." ((and (bound-and-true-p ivy-mode) (fboundp 'counsel-file-jump)) (call-interactively #'counsel-file-jump)) - ((project-current nil dir) - (project-find-file-in nil nil dir)) + ((when-let ((pr (project-current nil dir))) + (project-find-file-in nil nil pr))) ((and (bound-and-true-p helm-mode) (fboundp 'helm-find-files)) (call-interactively #'helm-find-files)) From 1b0af3bfc747d9ef4973af0b5698b1c71cff86f5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 8 Feb 2024 01:55:17 -0500 Subject: [PATCH 4/6] fix(lib): doom-project-find-file: remove +vertico/consult-fd-or-find When +vertico/find-file-in was replaced in 60e22fd with +vertico/consult-fd-or-find, it changed a key behavior for doom-project-find-file for Vertico users: instead of displaying an initial list of all files under the target directory, it would display nothing until the user entered in N * `consult-async-min-input` characters, causing confusion (see linked comment). Since Vertico integration modifies project-find-file-in's interface appropriately, I leave it to that command instead. Ref: https://github.com/doomemacs/doomemacs/issues/7312#issuecomment-1933404444 Amend: 60e22fd2eb61 --- lisp/lib/projects.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/lisp/lib/projects.el b/lisp/lib/projects.el index 91f528e12..a1655f314 100644 --- a/lisp/lib/projects.el +++ b/lisp/lib/projects.el @@ -149,9 +149,6 @@ If DIR is not a project, it will be indexed (but not cached)." (if (doom-module-p :completion 'ivy) #'counsel-projectile-find-file #'projectile-find-file))) - ((and (bound-and-true-p vertico-mode) - (fboundp '+vertico/consult-fd-or-find)) - (+vertico/consult-fd-or-find default-directory)) ((and (bound-and-true-p ivy-mode) (fboundp 'counsel-file-jump)) (call-interactively #'counsel-file-jump)) From 4db347769e1254e55365e3e8be41410c548f90b8 Mon Sep 17 00:00:00 2001 From: Benjamin Schwehn Date: Fri, 9 Feb 2024 05:11:48 +0100 Subject: [PATCH 5/6] fix(file-templates): unknown directive error from __license-lgpl3 The misspelling produces a 'Ignoring unknown directive "contribuer"' error, which was introduced in joaotavora/yasnippet@25f5d88. Ref: joaotavora/yasnippet@25f5d8808af2 --- .../editor/file-templates/templates/text-mode/__license-lgpl3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/editor/file-templates/templates/text-mode/__license-lgpl3 b/modules/editor/file-templates/templates/text-mode/__license-lgpl3 index 1f275c124..3c86d5843 100644 --- a/modules/editor/file-templates/templates/text-mode/__license-lgpl3 +++ b/modules/editor/file-templates/templates/text-mode/__license-lgpl3 @@ -2,7 +2,7 @@ # name: GNU LGPL v3 License # uuid: __license-lgpl3 # group: Licenses -# contribuer: https://choosealicense.com/licenses/lgpl-3.0/ +# contributor: https://choosealicense.com/licenses/lgpl-3.0/ # expand-env: ((yas-indent-line 'fixed)) # -- GNU LESSER GENERAL PUBLIC LICENSE From b655f6aa1f55c385f8821ffc29d950ec2b68a9b1 Mon Sep 17 00:00:00 2001 From: Colin Woodbury Date: Fri, 9 Feb 2024 09:20:30 +0900 Subject: [PATCH 6/6] docs(fortran): show how to customize fprettier --- modules/lang/fortran/README.org | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/lang/fortran/README.org b/modules/lang/fortran/README.org index 6ccfa6598..1330d93ad 100644 --- a/modules/lang/fortran/README.org +++ b/modules/lang/fortran/README.org @@ -97,20 +97,28 @@ your Bash Profile, etc., and log out and in again._ Now Doom will be able to use Good luck and happy computing! -** efmt +** Auto-formatting 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. +See below for advanced configuration. + * TODO Usage #+begin_quote 󱌣 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?]] -#+end_quote +* Configuration + +** Customising fprettier + +If you want different arguments to be passed to =fprettier=, follow this example: + +#+begin_src emacs-lisp +(after! f90 + (set-formatter! 'fprettify '("fprettify" "--enable-decl" "-w" "4" "-") :modes '(f90-mode fortran-mode))) +#+end_src * Troubleshooting /There are no known problems with this module./ [[doom-report:][Report one?]]