From 7eb61896f455e17daf84948ad722a94cb4197afb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Aug 2024 14:10:12 -0400 Subject: [PATCH 01/10] fix(org): jupyter-org-mime-types: restore :text/html Ref: emacs-jupyter/jupyter#477 Ref: #2477 --- modules/lang/org/contrib/jupyter.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/lang/org/contrib/jupyter.el b/modules/lang/org/contrib/jupyter.el index 3dbe480b2..acb8be0ad 100644 --- a/modules/lang/org/contrib/jupyter.el +++ b/modules/lang/org/contrib/jupyter.el @@ -34,7 +34,4 @@ (unless (bound-and-true-p jupyter-org-interaction-mode) (jupyter-org-interaction-mode))) - ;; Remove text/html since it's not human readable - (delq! :text/html jupyter-org-mime-types) - (require 'tramp)) From e750d84a476721e42312297b4925dbd16d8fd8ad Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Aug 2024 16:31:45 -0400 Subject: [PATCH 02/10] bump: code-review doomelpa/code-review@e4c34fa284da -> doomelpa/code-review@eeffdd9e20ad Ref: doomelpa/code-review#2 --- modules/tools/magit/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/magit/packages.el b/modules/tools/magit/packages.el index 2d33c0142..ae2597e42 100644 --- a/modules/tools/magit/packages.el +++ b/modules/tools/magit/packages.el @@ -11,4 +11,4 @@ :recipe (:host github :repo "doomelpa/code-review" :files ("graphql" "code-review*.el")) - :pin "e4c34fa284da25d8e0bafbae4300f1db5bdcda44")) + :pin "eeffdd9e20ad133e5981f216965445bfae20292a")) From 9df815a450d7026b2f6d503edeead846d0f67f68 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Aug 2024 16:32:17 -0400 Subject: [PATCH 03/10] fix(plantuml): ref to incorrect jar path variable --- modules/lang/plantuml/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/plantuml/autoload.el b/modules/lang/plantuml/autoload.el index 3be66d08f..e97d32666 100644 --- a/modules/lang/plantuml/autoload.el +++ b/modules/lang/plantuml/autoload.el @@ -34,7 +34,7 @@ This function is called by `org-babel-execute-src-block'." (concat (shell-quote-argument (executable-find plantuml-executable-path)) " --headless")) ((not (file-exists-p plantuml-jar-path)) - (error "Could not find plantuml.jar at %s" org-plantuml-jar-path)) + (error "Could not find plantuml.jar at %s" plantuml-jar-path)) ((concat "java " (cdr (assoc :java params)) " -jar " (shell-quote-argument (expand-file-name plantuml-jar-path))))) From 8e76097d49549f845736e234d10b8bcd85be6fc7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Aug 2024 16:59:59 -0400 Subject: [PATCH 04/10] fix(org): respect evil-disable-insert-state-bindings Close: #8023 Co-authored-by: ambirdsall --- modules/lang/org/config.el | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index cf03dc42b..f8404075f 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -1207,19 +1207,23 @@ between the two." (map! :map evil-org-mode-map :ni [C-return] #'+org/insert-item-below :ni [C-S-return] #'+org/insert-item-above - ;; navigate table cells (from insert-mode) - :i Cright (cmds! (org-at-table-p) #'org-table-next-field - #'org-end-of-line) - :i Cleft (cmds! (org-at-table-p) #'org-table-previous-field - #'org-beginning-of-line) - :i Cup (cmds! (org-at-table-p) #'+org/table-previous-row - #'org-up-element) - :i Cdown (cmds! (org-at-table-p) #'org-table-next-row - #'org-down-element) - :ni CSright #'org-shiftright - :ni CSleft #'org-shiftleft - :ni CSup #'org-shiftup - :ni CSdown #'org-shiftdown + (:unless evil-disable-insert-state-bindings + :i Cright (cmds! (org-at-table-p) #'org-table-next-field + #'org-end-of-line) + :i Cleft (cmds! (org-at-table-p) #'org-table-previous-field + #'org-beginning-of-line) + :i Cup (cmds! (org-at-table-p) #'+org/table-previous-row + #'org-up-element) + :i Cdown (cmds! (org-at-table-p) #'org-table-next-row + #'org-down-element) + :i CSright #'org-shiftright + :i CSleft #'org-shiftleft + :i CSup #'org-shiftup + :i CSdown #'org-shiftdown) + :n CSright #'org-shiftright + :n CSleft #'org-shiftleft + :n CSup #'org-shiftup + :n CSdown #'org-shiftdown ;; more intuitive RET keybinds :n [return] #'+org/dwim-at-point :n "RET" #'+org/dwim-at-point From 07dff9918464578be3136a786969d274a0c44d40 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Aug 2024 17:20:25 -0400 Subject: [PATCH 05/10] feat(tty): add kitty keyboard protocol support --- modules/os/tty/README.org | 2 ++ modules/os/tty/config.el | 4 ++++ modules/os/tty/packages.el | 2 ++ 3 files changed, 8 insertions(+) diff --git a/modules/os/tty/README.org b/modules/os/tty/README.org index 6d210c05b..c952d2e18 100644 --- a/modules/os/tty/README.org +++ b/modules/os/tty/README.org @@ -11,6 +11,7 @@ This module configures Emacs for use in the terminal, by providing: - Cursor-shape changing across evil states (requires a terminal that supports it). - Mouse support in the terminal. +- Support for the [[https://sw.kovidgoyal.net/kitty/keyboard-protocol/][Kitty keyboard protocol]] in supported terminals. ** Maintainers /This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]] @@ -25,6 +26,7 @@ This module configures Emacs for use in the terminal, by providing: ** Packages - [[doom-package:clipetty]] if [[doom-module:+osc]] - [[doom-package:evil-terminal-cursor-changer]] if [[doom-module::editor evil]] +- [[doom-package:kkp]] - [[doom-package:xclip]] unless [[doom-module:+osc]] ** Hacks diff --git a/modules/os/tty/config.el b/modules/os/tty/config.el index 444b4ba0d..8e4f0707f 100644 --- a/modules/os/tty/config.el +++ b/modules/os/tty/config.el @@ -42,3 +42,7 @@ ;; https://github.com/saitoha/mouseterm-plus/releases. That makes to support ;; VT's DECSCUSR sequence. (add-hook 'tty-setup-hook #'evil-terminal-cursor-changer-activate) + +;; Add support for the Kitty keyboard protocol. +(use-package! kkp + :hook (after-init . global-kkp-mode)) diff --git a/modules/os/tty/packages.el b/modules/os/tty/packages.el index 0156d38f2..74a3c5619 100644 --- a/modules/os/tty/packages.el +++ b/modules/os/tty/packages.el @@ -11,3 +11,5 @@ ;; NOTE Despite the evil-* prefix, evil-terminal-cursor-changer does not depend ;; on evil (anymore). (package! evil-terminal-cursor-changer :pin "2358f3e27d89128361cf80fcfa092fdfe5b52fd8") + +(package! kkp :pin "ed9214329f11b095fc7bad06feb329b9f232258d") From f90f1c212eeb9effdf5908fc2a0360980382588f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Aug 2024 17:23:43 -0400 Subject: [PATCH 06/10] refactor(tty): noop evil-terminal-cursor-changer if disabled --- modules/os/tty/config.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/os/tty/config.el b/modules/os/tty/config.el index 8e4f0707f..93cbc1a4f 100644 --- a/modules/os/tty/config.el +++ b/modules/os/tty/config.el @@ -41,7 +41,8 @@ ;; http://www.culater.net/software/SIMBL/SIMBL.php and ;; https://github.com/saitoha/mouseterm-plus/releases. That makes to support ;; VT's DECSCUSR sequence. -(add-hook 'tty-setup-hook #'evil-terminal-cursor-changer-activate) +(use-package! evil-terminal-cursor-changer + :hook (tty-setup . evil-terminal-cursor-changer-activate)) ;; Add support for the Kitty keyboard protocol. (use-package! kkp From a2814629a0f0a21214c532698dbd2e774012c0b4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Aug 2024 17:26:34 -0400 Subject: [PATCH 07/10] feat(bidi): add +bidi-*-font-scale vars Close: #7687 --- modules/input/bidi/README.org | 12 ++++++++++ modules/input/bidi/config.el | 41 +++++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/modules/input/bidi/README.org b/modules/input/bidi/README.org index 1cea6aeb5..572f017ea 100644 --- a/modules/input/bidi/README.org +++ b/modules/input/bidi/README.org @@ -39,6 +39,18 @@ It also provides easy font configuration for Hebrew and Arabic-derived scripts See [[Fonts]] for more information. If you use an RTL language that isn't covered by these characters, open an issue requesting support for it. +To resize fonts, don't include a ~:size~ parameter in ~+bidi-hebrew-font~ or +~+bidi-arabic-font~, set ~+bidi-hebrew-font-scale~ or ~+bidi-arabic-font-scale~ +instead, or add an entry to ~face-font-rescale-alist~ for your font. E.g. +#+begin_src emacs-lisp +;;; Add to $DOOMDIR/config.el +(setq +bidi-arabic-font-scale 1.5) +;; or +(setq +bidi-hebrew-font-scale 2.5) +;; or +(add-to-list 'face-font-rescale-alist '("DejaVu Sans" . 1.2)) +#+end_src + * Configuration ** Using ~+bidi-mode~ ~+bidi-mode~ is a local minor mode, meaning it has to be turned on a per-buffer diff --git a/modules/input/bidi/config.el b/modules/input/bidi/config.el index 1b91819a2..8673ac5ed 100644 --- a/modules/input/bidi/config.el +++ b/modules/input/bidi/config.el @@ -1,14 +1,16 @@ ;;; input/bidi/config.el -*- lexical-binding: t; -*- -(defvar +bidi-mode-map (make-sparse-keymap) - "Keymap for `+bidi-mode'.") - (defvar +bidi-hebrew-font (font-spec :family "DejaVu Sans") "Overriding font for hebrew script. Must be a `font-spec', 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!") +font to that size. It's rarely a good idea to do so! Set +`+bidi-hebrew-font-scale' to scale the font up or down.") + +(defcustom +bidi-hebrew-font-scale 1.0 + "What scale to display `+bidi-hebrew-font' at." + :type 'float) (defface +bidi-hebrew-face `((t :font ,+bidi-hebrew-font)) "") @@ -17,7 +19,12 @@ font to that size. It's rarely a good idea to do so!") Must be a `font-spec', 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!") +font to that size. It's rarely a good idea to do so! Set +`+bidi-arabic-font-scale' to scale the font up or down.") + +(defcustom +bidi-arabic-font-scale 1.0 + "What scale to display `+bidi-arabic-font' at." + :type 'float) (defface +bidi-arabic-face `((t :font ,+bidi-arabic-font)) "") @@ -51,7 +58,10 @@ Warning: do not change this if you are using `+bidi-global-mode'.'" (const :tag "Right to Left" right-to-left) (const :tag "Dynamic, according to paragraph text" nil))) -;;;###autoload + +(defvar +bidi-mode-map (make-sparse-keymap) + "Keymap for `+bidi-mode'.") + (define-minor-mode +bidi-mode "Minor mode for using bidirectional text in a buffer. @@ -85,9 +95,18 @@ easier." (define-globalized-minor-mode +bidi-global-mode +bidi-mode +bidi-mode) + (add-hook! 'after-setting-font-hook - (defun +bidi-set-fonts-h () - (set-fontset-font t 'hebrew +bidi-hebrew-font) - (set-fontset-font t 'arabic +bidi-arabic-font) - (set-face-font '+bidi-arabic-face +bidi-arabic-font) - (set-face-font '+bidi-hebrew-face +bidi-hebrew-font))) + (defun +bidi-init-fonts-h () + (when +bidi-hebrew-font + (set-fontset-font t 'hebrew +bidi-hebrew-font) + (set-face-font '+bidi-hebrew-face +bidi-hebrew-font) + (when (/= +bidi-hebrew-font-scale 1.0) + (setf (alist-get (font-get +bidi-hebrew-font :family) face-font-rescale-alist nil nil #'equal) + +bidi-hebrew-font-scale))) + (when +bidi-arabic-font + (set-fontset-font t 'arabic +bidi-arabic-font) + (set-face-font '+bidi-arabic-face +bidi-arabic-font) + (when (/= +bidi-arabic-font-scale 1.0) + (setf (alist-get (font-get +bidi-arabic-font :family) face-font-rescale-alist nil nil #'equal) + +bidi-arabic-font-scale))))) From db48f767b0c87fa75981f3aac29e2d1cab5a5104 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 23 Aug 2024 17:41:25 -0400 Subject: [PATCH 08/10] fix(bidi): fail gracefully if font is missing The module will now emit a warning instead of throwing an uncaught error (and thus stopping Emacs' startup process). Fix: #7202 --- modules/input/bidi/config.el | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/modules/input/bidi/config.el b/modules/input/bidi/config.el index 8673ac5ed..6c5ec39cf 100644 --- a/modules/input/bidi/config.el +++ b/modules/input/bidi/config.el @@ -96,17 +96,23 @@ easier." (define-globalized-minor-mode +bidi-global-mode +bidi-mode +bidi-mode) +(defun +bidi--set-font (name) + (when-let* ((font-name (format "+bidi-%s-font" name)) + (font-var (or (intern-soft font-name) (error "Invalid font: %s" name))) + (font (symbol-value font-var))) + (condition-case e + (let ((scale (symbol-value (intern (format "+bidi-%s-font-scale" name))))) + (set-fontset-font t 'hebrew font) + (set-face-font (intern (format "+bidi-%s-face" name)) font) + (when (/= scale 1.0) + (setf (alist-get (font-get font :family) face-font-rescale-alist nil nil #'equal) + scale))) + ('error + (if (string-prefix-p "Font not available" (error-message-string e)) + (warn "Missing font for `%s': %s" font-name (font-get font :family)) + (signal (car e) (cdr e))))))) + (add-hook! 'after-setting-font-hook (defun +bidi-init-fonts-h () - (when +bidi-hebrew-font - (set-fontset-font t 'hebrew +bidi-hebrew-font) - (set-face-font '+bidi-hebrew-face +bidi-hebrew-font) - (when (/= +bidi-hebrew-font-scale 1.0) - (setf (alist-get (font-get +bidi-hebrew-font :family) face-font-rescale-alist nil nil #'equal) - +bidi-hebrew-font-scale))) - (when +bidi-arabic-font - (set-fontset-font t 'arabic +bidi-arabic-font) - (set-face-font '+bidi-arabic-face +bidi-arabic-font) - (when (/= +bidi-arabic-font-scale 1.0) - (setf (alist-get (font-get +bidi-arabic-font :family) face-font-rescale-alist nil nil #'equal) - +bidi-arabic-font-scale))))) + (+bidi--set-font 'hebrew) + (+bidi--set-font 'arabic))) From 3ad8ecc063679b01032516a7315a32ca8f91fa41 Mon Sep 17 00:00:00 2001 From: Wang Kai Date: Fri, 12 Jul 2024 20:09:02 +0800 Subject: [PATCH 09/10] fix(vertico): orderless filtering The original implementation of `+vertico-orderless-dispatch` match pattern by prefix and suffix in pairs. In that case, '=&&' will go for branch `(string-suffix-p "&" pattern)`, not `(string-prefix-p "=" pattern)`, which fail to filter literal '&&'. We probably should match all prefixes first, then all suffixes. Just like orderless does. Ref: https://github.com/oantolin/orderless/blob/178b0c55f2cb49f27cd972f731ea45e5d3aea262/orderless.el#L159 --- modules/completion/vertico/config.el | 34 +++++++++++----------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/modules/completion/vertico/config.el b/modules/completion/vertico/config.el index 19469b810..3d54e81ca 100644 --- a/modules/completion/vertico/config.el +++ b/modules/completion/vertico/config.el @@ -74,30 +74,23 @@ orderless." (completion-styles +vertico-company-completion-styles)) (apply fn args))) + (setq orderless-affix-dispatch-alist + `((?! . ,#'orderless-without-literal) + (?& . ,#'orderless-annotation) + (?% . ,#'char-fold-to-regexp) + (?` . ,#'orderless-initialism) + (?= . ,#'orderless-literal) + (?^ . ,#'orderless-literal-prefix) + (?~ . ,#'orderless-flex))) + (defun +vertico-orderless-dispatch (pattern _index _total) (cond ;; Ensure $ works with Consult commands, which add disambiguation suffixes ((string-suffix-p "$" pattern) - `(orderless-regexp . ,(concat (substring pattern 0 -1) "[\x200000-\x300000]*$"))) - ;; Ignore single ! - ((string= "!" pattern) `(orderless-literal . "")) - ;; Without literal - ((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1))) - ;; Annotation - ((string-prefix-p "&" pattern) `(orderless-annotation . ,(substring pattern 1))) - ((string-suffix-p "&" pattern) `(orderless-annotation . ,(substring pattern 0 -1))) - ;; Character folding - ((string-prefix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 1))) - ((string-suffix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 0 -1))) - ;; Initialism matching - ((string-prefix-p "`" pattern) `(orderless-initialism . ,(substring pattern 1))) - ((string-suffix-p "`" pattern) `(orderless-initialism . ,(substring pattern 0 -1))) - ;; Literal matching - ((string-prefix-p "=" pattern) `(orderless-literal . ,(substring pattern 1))) - ((string-suffix-p "=" pattern) `(orderless-literal . ,(substring pattern 0 -1))) - ;; Flex matching - ((string-prefix-p "~" pattern) `(orderless-flex . ,(substring pattern 1))) - ((string-suffix-p "~" pattern) `(orderless-flex . ,(substring pattern 0 -1))))) + `(orderless-regexp . ,(concat (substring pattern 0 -1) "[\x200000-\x300000]*$"))))) + + (add-to-list 'orderless-style-dispatchers '+vertico-orderless-dispatch) + (add-to-list 'completion-styles-alist '(+vertico-basic-remote @@ -109,7 +102,6 @@ orderless." ;; note that despite override in the name orderless can still be used in ;; find-file etc. completion-category-overrides '((file (styles +vertico-basic-remote orderless partial-completion))) - orderless-style-dispatchers '(+vertico-orderless-dispatch) orderless-component-separator #'orderless-escapable-split-on-space) ;; ...otherwise find-file gets different highlighting than other commands (set-face-attribute 'completions-first-difference nil :inherit nil)) From 0c1c37ad875a15ce8dae628856770af15701a0cf Mon Sep 17 00:00:00 2001 From: Quentin Barbe Date: Fri, 23 Aug 2024 23:59:35 +0200 Subject: [PATCH 10/10] bump: evil-textobj-tree-sitter meain/evil-textobj-tree-sitter@a19ab9d89a00 -> meain/evil-textobj-tree-sitter@041fcb9fbb00 Fix: #8006 --- modules/tools/tree-sitter/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/tree-sitter/packages.el b/modules/tools/tree-sitter/packages.el index e9c03cc26..554a70253 100644 --- a/modules/tools/tree-sitter/packages.el +++ b/modules/tools/tree-sitter/packages.el @@ -7,4 +7,4 @@ (when (modulep! :editor evil +everywhere) (package! evil-textobj-tree-sitter - :pin "a19ab9d89a00f4a04420f9b5d61b66f04fea5261")) + :pin "041fcb9fbb00deac92a4e58b5fca03f7dc0a32e8"))