Skip to content

Commit

Permalink
Fix void-variable hotfuzz--filtering-p
Browse files Browse the repository at this point in the history
The variable hotfuzz--filtering-p was set only in the case of
completion-all-completions and not completion-try-completion. (In the
latter case its actual value does not matter as
display-/cycle-sort-function are inapplicable.) This commit ensures
the variable is always initialized.

Fixes #21
  • Loading branch information
axelf4 committed Oct 22, 2024
1 parent e41827e commit 2a9d24c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hotfuzz.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Large values will decrease performance."
(defvar hotfuzz--d (make-vector hotfuzz--max-needle-len 0))
(defvar hotfuzz--bonus (make-vector hotfuzz--max-haystack-len 0))

(defvar hotfuzz--filtering-p)
(defvar hotfuzz--filtering-p nil)

(defconst hotfuzz--bonus-lut
(eval-when-compile
Expand Down Expand Up @@ -143,7 +143,7 @@ will lead to inaccuracies."
(concat "[^" s "]*" (regexp-quote s))))
needle "")))
(cons (concat "\\`" re) completion-regexp-list))))
(all (if (and (string= prefix "") (or (stringp (car-safe table)) (null table))
(all (if (and (string= prefix "") (stringp (car-safe table))
(not (or pred completion-regexp-list (string= needle ""))))
table (all-completions prefix table pred))))
;; `completion-pcm--all-completions' tests completion-regexp-list
Expand Down

0 comments on commit 2a9d24c

Please sign in to comment.