Commit c0c79b0b authored by João Távora's avatar João Távora
Browse files

Fido-mode: don't error if case-fold-search is globally nil

bug#67884

To prevent errors, the same case-fold-search setting used for
originally selecting the candidate should be used when scoring it.

* lisp/minibuffer.el (completion--flex-score): Fix
parent 0a57e1cd
Pipeline #27545 failed with stages
in 120 minutes and 46 seconds
......@@ -4059,15 +4059,16 @@ LEN is the length of the completion string."
(defun completion--flex-score (str re &optional dont-error)
"Compute flex score of completion STR based on RE.
If DONT-ERROR, just return nil if RE doesn't match STR."
(cond ((string-match re str)
(let* ((match-end (match-end 0))
(md (cddr
(setq
completion--flex-score-last-md
(match-data t completion--flex-score-last-md)))))
(completion--flex-score-1 md match-end (length str))))
((not dont-error)
(error "Internal error: %s does not match %s" re str))))
(let ((case-fold-search completion-ignore-case))
(cond ((string-match re str)
(let* ((match-end (match-end 0))
(md (cddr
(setq
completion--flex-score-last-md
(match-data t completion--flex-score-last-md)))))
(completion--flex-score-1 md match-end (length str))))
((not dont-error)
(error "Internal error: %s does not match %s" re str)))))
(defvar completion-pcm--regexp nil
"Regexp from PCM pattern in `completion-pcm--hilit-commonality'.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment