diff options
author | Miha Rihtaršič <miha@kamnitnik.top> | 2021-11-11 06:16:52 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-11-11 06:16:52 +0100 |
commit | 0a93fb499b8885ffd87338f1ccc9cb5093f567c1 (patch) | |
tree | 338d2c4e903c5f9fe74af3dc0938ede8ac27d178 /lisp/progmodes/cc-styles.el | |
parent | 396355f46b964d6a63ced9fe48fb6c7fb43d8f06 (diff) | |
download | emacs-0a93fb499b8885ffd87338f1ccc9cb5093f567c1.tar.gz |
Set `minibuffer-completion-*` variables locally in more places
* lisp/calc/calc-store.el (calc-read-var-name):
* lisp/emacs-lisp/crm.el (completing-read-multiple):
* lisp/progmodes/cc-styles.el (c-read-offset):
* lisp/window.el (read-buffer-to-switch):
Set `minibuffer-completion-*` variables buffer-locally instead of
using a global let-binding (bug#48925).
Follow-up to commit
2021-05-01 "* lisp/minibuffer.el (completing-read-default): Fix bug#45474"
Diffstat (limited to 'lisp/progmodes/cc-styles.el')
-rw-r--r-- | lisp/progmodes/cc-styles.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index c6b6be5b399..4d518838d11 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -444,17 +444,19 @@ STYLE using `c-set-style' if the optional SET-P flag is non-nil." defstr)) (prompt (concat symname " offset " defstr)) (keymap (make-sparse-keymap)) - (minibuffer-completion-table obarray) - (minibuffer-completion-predicate 'fboundp) offset input) ;; In principle completing-read is used here, but SPC is unbound ;; to make it less annoying to enter lists. (set-keymap-parent keymap minibuffer-local-completion-map) (define-key keymap " " 'self-insert-command) (while (not offset) - (setq input (read-from-minibuffer prompt nil keymap t - 'c-read-offset-history - (format "%s" oldoff))) + (minibuffer-with-setup-hook + (lambda () + (setq-local minibuffer-completion-table obarray) + (setq-local minibuffer-completion-predicate 'fboundp)) + (setq input (read-from-minibuffer prompt nil keymap t + 'c-read-offset-history + (format "%s" oldoff)))) (if (c-valid-offset input) (setq offset input) ;; error, but don't signal one, keep trying |