4

Specifically, I want to set overriding-terminal-local-map to nil in all terminals.

4
  • I must be misunderstanding the question: at creation it should already be nil, and at any given time, you should be able to (dolist (t (terminal-list)) ...) or (dolist (f (frame-list)) ...).
    – Stefan
    Commented Apr 15, 2015 at 1:33
  • It's nil at the start. Hydra sets it to non-nil for one terminal, then a user opens a new one with emacsclient -t. The new terminal has the map at nil, but the transient map pre-command-hook is still running. So there was a need to shut down the transient map on all terminals. And I did it with frame-list in the end.
    – abo-abo
    Commented Apr 15, 2015 at 6:26
  • Sounds like a bug that could affect set-transient-map as well, right?
    – Stefan
    Commented Apr 15, 2015 at 12:47
  • Theoretically, yes. The typical calls to set-transient-map, like universal-arg--more are harmless. The problem with the hydra was that it has a feature of disabling all commands that aren't in the map. So it became problematic when the map became nil in one frame after emacsclient -t.
    – abo-abo
    Commented Apr 15, 2015 at 12:54

1 Answer 1

6

I've had a similiar problem and found out after studying the sources of Evil that using the after-make-frame-functions hook comes close enough.

(defun my-terminal-local-map-override (&optional frame)
  (with-selected-frame frame
    (setq overriding-terminal-local-map nil)))

(add-hook 'after-make-frame-functions 'my-terminal-local-map-override)

For my specific usecase I needed to call the my-terminal-local-map-override function unconditionally additionally to that, so if it doesn't work for you in both Emacs and emacsclient, give that extra hack a try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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