Allow minibuffer completion on previous input
This commit is contained in:
parent
80dbda2308
commit
eb65da7d71
24
README.org
24
README.org
@ -536,6 +536,30 @@ niche than the five packages above.
|
||||
(add-hook hook #'company-mode))))
|
||||
#+end_src
|
||||
|
||||
** Minibuffer history completion
|
||||
|
||||
See [[https://lists.gnu.org/archive/html/emacs-devel/2021-12/msg00802.html][Juri Linkov (Emacs Developer mailing list)]] for how to allow completion on
|
||||
previous input in the minibuffer.
|
||||
|
||||
#+attr_latex: :options bgcolor=LightGoldenrodYellow
|
||||
#+begin_src emacs-lisp
|
||||
(defun minibuffer-setup-history-completions ()
|
||||
(unless (or minibuffer-completion-table minibuffer-completion-predicate)
|
||||
(setq-local minibuffer-completion-table
|
||||
(symbol-value minibuffer-history-variable))))
|
||||
|
||||
(add-hook 'minibuffer-setup-hook 'minibuffer-setup-history-completions)
|
||||
|
||||
;; Adapted from ‘minibuffer-complete’:
|
||||
(defun my-minibuffer-complete-history ()
|
||||
(interactive)
|
||||
(completion-in-region (minibuffer--completion-prompt-end) (point-max)
|
||||
(symbol-value minibuffer-history-variable)
|
||||
nil))
|
||||
|
||||
(define-key minibuffer-local-map [C-tab] 'my-minibuffer-complete-history)
|
||||
#+end_src
|
||||
|
||||
* Reading
|
||||
|
||||
** EPUB files
|
||||
|
Loading…
x
Reference in New Issue
Block a user