minibuffer completion works again

This commit is contained in:
Joe Ardent 2025-01-03 14:26:14 -08:00
parent e55bdb1944
commit e2b05b7faa
5 changed files with 150 additions and 140 deletions

View file

@ -9,7 +9,7 @@
(setq-default fill-column 100) (setq-default fill-column 100)
(turn-on-auto-fill) (turn-on-auto-fill)
(add-hook 'prog-mode-hook (lambda () (auto-fill-mode -1))) (add-hook 'prog-mode-hook (lambda () (auto-fill-mode -1)))
(define-key icomplete-fido-mode-map (kbd "SPC") 'self-insert-command) ;;(define-key icomplete-fido-mode-map (kbd "SPC") 'self-insert-command)
(add-hook 'before-save-hook #'delete-trailing-whitespace) (add-hook 'before-save-hook #'delete-trailing-whitespace)
(fset 'yes-or-no-p 'y-or-n-p) (fset 'yes-or-no-p 'y-or-n-p)

View file

@ -1095,19 +1095,26 @@ in the function ~prot/enable-variable-pitch~.
:demand t :demand t
:config :config
;;;; General settings and common custom functions ;;;; General settings and common custom functions
(setq help-window-select t)
(setq next-error-recenter '(4)) ; center of the window
(setq find-library-include-other-files nil) ; Emacs 29
(setq tramp-connection-timeout (* 60 10)) ; seconds
(setq save-interprogram-paste-before-kill t)
(setq mode-require-final-newline t)
(setq-default truncate-partial-width-windows nil) (setq-default truncate-partial-width-windows nil)
(setq eval-expression-print-length nil) (setq column-number-mode t
(setq kill-do-not-save-duplicates t) debug-on-error t
(setq scroll-error-top-bottom t) echo-keystrokes-help t
(setq echo-keystrokes-help t) ; Emacs 30 epa-keys-select-method 'minibuffer
(setq epa-keys-select-method 'minibuffer) ; Emacs 30 eval-expression-print-length nil
(setq debug-on-error t)) find-file-visit-truename t
find-library-include-other-files nil
fringe-mode '(1 . 0)
global-auto-revert-mode t
global-display-line-numbers-mode nil
help-window-select t
inhibit-startup-message t
initial-scratch-message nil
kill-do-not-save-duplicates t
mode-require-final-newline t
next-error-recenter '(4) ; center of the window
save-interprogram-paste-before-kill t
scroll-error-top-bottom t
tramp-connection-timeout (* 60 10))) ; seconds
#+end_src #+end_src
** The =nebkor-essentials.el= section for fixing PATH on OSX (~exec-path-from-shell~) ** The =nebkor-essentials.el= section for fixing PATH on OSX (~exec-path-from-shell~)
@ -1777,10 +1784,10 @@ better to me.
#+end_quote #+end_quote
#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el"
;; (use-package minibuf-eldef (use-package minibuf-eldef
;; :ensure nil :ensure nil
;; :config :config
;; (setq minibuffer-default-prompt-format " [%s]")) ; Emacs 29 (setq minibuffer-default-prompt-format " [%s]"))
#+end_src #+end_src
** The =nebkor-completion.el= settings for common interactions ** The =nebkor-completion.el= settings for common interactions
@ -1841,42 +1848,42 @@ experience.
#+end_quote #+end_quote
#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el"
;; (use-package rfn-eshadow (use-package rfn-eshadow
;; :ensure nil :ensure nil
;; :hook (minibuffer-setup . cursor-intangible-mode) :hook (minibuffer-setup . cursor-intangible-mode)
;; :config :config
;; ;; Not everything here comes from rfn-eshadow.el, but this is fine. ;; Not everything here comes from rfn-eshadow.el, but this is fine.
;; (setq resize-mini-windows t) (setq resize-mini-windows t)
;; (setq read-answer-short t) ; also check `use-short-answers' for Emacs28 (setq read-answer-short t) ; also check `use-short-answers' for Emacs28
;; (setq echo-keystrokes 0.25) (setq echo-keystrokes 0.25)
;; (setq kill-ring-max 60) ; Keep it small (setq kill-ring-max 60) ; Keep it small
;; ;; Do not allow the cursor to move inside the minibuffer prompt. I ;; Do not allow the cursor to move inside the minibuffer prompt. I
;; ;; got this from the documentation of Daniel Mendler's Vertico ;; got this from the documentation of Daniel Mendler's Vertico
;; ;; package: <https://github.com/minad/vertico>. ;; package: <https://github.com/minad/vertico>.
;; (setq minibuffer-prompt-properties (setq minibuffer-prompt-properties
;; '(read-only t cursor-intangible t face minibuffer-prompt)) '(read-only t cursor-intangible t face minibuffer-prompt))
;; ;; Add prompt indicator to `completing-read-multiple'. We display ;; Add prompt indicator to `completing-read-multiple'. We display
;; ;; [`completing-read-multiple': <separator>], e.g., ;; [`completing-read-multiple': <separator>], e.g.,
;; ;; [`completing-read-multiple': ,] if the separator is a comma. This ;; [`completing-read-multiple': ,] if the separator is a comma. This
;; ;; is adapted from the README of the `vertico' package by Daniel ;; is adapted from the README of the `vertico' package by Daniel
;; ;; Mendler. I made some small tweaks to propertize the segments of ;; Mendler. I made some small tweaks to propertize the segments of
;; ;; the prompt. ;; the prompt.
;; (defun crm-indicator (args) (defun crm-indicator (args)
;; (cons (format "[`completing-read-multiple': %s] %s" (cons (format "[`completing-read-multiple': %s] %s"
;; (propertize (propertize
;; (replace-regexp-in-string (replace-regexp-in-string
;; "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
;; crm-separator) crm-separator)
;; 'face 'error) 'face 'error)
;; (car args)) (car args))
;; (cdr args))) (cdr args)))
;; (advice-add #'completing-read-multiple :filter-args #'crm-indicator) (advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; (file-name-shadow-mode 1)) (file-name-shadow-mode 1))
#+end_src #+end_src
** The =nebkor-completion.el= generic minibuffer UI settings ** The =nebkor-completion.el= generic minibuffer UI settings
@ -1895,14 +1902,14 @@ These are some settings for the default completion user interface.
(setq completions-format 'one-column) (setq completions-format 'one-column)
(setq completion-show-help nil) (setq completion-show-help nil)
(setq completion-auto-help 'always) (setq completion-auto-help 'always)
(setq completion-auto-select nil) (setq completion-auto-select t)
(setq completions-detailed t) (setq completions-detailed t)
(setq completion-show-inline-help nil) (setq completion-show-inline-help nil)
(setq completions-max-height 10) (setq completions-max-height 10)
(setq completions-header-format (propertize "%s candidates:\n" 'face 'bold-italic)) (setq completions-header-format (propertize "%s candidates:\n" 'face 'bold-italic))
(setq completions-highlight-face 'completions-highlight) (setq completions-highlight-face 'completions-highlight)
(setq minibuffer-completion-auto-choose t) (setq minibuffer-completion-auto-choose t)
(setq minibuffer-visible-completions t) ; Emacs 30 (setq minibuffer-visible-completions t)
(setq completions-sort 'historical)) (setq completions-sort 'historical))
#+end_src #+end_src
@ -2029,10 +2036,11 @@ Also see [[#h:567bb00f-1d82-4746-93e5-e0f60721728a][the =nebkor-completion.el= s
;; when it does not need to perform an indentation change. ;; when it does not need to perform an indentation change.
:bind (:map corfu-map ("<tab>" . corfu-complete)) :bind (:map corfu-map ("<tab>" . corfu-complete))
:config :config
(setq corfu-preview-current nil) (setq corfu-preview-current #'insert
(setq corfu-min-width 20) corfu-min-width 20
corfu-preselect 'prompt
(setq corfu-popupinfo-delay '(2.0 . 1.0)) corfu-on-exact-match nil
corfu-popupinfo-delay '(2.0 . 1.0))
(corfu-popupinfo-mode 1) ; shows documentation after `corfu-popupinfo-delay' (corfu-popupinfo-mode 1) ; shows documentation after `corfu-popupinfo-delay'
;; Sort by input history (no need to modify `corfu-sort-function'). ;; Sort by input history (no need to modify `corfu-sort-function').
@ -2243,12 +2251,12 @@ I use ~vertico-repeat~ to mimic the functionality that ~helm-resume~ would provi
(setq vertico-resize t) (setq vertico-resize t)
(setq vertico-cycle t) (setq vertico-cycle t)
;; (with-eval-after-load 'rfn-eshadow (with-eval-after-load 'rfn-eshadow
;; ;; This works with `file-name-shadow-mode' enabled. When you are in ;; This works with `file-name-shadow-mode' enabled. When you are in
;; ;; a sub-directory and use, say, `find-file' to go to your home '~/' ;; a sub-directory and use, say, `find-file' to go to your home '~/'
;; ;; or root '/' directory, Vertico will clear the old path to keep ;; or root '/' directory, Vertico will clear the old path to keep
;; ;; only your current input. ;; only your current input.
;; (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)) (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy))
) )
(use-package vertico-repeat (use-package vertico-repeat
@ -2260,12 +2268,12 @@ I use ~vertico-repeat~ to mimic the functionality that ~helm-resume~ would provi
("M-P" . vertico-repeat-previous)) ("M-P" . vertico-repeat-previous))
:hook (minibuffer-setup . vertico-repeat-save)) :hook (minibuffer-setup . vertico-repeat-save))
;; (use-package vertico-suspend (use-package vertico-suspend
;; :after vertico :after vertico
;; ;; Note: `enable-recursive-minibuffers' must be t ;; Note: `enable-recursive-minibuffers' must be t
;; :bind ( :map global-map :bind ( :map global-map
;; ("M-S" . vertico-suspend) ("M-S" . vertico-suspend)
;; ("C-x c b" . vertico-suspend))) ("C-x c b" . vertico-suspend)))
#+end_src #+end_src
** Finally, we provide the ~nebkor-completion.el~ module ** Finally, we provide the ~nebkor-completion.el~ module
@ -2277,7 +2285,6 @@ I use ~vertico-repeat~ to mimic the functionality that ~helm-resume~ would provi
(provide 'nebkor-completion) (provide 'nebkor-completion)
#+end_src #+end_src
* The =nebkor-functions.el= module * The =nebkor-functions.el= module
:PROPERTIES: :PROPERTIES:
:ID: 3b74f636-b722-4306-b053-e4e51796e7e6 :ID: 3b74f636-b722-4306-b053-e4e51796e7e6
@ -4897,9 +4904,7 @@ Use the entry point ~M-x dictionary-search~
(with-eval-after-load 'apheleia-formatters (with-eval-after-load 'apheleia-formatters
(push '(zprint . ("zprint")) apheleia-formatters)) (push '(zprint . ("zprint")) apheleia-formatters))
:hook :hook
(apheleia-mode . (lambda () (blackout 'apheleia-mode))) (apheleia-mode . (lambda () (blackout 'apheleia-mode))))
;;:blackout
)
#+end_src #+end_src
** The =nebkor-langs.el= settings for changing many things (~multiple-cursors~) ** The =nebkor-langs.el= settings for changing many things (~multiple-cursors~)
@ -6596,7 +6601,7 @@ figure it out.
(setq-default fill-column 100) (setq-default fill-column 100)
(turn-on-auto-fill) (turn-on-auto-fill)
(add-hook 'prog-mode-hook (lambda () (auto-fill-mode -1))) (add-hook 'prog-mode-hook (lambda () (auto-fill-mode -1)))
(define-key icomplete-fido-mode-map (kbd "SPC") 'self-insert-command) ;;(define-key icomplete-fido-mode-map (kbd "SPC") 'self-insert-command)
(add-hook 'before-save-hook #'delete-trailing-whitespace) (add-hook 'before-save-hook #'delete-trailing-whitespace)
(fset 'yes-or-no-p 'y-or-n-p) (fset 'yes-or-no-p 'y-or-n-p)

View file

@ -93,47 +93,47 @@
:config :config
(setq enable-recursive-minibuffers t)) (setq enable-recursive-minibuffers t))
;; (use-package minibuf-eldef (use-package minibuf-eldef
;; :ensure nil :ensure nil
;; :config :config
;; (setq minibuffer-default-prompt-format " [%s]")) ; Emacs 29 (setq minibuffer-default-prompt-format " [%s]"))
;; (use-package rfn-eshadow (use-package rfn-eshadow
;; :ensure nil :ensure nil
;; :hook (minibuffer-setup . cursor-intangible-mode) :hook (minibuffer-setup . cursor-intangible-mode)
;; :config :config
;; ;; Not everything here comes from rfn-eshadow.el, but this is fine. ;; Not everything here comes from rfn-eshadow.el, but this is fine.
;; (setq resize-mini-windows t) (setq resize-mini-windows t)
;; (setq read-answer-short t) ; also check `use-short-answers' for Emacs28 (setq read-answer-short t) ; also check `use-short-answers' for Emacs28
;; (setq echo-keystrokes 0.25) (setq echo-keystrokes 0.25)
;; (setq kill-ring-max 60) ; Keep it small (setq kill-ring-max 60) ; Keep it small
;; ;; Do not allow the cursor to move inside the minibuffer prompt. I ;; Do not allow the cursor to move inside the minibuffer prompt. I
;; ;; got this from the documentation of Daniel Mendler's Vertico ;; got this from the documentation of Daniel Mendler's Vertico
;; ;; package: <https://github.com/minad/vertico>. ;; package: <https://github.com/minad/vertico>.
;; (setq minibuffer-prompt-properties (setq minibuffer-prompt-properties
;; '(read-only t cursor-intangible t face minibuffer-prompt)) '(read-only t cursor-intangible t face minibuffer-prompt))
;; ;; Add prompt indicator to `completing-read-multiple'. We display ;; Add prompt indicator to `completing-read-multiple'. We display
;; ;; [`completing-read-multiple': <separator>], e.g., ;; [`completing-read-multiple': <separator>], e.g.,
;; ;; [`completing-read-multiple': ,] if the separator is a comma. This ;; [`completing-read-multiple': ,] if the separator is a comma. This
;; ;; is adapted from the README of the `vertico' package by Daniel ;; is adapted from the README of the `vertico' package by Daniel
;; ;; Mendler. I made some small tweaks to propertize the segments of ;; Mendler. I made some small tweaks to propertize the segments of
;; ;; the prompt. ;; the prompt.
;; (defun crm-indicator (args) (defun crm-indicator (args)
;; (cons (format "[`completing-read-multiple': %s] %s" (cons (format "[`completing-read-multiple': %s] %s"
;; (propertize (propertize
;; (replace-regexp-in-string (replace-regexp-in-string
;; "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
;; crm-separator) crm-separator)
;; 'face 'error) 'face 'error)
;; (car args)) (car args))
;; (cdr args))) (cdr args)))
;; (advice-add #'completing-read-multiple :filter-args #'crm-indicator) (advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; (file-name-shadow-mode 1)) (file-name-shadow-mode 1))
(use-package minibuffer (use-package minibuffer
:ensure nil :ensure nil
@ -142,14 +142,14 @@
(setq completions-format 'one-column) (setq completions-format 'one-column)
(setq completion-show-help nil) (setq completion-show-help nil)
(setq completion-auto-help 'always) (setq completion-auto-help 'always)
(setq completion-auto-select nil) (setq completion-auto-select t)
(setq completions-detailed t) (setq completions-detailed t)
(setq completion-show-inline-help nil) (setq completion-show-inline-help nil)
(setq completions-max-height 10) (setq completions-max-height 10)
(setq completions-header-format (propertize "%s candidates:\n" 'face 'bold-italic)) (setq completions-header-format (propertize "%s candidates:\n" 'face 'bold-italic))
(setq completions-highlight-face 'completions-highlight) (setq completions-highlight-face 'completions-highlight)
(setq minibuffer-completion-auto-choose t) (setq minibuffer-completion-auto-choose t)
(setq minibuffer-visible-completions t) ; Emacs 30 (setq minibuffer-visible-completions t)
(setq completions-sort 'historical)) (setq completions-sort 'historical))
;;;; `savehist' (minibuffer and related histories) ;;;; `savehist' (minibuffer and related histories)
@ -194,10 +194,11 @@
;; when it does not need to perform an indentation change. ;; when it does not need to perform an indentation change.
:bind (:map corfu-map ("<tab>" . corfu-complete)) :bind (:map corfu-map ("<tab>" . corfu-complete))
:config :config
(setq corfu-preview-current nil) (setq corfu-preview-current #'insert
(setq corfu-min-width 20) corfu-min-width 20
corfu-preselect 'prompt
(setq corfu-popupinfo-delay '(2.0 . 1.0)) corfu-on-exact-match nil
corfu-popupinfo-delay '(2.0 . 1.0))
(corfu-popupinfo-mode 1) ; shows documentation after `corfu-popupinfo-delay' (corfu-popupinfo-mode 1) ; shows documentation after `corfu-popupinfo-delay'
;; Sort by input history (no need to modify `corfu-sort-function'). ;; Sort by input history (no need to modify `corfu-sort-function').
@ -274,7 +275,6 @@
(setq consult-preview-key 'any) (setq consult-preview-key 'any)
;; the `imenu' extension is in its own file ;; the `imenu' extension is in its own file
(require 'consult-imenu) (require 'consult-imenu)
(consult-customize consult-imenu :initial (thing-at-point 'symbol))
(dolist (clj '(clojure-mode clojure-ts-mode)) (dolist (clj '(clojure-mode clojure-ts-mode))
(add-to-list 'consult-imenu-config (add-to-list 'consult-imenu-config
`(,clj :toplevel "Functions" `(,clj :toplevel "Functions"
@ -303,12 +303,12 @@
(setq vertico-resize t) (setq vertico-resize t)
(setq vertico-cycle t) (setq vertico-cycle t)
;; (with-eval-after-load 'rfn-eshadow (with-eval-after-load 'rfn-eshadow
;; ;; This works with `file-name-shadow-mode' enabled. When you are in ;; This works with `file-name-shadow-mode' enabled. When you are in
;; ;; a sub-directory and use, say, `find-file' to go to your home '~/' ;; a sub-directory and use, say, `find-file' to go to your home '~/'
;; ;; or root '/' directory, Vertico will clear the old path to keep ;; or root '/' directory, Vertico will clear the old path to keep
;; ;; only your current input. ;; only your current input.
;; (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)) (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy))
) )
(use-package vertico-repeat (use-package vertico-repeat
@ -320,11 +320,11 @@
("M-P" . vertico-repeat-previous)) ("M-P" . vertico-repeat-previous))
:hook (minibuffer-setup . vertico-repeat-save)) :hook (minibuffer-setup . vertico-repeat-save))
;; (use-package vertico-suspend (use-package vertico-suspend
;; :after vertico :after vertico
;; ;; Note: `enable-recursive-minibuffers' must be t ;; Note: `enable-recursive-minibuffers' must be t
;; :bind ( :map global-map :bind ( :map global-map
;; ("M-S" . vertico-suspend) ("M-S" . vertico-suspend)
;; ("C-x c b" . vertico-suspend))) ("C-x c b" . vertico-suspend)))
(provide 'nebkor-completion) (provide 'nebkor-completion)

View file

@ -4,19 +4,26 @@
:demand t :demand t
:config :config
;;;; General settings and common custom functions ;;;; General settings and common custom functions
(setq help-window-select t)
(setq next-error-recenter '(4)) ; center of the window
(setq find-library-include-other-files nil) ; Emacs 29
(setq tramp-connection-timeout (* 60 10)) ; seconds
(setq save-interprogram-paste-before-kill t)
(setq mode-require-final-newline t)
(setq-default truncate-partial-width-windows nil) (setq-default truncate-partial-width-windows nil)
(setq eval-expression-print-length nil) (setq column-number-mode t
(setq kill-do-not-save-duplicates t) debug-on-error t
(setq scroll-error-top-bottom t) echo-keystrokes-help t
(setq echo-keystrokes-help t) ; Emacs 30 epa-keys-select-method 'minibuffer
(setq epa-keys-select-method 'minibuffer) ; Emacs 30 eval-expression-print-length nil
(setq debug-on-error t)) find-file-visit-truename t
find-library-include-other-files nil
fringe-mode '(1 . 0)
global-auto-revert-mode t
global-display-line-numbers-mode nil
help-window-select t
inhibit-startup-message t
initial-scratch-message nil
kill-do-not-save-duplicates t
mode-require-final-newline t
next-error-recenter '(4) ; center of the window
save-interprogram-paste-before-kill t
scroll-error-top-bottom t
tramp-connection-timeout (* 60 10))) ; seconds
(use-package exec-path-from-shell (use-package exec-path-from-shell
:if (memq (window-system) '(mac ns)) :if (memq (window-system) '(mac ns))

View file

@ -155,9 +155,7 @@
(with-eval-after-load 'apheleia-formatters (with-eval-after-load 'apheleia-formatters
(push '(zprint . ("zprint")) apheleia-formatters)) (push '(zprint . ("zprint")) apheleia-formatters))
:hook :hook
(apheleia-mode . (lambda () (blackout 'apheleia-mode))) (apheleia-mode . (lambda () (blackout 'apheleia-mode))))
;;:blackout
)
(use-package multiple-cursors (use-package multiple-cursors
:ensure t :ensure t