Sneak `marginalia' into minibuffer looks instead of completion

This commit is contained in:
Gerard Vermeulen 2024-06-19 14:16:12 +02:00
parent a8be320f18
commit 138cf1bb9a

View File

@ -104,10 +104,10 @@ presentations.
The [[https://github.com/bdarcus/citar][Citar]] extension package provides quick filtering and selecting of 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 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 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]]
[[https://github.com/andras-simonyi/citeproc-el][CiteProc]] extension package provides [[https://citationstyles.org/][CSL: citation style language]] processing extension package provides [[https://citationstyles.org/][CSL: citation style language]] processing capabilities
capabilities to [[https://github.com/bdarcus/citar][Citar]] and [[https://orgmode.org/][Org Mode]]. A curated repository of CSL styles is the 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
[[https://github.com/citation-style-language/styles#readme][citation style language repository]]. 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 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 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)) (keymap-set dired-mode-map "E" #'dired-eww-open-file))
#+end_src #+end_src
* [[info:emacs#Completion Styles][Minibuffer completion styles (info)]] * [[info:emacs#Minibuffer][Minibuffer (info)]]
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: sec:minibuffer-completion-styles :CUSTOM_ID: sec:minibuffer-completion-styles
:END: :END:
Listing [[lst:set-minibuffer-options][set minibuffer options]] implements ideas of the post [[https://www.masteringemacs.org/article/understanding-minibuffer-completion][Understanding Listing [[lst:touch-minibuffer-look]] implements sets minibuffer options and enables
minibuffer completion]]. =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[Touch the =minibuffer= look]:
#+caption: Set =minibuffer= options. #+caption: Touch the =minibuffer= look.
#+name: lst:set-minibuffer-options #+name: lst:touch-minibuffer-look
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'minibuffer (with-eval-after-load 'minibuffer
;; https://www.masteringemacs.org/article/understanding-minibuffer-completion ;; https://www.masteringemacs.org/article/understanding-minibuffer-completion
(setopt (setopt
completion-category-overrides '((file (styles basic substring))) completion-category-overrides '((file (styles basic substring)))
completion-styles '(basic flex partial-completion substring))) completion-styles '(basic flex partial-completion substring)))
(when (ensure-package-installation 'marginalia)
(marginalia-mode +1))
#+end_src #+end_src
* [[info:elisp#Processes][Processes (info)]] * [[info:elisp#Processes][Processes (info)]]
@ -1306,11 +1312,10 @@ documentation.
:END: :END:
Completion YouTube links are [[https://cestlaz.github.io/post/using-emacs-80-vertico/][Using Vertico, Marginalia, Consult, and Embark]] and 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. 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. 2. [[info:company#Top][Company (info)]] to complete anything anywhere in Emacs.
3. [[info:company#Top][Company (info)]] to complete anything anywhere in Emacs. 3. [[info:consult#Top][Consult (info)]] for useful search and navigation commands.
4. [[info:consult#Top][Consult (info)]] for useful search and navigation commands.
** [[info:vertico#Top][Vertico (info)]] ** [[info:vertico#Top][Vertico (info)]]
:PROPERTIES: :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)}}} | | *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]] ** [[https://company-mode.github.io/][Company: a modular in-buffer completion framework for Emacs]]
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: sec:company-setup :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 [[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 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 support. [[https://github.com/bdarcus/citar][Citar]] in combination with [[https://github.com/minad/vertico][Vertico]] provides quick filtering and
filtering and selecting of bibliographic entries from the minibuffer as well as selecting of bibliographic entries from the minibuffer.
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 The article [[https://kristofferbalintona.me/posts/202206141852/][Citations in org-mode: Org-cite and Citar]] tries to walk you from
context (bibliography producer, text processor, text to product converter) to an understanding the general context (bibliography producer, text processor, text
Emacs setup. Listing [[lst:set-oc+citar-options]] shows the =oc= and =citar= setup to product converter) to an Emacs setup. Listing [[lst:set-oc+citar-options]] shows
with binding of {{{kbd(C-c b)}}} to src_emacs-lisp{(call-interactively the =oc= and =citar= setup with binding of {{{kbd(C-c b)}}} to
'org-cite-insert)} in =org-mode-map=. src_emacs-lisp{(call-interactively 'org-cite-insert)} in =org-mode-map=.
#+caption[Set =oc= and =citar= options]: #+caption[Set =oc= and =citar= options]:
#+caption: Set =oc= and =citar= options. #+caption: Set =oc= and =citar= options.