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
    Apr 15 '15 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
    Apr 15 '15 at 6:26
  • Sounds like a bug that could affect set-transient-map as well, right?
    – Stefan
    Apr 15 '15 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
    Apr 15 '15 at 12:54
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, privacy policy and cookie policy

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