[ prog / sol / mona ]

prog


Everything Emacsen

113 2021-08-09 16:05 *

>>110
I was able to trivially remove the minibuffer--require-match hack, the only reason I didn't see it earlier is because I've still yet to commit my self to fully understand the program, or even have a loose understanding for that matter. All that was necessary was declaring a local variable vertico--require-match and having this set based off the advice around completing-read-default and completing-read-multiple. I was hoping this would solve an issue I've noticed with tramp, but unfortunately it does not seem to.

+ (defvar-local vertico--require-match nil
+  "REQUIRE-MATCH parameter of `completing-read'.")

(defun vertico--setup (require-match)
  "Setup completion UI."
  (setq vertico--input t
        vertico--candidates-ov (make-overlay (point-max) (point-max) nil t t)
        vertico--count-ov (and vertico-count-format
                               (make-overlay (point-min) (point-min) nil t t)))
  (setq-local resize-mini-windows 'grow-only)
  (setq-local max-mini-window-height 1.0)
  (setq-local truncate-lines t)
  (setq-local completion-auto-help nil)
  (setq-local completion-show-inline-help nil)
+  (setq-local vertico--require-match require-match)
  (use-local-map vertico-map)
  ;; Use -90 to ensure that the exhibit hook runs early such that the
  ;; candidates are available for Consult preview. It works, but besides
  ;; that I'dont have a specific reason for this particular value.
  (add-hook 'post-command-hook #'vertico--exhibit -90 'local))

(defun vertico--advice (orig &rest args)
  "Advice for ORIG completion function, receiving ARGS."
-  (minibuffer-with-setup-hook #'vertico-setup (apply orig args))
+  (minibuffer-with-setup-hook
+      #'(lambda () (vertico--setup (nth 3 args)))
+    (apply orig args)))
217


VIP:

do not edit these