Move ensuring consult, embark, and marginalia to their sections

This commit is contained in:
Gerard Vermeulen 2022-07-14 12:44:28 +02:00
parent 0795f0e50a
commit 27b2dd133c
1 changed files with 22 additions and 18 deletions

View File

@ -226,11 +226,8 @@ The [[info:emacs#Init File][init file (info)]] does not load the ~custom-file~ a
'(async ; asynchroneous processing
auctex ; Aalborg University Center TeX
company ; complete anything
consult ; consult completing-read
embark ; act on any buffer selection
engrave-faces ; convert font-lock faces to text
magit ; Git Text-based User Interface
marginalia ; minibuffer margin notes
no-littering ; keep `user-emacs-directory' clean
orderless ; Emacs completion style
org ; thought organizer
@ -1095,15 +1092,16 @@ Listing [[lst:configure-orderless]] configures [[info:orderless#Company][orderle
#+caption: Configure =orderless=.
#+name: lst:configure-orderless
#+begin_src emacs-lisp
(with-eval-after-load 'orderless
(custom-set-variables
'(orderless-component-separator " +"))
(when (ensure-package-installation 'marginalia)
(with-eval-after-load 'orderless
(custom-set-variables
'(orderless-component-separator " +"))
(defun just-one-face (fn &rest args)
(let ((orderless-match-faces [completions-common-part]))
(apply fn args)))
(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))
(advice-add 'company-capf--candidates :around #'just-one-face)))
#+end_src
** [[info:embark#Top][Embark (info)]]
@ -1130,11 +1128,15 @@ Listing [[lst:configure-embark]] configures =embark= key bindings:
#+caption: Configure =embark=.
#+name: lst:configure-embark
#+begin_src emacs-lisp
(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)
(setq prefix-help-command #'embark-prefix-help-command))
(when (ensure-package-installation 'embark)
(when (fboundp 'embark-act)
(global-set-key (kbd "C-,") #'embark-act))
(when (fboundp 'embark-dwim)
(global-set-key (kbd "C-:") #'embark-dwim))
(when (fboundp 'embark-bindings)
(global-set-key (kbd "C-h B") #'embark-bindings))
(when (fboundp 'embark-prefix-help-command)
(setq prefix-help-command #'embark-prefix-help-command)))
#+end_src
** [[info:marginalia#Top][Marginalia (info)]]
@ -1148,7 +1150,8 @@ Listing [[lst:enable-marginalia-mode]] enables =marginalia-mode=.
#+caption: Enable =marginalia-mode=.
#+name: lst:enable-marginalia-mode
#+begin_src emacs-lisp
(when (fboundp 'marginalia-mode)
(when (and (ensure-package-installation 'marginalia)
(fboundp 'marginalia-mode))
(marginalia-mode +1))
#+end_src
@ -1157,7 +1160,8 @@ Listing [[lst:enable-marginalia-mode]] enables =marginalia-mode=.
:CUSTOM_ID: sec:consult-configuration
:END:
Listing [[lst:configure-consult]] configures =consult=.
Consult provides practical commands based on the Emacs minibuffer completion
function [[info:elisp#Minibuffer Completion][completing-read]]. Listing [[lst:configure-consult]] configures =consult=.
#+attr_latex: :booktabs yes :float table
#+caption[Configuration specific key bindings]:
@ -1211,7 +1215,7 @@ Listing [[lst:configure-consult]] configures =consult=.
#+caption: Configure =consult=.
#+name: lst:configure-consult
#+begin_src emacs-lisp
(when (fboundp 'consult-apropos)
(when (ensure-package-installation 'consult)
(custom-set-variables
'(consult-project-function #'(lambda (_) (vc-root-dir))))
;; C-c bindings (current-global-map)