When you hit Tab in M-x for auto completion, the buffer comes up with options as well as a hollow box cursor. Is that really required? I don't find it intuitive because I can't actually navigate in that buffer anyway and I usually hide all non selected window cursors using

(setq cursor-in-non-selected-windows nil)

Using cursor-in-non-selected-windows is the correct approach, but you can set its value locally in the completions buffer instead of globally so it doesn't affect all your other buffers.

The tab completion buffer is running the completions-list-mode major-mode so you can add a hook to completions-list-mode-hook to set the value locally like this:

(defun no-non-selected-cursor ()
  "Set ‘cursor-in-non-selected-windows’ to nil locally in the current buffer."
  (setq-local cursor-in-non-selected-windows nil))

(add-hook 'completion-list-mode-hook 'no-non-selected-cursor)
  • 1
    As the variable is buffer local, even setq would work, just that it needs to be setq'd in the hook. To globally set a buffer local var, setq-default would work. Jul 12 '15 at 14:10
  • Indeed, I just like to use setq-local to be as explicit as possible. Jul 12 '15 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.