From c02193d4cb7ad240ae86c9842f7045136184f102 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Sun, 5 Dec 2021 16:40:20 +0100 Subject: [PATCH] Improve the Emacs server section --- README.org | 125 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 86 insertions(+), 39 deletions(-) diff --git a/README.org b/README.org index c430aed..0c7d347 100644 --- a/README.org +++ b/README.org @@ -425,16 +425,23 @@ may hang or die. [[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. Vertico integrates well with fully supported complementary +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:marginalia#Top][Marginalia (info)]] for rich annotations in the minibuffer. -2. [[info:consult#Top][Consult (info)]] for useful search and navigation commands. -3. [[info:embark#Top][Embark (info)]] for minibuffer actions with context menus. -4. [[info:orderless#Top][Orderless (info)]] for an advanced completion style. +1. [[info:orderless#Top][Orderless (info)]] for an advanced completion style, +2. [[info:embark#Top][Embark (info)]] for minibuffer actions with context menus, +3. [[info:marginalia#Top][Marginalia (info)]] for rich annotations in the minibuffer, and +4. [[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. -[[https://cestlaz.github.io/post/using-emacs-80-vertico/][Using Vertico, Marginalia, Consult, and Embark]] +Finally, [[https://company-mode.github.io/][company: a modular complete-anything framework for Emacs]] fills another +niche than the five packages above. -[[info:vertico#Configuration][Vertico configuration (link)]] +** [[info:vertico#Top][Vertico (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:vertico-configuration +:END: #+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp @@ -443,8 +450,43 @@ packages to enrich the completion UI: (vertico-mode +1))) #+end_src -[[info:marginalia#Top][Marginalia (info)]] adds marginalia (margin annotations) to minibuffer -completions. +** [[info:orderless#Top][Orderless (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:orderless-configuration +:END: + +#+begin_src emacs-lisp + (unless noninteractive + (when (fboundp 'orderless-filter) + (custom-set-variables + ;; https://github.com/purcell/emacs.d/issues/778 + '(completion-styles '(basic completion-partial orderless)) + '(completion-category-defaults nil) + '(completion-category-overrides + '((file (styles partial-completion))))) + (add-hook 'minibuffer-setup-hook + (defun my-on-minibuffer-setup-hook() + (setq-default completion-styles '(substring orderless)))))) +#+end_src + +** [[info:embark#Top][Embark (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:embark-configuration +:END: + +#+attr_latex: :options bgcolor=LightGoldenrodYellow +#+begin_src emacs-lisp + (unless noninteractive + (when (cl-every #'fboundp '(embark-act embark-bindings embark-dwim)) + (global-set-key (kbd "C-,") #'embark-act) + (global-set-key (kbd "C-:") #'embark-dwim) + (global-set-key (kbd "C-h B") #'embark-bindings))) +#+end_src + +** [[info:marginalia#Top][Marginalia (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:marginalia-configuration +:END: #+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp @@ -453,8 +495,10 @@ completions. (marginalia-mode +1))) #+end_src -Consult provides practical commands based on the Emacs completion -function. +** [[info:consult#Top][Consult (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:consult-configuration +:END: #+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp @@ -496,33 +540,10 @@ function. (fset 'multi-occur #'consult-multi-occur))) #+end_src - -#+attr_latex: :options bgcolor=LightGoldenrodYellow -#+begin_src emacs-lisp - (unless noninteractive - (when (cl-every #'fboundp '(embark-act embark-bindings embark-dwim)) - (global-set-key (kbd "C-,") #'embark-act) - (global-set-key (kbd "C-:") #'embark-dwim) - (global-set-key (kbd "C-h B") #'embark-bindings))) -#+end_src - -[[info:orderless#Top][Orderless (info)]] - -#+begin_src emacs-lisp - (unless noninteractive - (when (fboundp 'orderless-filter) - (custom-set-variables - ;; https://github.com/purcell/emacs.d/issues/778 - '(completion-styles '(basic completion-partial orderless)) - '(completion-category-defaults nil) - '(completion-category-overrides - '((file (styles partial-completion))))) - (add-hook 'minibuffer-setup-hook - (defun my-on-minibuffer-setup-hook() - (setq-default completion-styles '(substring orderless)))))) -#+end_src - -[[https://company-mode.github.io/][company-mode: modular in-buffer completion framework for Emacs]] +** [[https://company-mode.github.io/][Company: a modular complete anything framework for Emacs]] +:PROPERTIES: +:CUSTOM_ID: sec:company-configuration +:END: #+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp @@ -684,7 +705,33 @@ below corrects this by advising to override ~TeX-brace-count-line~ with ("v" . "verse")))) #+end_src +*** [[info:org#External Links][Export external links (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:export-external-links +:END: + +In order to export the [[info:org#External Links][info links (info)]] in this document to =html= correctly, +modify the constant ~org-info-other-documents~ defined in =ol-info.el=. + +Note: how to make it work without tangling? + +#+begin_src emacs-lisp + (add-hook + 'org-mode-hook + (lambda () + (when (boundp 'org-info-other-documents) + (dolist (recipe '(("consult" . "https://github.com/minad/consult") + ("embark" . "https://github.com/oantolin/embark") + ("marginalia" . "https://github.com/minad/marginalia") + ("orderless" . "https://github.com/oantolin/orderless") + ("vertico" . "https://github.com/minad/vertico"))) + (cl-pushnew recipe org-info-other-documents :test #'equal))))) +#+end_src + *** [[info:org#Citation export processors][Citation export processors (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:citation-export-processors +:END: #+attr_latex: :options bgcolor=LightGoldenrodYellow #+begin_src emacs-lisp @@ -1224,7 +1271,7 @@ instance those themes fail to display ~hl-line-mode~ with Emacs-27.2 on Darwin. ;;; init.el ends here #+end_src -* Local variables linking back to [[#sec:latex-compile-display-loop][LaTeX compile-display-loop]] +* Local variables linking back to [[#sec:latex-save-compile-display-loop][LaTeX save-compile-display-loop]] :PROPERTIES: :CUSTOM_ID: sec:local-variables :END: