Compare commits

...

3 Commits

1 changed files with 40 additions and 15 deletions

View File

@ -284,6 +284,7 @@ of [[info:emacs#Saving Customizations][saving customizations (info)]].
(consult . "gnu")
(dash . "melpa-stable")
(debbugs . "gnu")
(denote . "gnu")
(eldoc . "nongnu")
(embark . "gnu")
(embark-consult . "gnu")
@ -1004,9 +1005,19 @@ output to =stdout=.
:CUSTOM_ID: sec:help
:END:
Table [[tab:help-key-bindings]] lists a number of key bindings to start playing with
the help facilities of Emacs. Try {{{kbd(C-h o)}}} instead of {{{kbd(C-h f)}}}
or {{{kbd(C-h v)}}}.
Listing [[lst:setup-help]] enriches the help buffer. Table [[tab:help-key-bindings]]
lists a number of key bindings to start playing with the help facilities of
Emacs. Try {{{kbd(C-h o)}}} instead of {{{kbd(C-h f)}}} or {{{kbd(C-h v)}}}.
#+caption[Setup =help=]:
#+caption: Setup =help=.
#+name: lst:setup-help
#+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'help-fns
(add-hook 'help-fns-describe-function-functions
#'shortdoc-help-fns-examples-function)
(setopt help-enable-symbol-autoload t))
#+end_src
#+attr_latex: :booktabs yes :float table
#+caption[Help key bindings]:
@ -1023,18 +1034,6 @@ or {{{kbd(C-h v)}}}.
| info | help-map | {{{kbd(C-h i)}}} |
|------------------------------+----------+------------------|
#+begin_src emacs-lisp -n :exports none :results silent :tangle no
(defun org-key-binding-macro (cmd)
(let* ((sym (intern-soft cmd))
(keys (and (commandp sym) (where-is-internal sym nil 'first-only)))
(prefix (seq-take keys (1- (length keys))))
(keymap (key-binding prefix 'accept-default)))
(format "%s %s %s {{{kbd(%s)}}}"
cmd keymap (help--binding-locus keys nil) (key-description keys))))
(org-key-binding-macro 'consult-buffer)
#+end_src
** [[info:emacs#Name Help][Shortdoc-display-group (info)]]
:PROPERTIES:
:CUSTOM_ID: sec:shortdoc-display-group
@ -1561,6 +1560,9 @@ Consult usage tips are:
consult-mark)}}} or {{{kbd(M-g m)}}}. See [[https://arialdomartini.github.io//emacs-mark-ring][Emacs: Mark Ring]].
2. {{{kbd(M-x consult-org-heading)}}} or {{{kbd(C-c C-h)}}} is an alternative to
{{{kbd(M-x org-goto)}}} or {{{kbd(C-c C-j)}}}.
3. Listing [[lst:find-file-preview]] uses the internal functions
~consult--file-preview~ and ~consult--read~ to visit files with previewing
during selection. See: [[https://github.com/minad/consult/wiki][Consult Wiki]].
#+attr_latex: :booktabs yes :float table
#+caption[Configuration specific key bindings]:
@ -1646,6 +1648,29 @@ Consult usage tips are:
(keymap-global-set "M-y" #'consult-yank-pop))
#+end_src
#+caption[Implement =find-file= with previewing before selection]:
#+caption: Implement =find-file= with previewing before selection.
#+name: lst:find-file-preview
#+begin_src emacs-lisp -n :results silent
(defun consult-find-file-preview(cue &optional dir default mustmatch init pred)
(interactive)
(let ((default-directory (or dir default-directory))
(minibuffer-completing-file-name t))
(consult--read #'read-file-name-internal :state (consult--file-preview)
:prompt cue :initial init
:require-match mustmatch :predicate pred)))
(defun toggle-find-file-preview ()
"Toggle previewing when calling `find-file'."
(interactive)
(let ((done "Enabled"))
(if (eq read-file-name-function #'read-file-name-default)
(setq read-file-name-function #'consult-find-file-preview)
(setq read-file-name-function #'read-file-name-default
done "Disabled"))
(message "%s `find-file' previewing" done)))
#+end_src
** [[https://company-mode.github.io/][Company (info)]]
:PROPERTIES:
:CUSTOM_ID: sec:company-setup