diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-14 12:43:34 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-14 12:45:48 +0200 |
| commit | b568f6c694cce547eb4ae615332d464c48e4be0e (patch) | |
| tree | a9eff354c29d533963e03945c20be91c085f1ac5 | |
| parent | 9365263d84a8e906537e3d4050c748327923b068 (diff) | |
Reset completion-regexp-list in cached table recomputation
Resetting `completion-regexp-list' is necessary since the candidate computation
could itself use `all-completions'. Ideally such usage of `all-completions'
would rebind `completion-regexp-list' to nil itself, but it is safer to ensure
this from outside.
| -rw-r--r-- | cape.el | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -240,9 +240,13 @@ still valid." (when (or (not valid) (not (or (string-match-p "\\s-" input) ;; Support Orderless (funcall valid input)))) - (pcase-let ((`(,new-valid . ,new-table) (funcall fun input)) - (throw-on-input nil)) ;; No interrupt during state update - (setq table new-table valid new-valid)))) + (let* (;; Reset in case `all-completions' is used inside FUN + completion-ignore-case completion-regexp-list + ;; Retrieve new state by calling FUN + (new (funcall fun input)) + ;; No interrupt during state update + throw-on-input) + (setq valid (car new) table (cdr new))))) (complete-with-action action table str pred))))) ;;;; Capfs @@ -855,7 +859,10 @@ completion table is refreshed on every input change." (let ((new-input (buffer-substring-no-properties beg end))) (unless (or (string-match-p "\\s-" new-input) ;; Support Orderless (funcall valid input new-input)) - (pcase (funcall capf) + (pcase + ;; Reset in case `all-completions' is used inside CAPF + (let (completion-ignore-case completion-regexp-list) + (funcall capf)) (`(,_beg ,_end ,new-table . ,new-plist) (let (throw-on-input) ;; No interrupt during state update (setf table new-table |
