From 138cf1bb9a08da6eca8ac977c3ff322e60528e37 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Wed, 19 Jun 2024 14:16:12 +0200 Subject: [PATCH] Sneak `marginalia' into minibuffer looks instead of completion --- README.org | 64 +++++++++++++++++++++++------------------------------- 1 file changed, 27 insertions(+), 37 deletions(-) diff --git a/README.org b/README.org index 78218ab..ed8d582 100644 --- a/README.org +++ b/README.org @@ -104,10 +104,10 @@ presentations. The [[https://github.com/bdarcus/citar][Citar]] extension package provides quick filtering and selecting of bibliographic entries, and the option to run different commands on those -selections. [[https://github.com/bdarcus/citar][Citar]] exploits the extension packages [[https://github.com/minad/vertico][Vertico]] and [[https://github.com/minad/marginalia][Marginalia]]. The -[[https://github.com/andras-simonyi/citeproc-el][CiteProc]] extension package provides [[https://citationstyles.org/][CSL: citation style language]] processing -capabilities to [[https://github.com/bdarcus/citar][Citar]] and [[https://orgmode.org/][Org Mode]]. A curated repository of CSL styles is the -[[https://github.com/citation-style-language/styles#readme][citation style language repository]]. +selections. [[https://github.com/bdarcus/citar][Citar]] exploits the extension package [[https://github.com/minad/vertico][Vertico]]. The [[https://github.com/andras-simonyi/citeproc-el][CiteProc]] +extension package provides [[https://citationstyles.org/][CSL: citation style language]] processing capabilities +to [[https://github.com/bdarcus/citar][Citar]] and [[https://orgmode.org/][Org Mode]]. A curated repository of CSL styles is the [[https://github.com/citation-style-language/styles#readme][citation style +language repository]]. The [[https://github.com/vedang/pdf-tools][PDF-Tools]] extension package renders [[https://en.wikipedia.org/wiki/PDF][PDF]] file with the possibility to annotate the file or to click on anchors in the [[https://en.wikipedia.org/wiki/PDF][PDF]] file that link back to the @@ -868,23 +868,29 @@ to open files with the [[https://en.wikipedia.org/wiki/Eww_(web_browser)][Emacs (keymap-set dired-mode-map "E" #'dired-eww-open-file)) #+end_src -* [[info:emacs#Completion Styles][Minibuffer completion styles (info)]] +* [[info:emacs#Minibuffer][Minibuffer (info)]] :PROPERTIES: :CUSTOM_ID: sec:minibuffer-completion-styles :END: -Listing [[lst:set-minibuffer-options][set minibuffer options]] implements ideas of the post [[https://www.masteringemacs.org/article/understanding-minibuffer-completion][Understanding -minibuffer completion]]. +Listing [[lst:touch-minibuffer-look]] implements sets minibuffer options and enables +=marginalia-mode= (after ensuring the installation of =marginalia=) which adds +extra information (for instance documentation strings to commands) to items in +the minibuffer. See [[info:emacs#Completion Styles][minibuffer completion styles (info)]] and [[https://www.masteringemacs.org/article/understanding-minibuffer-completion][Understanding +minibuffer completion]] for more information. -#+caption[Set =minibuffer= options]: -#+caption: Set =minibuffer= options. -#+name: lst:set-minibuffer-options +#+caption[Touch the =minibuffer= look]: +#+caption: Touch the =minibuffer= look. +#+name: lst:touch-minibuffer-look #+begin_src emacs-lisp -n :results silent (with-eval-after-load 'minibuffer ;; https://www.masteringemacs.org/article/understanding-minibuffer-completion (setopt completion-category-overrides '((file (styles basic substring))) completion-styles '(basic flex partial-completion substring))) + +(when (ensure-package-installation 'marginalia) + (marginalia-mode +1)) #+end_src * [[info:elisp#Processes][Processes (info)]] @@ -1306,11 +1312,10 @@ documentation. :END: Completion YouTube links are [[https://cestlaz.github.io/post/using-emacs-80-vertico/][Using Vertico, Marginalia, Consult, and Embark]] and -[[yt:fnE0lXoe7Y0][Emacs Completion Explained]]. This setup installs four Emacs packages: +[[yt:fnE0lXoe7Y0][Emacs Completion Explained]]. This setup installs three external Emacs packages: 1. [[info:vertico#Top][Vertico (info)]] for a performant and minimalistic vertical completion UI. -2. [[info:marginalia#Top][Marginalia (info)]] for rich annotations in the minibuffer. -3. [[info:company#Top][Company (info)]] to complete anything anywhere in Emacs. -4. [[info:consult#Top][Consult (info)]] for useful search and navigation commands. +2. [[info:company#Top][Company (info)]] to complete anything anywhere in Emacs. +3. [[info:consult#Top][Consult (info)]] for useful search and navigation commands. ** [[info:vertico#Top][Vertico (info)]] :PROPERTIES: @@ -1363,21 +1368,6 @@ NOTE: Play with =vertico-buffer-mode=, =vertico-flat-mode=, =vertico-grid-mode=, | *vertico-scroll-up* | *scroll-up-command* | {{{kbd(C-v)}}} | |--------------------------+------------------------------------+---------------------| -** [[info:marginalia#Top][Marginalia (info)]] -:PROPERTIES: -:CUSTOM_ID: sec:marginalia-configuration -:END: - -Listing [[lst:enable-marginalia-mode]] enables =marginalia-mode=. - -#+caption[Enable =marginalia-mode=]: -#+caption: Enable =marginalia-mode=. -#+name: lst:enable-marginalia-mode -#+begin_src emacs-lisp -n :results silent -(when (ensure-package-installation 'marginalia) - (marginalia-mode +1)) -#+end_src - ** [[https://company-mode.github.io/][Company: a modular in-buffer completion framework for Emacs]] :PROPERTIES: :CUSTOM_ID: sec:company-setup @@ -2497,14 +2487,14 @@ def __org_babel_python_format_value(result, result_file, result_params): [[https://github.com/bdarcus/citar][Citar]] is a completing-read front-end to browse and act on BibTeX, BibLaTeX, as well as CSL JSON bibliographic data with LaTeX, markdown, and org-cite editing -support. In combination with vertico and marginalia, [[https://github.com/bdarcus/citar][Citar]] provides quick -filtering and selecting of bibliographic entries from the minibuffer as well as -the option to run different commands on those selections. The article [[https://kristofferbalintona.me/posts/202206141852/][Citations -in org-mode: Org-cite and Citar]] tries to walk you from understanding the general -context (bibliography producer, text processor, text to product converter) to an -Emacs setup. Listing [[lst:set-oc+citar-options]] shows the =oc= and =citar= setup -with binding of {{{kbd(C-c b)}}} to src_emacs-lisp{(call-interactively -'org-cite-insert)} in =org-mode-map=. +support. [[https://github.com/bdarcus/citar][Citar]] in combination with [[https://github.com/minad/vertico][Vertico]] provides quick filtering and +selecting of bibliographic entries from the minibuffer. + +The article [[https://kristofferbalintona.me/posts/202206141852/][Citations in org-mode: Org-cite and Citar]] tries to walk you from +understanding the general context (bibliography producer, text processor, text +to product converter) to an Emacs setup. Listing [[lst:set-oc+citar-options]] shows +the =oc= and =citar= setup with binding of {{{kbd(C-c b)}}} to +src_emacs-lisp{(call-interactively 'org-cite-insert)} in =org-mode-map=. #+caption[Set =oc= and =citar= options]: #+caption: Set =oc= and =citar= options.