Closed ned2 closed 8 years ago
My first guess would be that the terminal is probably intercepting the TAB key for its own completion operations. Is that possible?
I can see the TAB keys when I look at the output of view-lossage. Does this suggest maybe not?
On Mon, 8 Feb 2016 at 23:00 Artur Malabarba notifications@github.com wrote:
My first guess would be that the terminal is probably intercepting the TAB key for its own completion operations. Is that possible?
— Reply to this email directly or view it on GitHub https://github.com/Malabarba/latex-extra/issues/20#issuecomment-181336191 .
Ah, but if I run the command latex/hide-show
manually over a section it does fold/unfold. I'll dig around further.
So if I put (global-set-key (kbd "TAB") #'latex/hide-show)
in my init file, it works. I tried changing the line (define-key map [tab] #'latex/hide-show)
in latex-extra.el to use "TAB"
instead of [tab]
but no luck.
Hm. It might be that in the terminal, TAB gets translated to C-i or something.
When I run describe key in my windowed Emacs I get
TAB (translated from <tab>) runs the command latex/hide-show, which is
an interactive compiled Lisp function in `latex-extra.el'.
It is bound to TAB.
And in the terminal:
TAB runs the command indent-for-tab-command, which is an interactive
compiled Lisp function in `indent.el'.
It is bound to TAB.
Apparently on a tty, the TAB and C-i keys are not usually distinguished: https://www.emacswiki.org/emacs/TabKey
Based on the above, it seems like changing the binding in the latex-extra.el to use (kbd "TAB")
rather than [tab]
should fix the problem. Like so:
(define-key map (kbd "TAB") #'latex/hide-show)
But it doesn't. I wondered if it might have something to do with the order of bindings being set, so I tried adding this to my init and it does work:
(eval-after-load 'latex-extra
'(define-key latex-extra-mode-map (kbd "TAB") #'latex/hide-show))
I've pushed a fix that implements that keybind in a different way. Let me know if it solves your terminal problem.
Yep it does indeed. Thanks a bunch!
Shift-TAB works correctly to collapse all sections, however TAB on it's own over a section/chapter is not resulting in any folding for me. Works fine in a windowed Emacs.