From 950b806f796ad9b2df5d8e5cd1de33c29e88188f Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Tue, 18 Jun 2024 15:19:29 +0200 Subject: [PATCH] Zap the orderless `embark' family, tweak 'company', and clean up --- README.org | 87 +++++------------------------------------------------- 1 file changed, 7 insertions(+), 80 deletions(-) diff --git a/README.org b/README.org index 51c1c5f..e005d99 100644 --- a/README.org +++ b/README.org @@ -257,14 +257,10 @@ of [[info:emacs#Saving Customizations][saving customizations (info)]]. ;; Pin packages to GNU ELPA or to MELPA STABLE for info and/or stability. package-pinned-packages '((auctex . "gnu") (citar . "melpa-stable") - (citar-embark . "melpa-stable") (compat . "gnu") (consult . "gnu") (dash . "melpa-stable") (debbugs . "gnu") - (denote . "gnu") - (embark . "gnu") - (embark-consult . "gnu") (emms . "gnu") (engrave-faces . "gnu-devel") (f . "melpa-stable") @@ -1250,15 +1246,11 @@ sub makeglossaries { [[info:vertico#Top][Vertico (info)]] provides a performant and minimalistic vertical completion UI based on the default completion system and behaves therefore correctly under all circumstances. [[https://cestlaz.github.io/post/using-emacs-80-vertico/][Using Vertico, Marginalia, Consult, and Embark]] links to a video -demonstration. Vertico integrates well with fully supported complementary -packages to enrich the completion UI: -1. [[info:embark#Top][Embark (info)]] for minibuffer actions with context menus, -2. [[info:marginalia#Top][Marginalia (info)]] for rich annotations in the minibuffer, and -3. [[info:consult#Top][Consult (info)]] for useful search and navigation commands, -where the order is that of [[https://github.com/bdarcus/citar#installation][enhancing citar's experience]] and the configuration -steps below. +demonstration. This setup completes Vertico with: +1. [[info:marginalia#Top][Marginalia (info)]] for rich annotations in the minibuffer. +2. [[info:consult#Top][Consult (info)]] for useful search and navigation commands. -Finally, [[https://company-mode.github.io/][company: a modular complete-anything framework for Emacs]] provides +Finally, [[https://company-mode.github.io/][Company: a modular complete-anything framework for Emacs]] can provide completion in any buffer. ** [[info:vertico#Top][Vertico (info)]] @@ -1336,64 +1328,6 @@ documentation. | vertico-scroll-up | scroll-up-command | {{{kbd(C-v)}}} | |-------------------------------+----------------------------------+---------------------| -** [[info:orderless#Top][Orderless (info)]] :noexport: -:PROPERTIES: -:CUSTOM_ID: sec:orderless-configuration -:header-args:emacs-lisp: :tangle no -:END: - - Listing [[lst:configure-orderless]] configures [[info:orderless#Company][orderless for company (info)]]. Note: -*Python editing is orders of magnitude faster after removal of Orderless*. - -#+caption[Configure =orderless=]: -#+caption: Configure =orderless=. -#+name: lst:configure-orderless -#+begin_src emacs-lisp -n :results silent -(when (ensure-package-installation 'marginalia) - (with-eval-after-load 'orderless - (setopt orderless-component-separator " +") - - (defun just-one-face (fn &rest args) - (let ((orderless-match-faces [completions-common-part])) - (apply fn args))) - - (advice-add 'company-capf--candidates :around #'just-one-face))) -#+end_src - -** [[info:embark#Top][Embark (info)]] -:PROPERTIES: -:CUSTOM_ID: sec:embark-configuration -:END: - -Listing [[lst:bind-embark-commands][bind =embark= commands]] binds =embark= commands to the global key map: -1. =embark-act= prompts the user for an action and performs it. GAV: ~org-mode~ - and ~embark~ do not play together nicely. -2. Except for highlighting of email and web URLs, =embark-dwim= englobes the - functionality of src_emacs-lisp[:results none]{(find-library "goto-addr")} - that activates mail and web URLs to turn them into clickable buttons. Since - =embark-dwim= acts on a superset of target types, it renders =goto-addr= - superfluous. See: - 1. [[info:emacs#Goto Address mode][Goto Address mode (info)]]. - 2. [[info:embark#The default action on a target][The default (embark-dwim) action on a target (info)]]. -3. =embark-bindings= allows to explore all current command key bindings in the - minibuffer. -4. The initialization of =prefix-help-command= enables minibuffer help after a - prefix key (for instance {{{kbd(C-x)}}} or {{{kbd(C-c)}}}) as typing - {{{kbd(C-x C-h)}}} or {{{kbd(C-c C-h)}}} shows. - -#+caption[Bind =embark= commands globally]: -#+caption: Bind =embark= commands globally. -#+name: lst:bind-embark-commands -#+begin_src emacs-lisp -n :results silent -;; GAV: `org-mode' and `embark' do not play together nicely. -;; GAV: `embark' is a dependency of `citar-embark' and `embark-consult'. -(when (ensure-package-installation 'embark-consult) - (keymap-global-set "C-," #'embark-act) - (keymap-global-set "C-:" #'embark-dwim) - (keymap-global-set "C-h B" #'embark-bindings) - (setq prefix-help-command #'embark-prefix-help-command)) -#+end_src - ** [[info:marginalia#Top][Marginalia (info)]] :PROPERTIES: :CUSTOM_ID: sec:marginalia-configuration @@ -1520,14 +1454,11 @@ configures =company= after ensuring the =company= installation. #+name: lst:setup-company #+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'company) - ;; https://github.com/purcell/emacs.d/issues/778 - (setopt company-transformers '(company-sort-by-occurrence)) - (add-hook 'LaTeX-mode-hook #'company-mode) - (add-hook 'org-mode-hook #'company-mode) + ;; GAV: `desktop' may enable `company-mode' for files it remembers. (add-hook 'emacs-lisp-mode-hook #'company-mode) (add-hook 'lisp-interaction-mode-hook #'company-mode) (add-hook 'lisp-mode-hook #'company-mode) - (add-hook 'python-mode-hook #'company-mode) + (add-hook 'python-mode-hook #'company-mode) ; works with `eglot'. (add-hook 'ielm-mode-hook #'company-mode) (add-hook 'sly-mrepl-mode-hook #'company-mode)) #+end_src @@ -2548,11 +2479,7 @@ processor, text to product converter) to an Emacs setup. Listing #+caption: Set =oc= and =citar= options. #+name: lst:set-oc+citar-options #+begin_src emacs-lisp -n :results silent -(when (ensure-package-installation 'citar 'citar-embark) - (with-eval-after-load 'embark - (when (fboundp 'citar-embark-mode) - (citar-embark-mode +1))) - +(when (ensure-package-installation 'citar) (with-eval-after-load 'oc (setopt org-cite-export-processors '((latex biblatex) (t csl))