From 9c2d50d97e88587b419ad4881c1c62a6b71817ff Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH 1/8] nit: fix docstrings --- modules/editor/file-templates/autoload.el | 6 +++--- modules/lang/org/autoload/org-capture.el | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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/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) From b84403a9faccb81f485b8fa19b96571b84026469 Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH 2/8] nit: remove superfluous package cookies --- modules/lang/javascript/config.el | 1 - modules/ui/popup/+hacks.el | 4 ---- 2 files changed, 5 deletions(-) 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/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index 8cc6a5fa6..2bcca7243 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -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) @@ -382,7 +379,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 From 034da90693774346fea587e39e43788b6ed1903f Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH 3/8] refactor(eshell): remove wait for esh-module --- modules/term/eshell/config.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index 41ca9f523..4b629dcd6 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -109,9 +109,7 @@ You should use `set-eshell-alias!' to change this.") ;; 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. From b261afe59ddba705bd38c9cd0d3aedab904dd2be Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH 4/8] fix(org): use file URI for org-re-reveal-root Ref: https://gitlab.com/oer/org-re-reveal/-/commit/9c7830e48f8a5e56928973d72d683e2b6b578a0f --- modules/lang/org/contrib/present.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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")) From 3d82e3d46ded0365463273bcb80487b689ca1016 Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH 5/8] fix(vertico): gate which-key integration This prevents an error for users disabling which-key. --- modules/completion/vertico/config.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/completion/vertico/config.el b/modules/completion/vertico/config.el index c797303e2..1aa68732d 100644 --- a/modules/completion/vertico/config.el +++ b/modules/completion/vertico/config.el @@ -253,14 +253,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 From d5f86f179f0a0900d355c1f3c3e03e7004bda7e4 Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH 6/8] tweak(default): add multi-buffer imenu commands There is no analogous counsel command. --- modules/config/default/+emacs-bindings.el | 3 +++ modules/config/default/+evil-bindings.el | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index b154a0da0..8308daa98 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 diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 9d3d499b5..e8e03a6ba 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -736,6 +736,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 From 088bd387f6c901273ad166b67a14bf1745026c4f Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH 7/8] tweak(lib): add alpha-background support to opacity setter This is preferred when available because it does not affect foreground content like text and images. Ref: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29.1#n801 --- lisp/lib/ui.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 From 62074bfcbb7f332ca8aa123f1a4828a5e3ba98e7 Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sat, 2 Sep 2023 11:44:48 -0500 Subject: [PATCH 8/8] tweak(emoji): add emoji-search binding for Emacs 29 The emojify command takes precedence in case users want ASCII/GitHub string completion/insertion. Ref: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29.1#n884 --- modules/config/default/+emacs-bindings.el | 5 ++++- modules/config/default/+evil-bindings.el | 5 ++++- modules/ui/emoji/README.org | 11 ++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index 8308daa98..7aa4dfc41 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -148,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 e8e03a6ba..f6d1c9225 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 ")) diff --git a/modules/ui/emoji/README.org b/modules/ui/emoji/README.org index f9ac07af7..a1c065a63 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?]]