Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use GNU Emacs, usually like emacs -nw which launches the terminal version (as opposed to the windowed GUI version).

I write school papers in LaTeX so I use flyspell-mode for spell-checking within emacs. This works fine in the GUI version, but in a terminal, I run into issues with the keystroke C-. (Ctrl-.). In a tty, this does nothing, and in terminator or gnome-terminal, this simply inputs a ".".

What can I do to make it do what it does in the windowed version (show spelling suggestions for a misspelled word)?

EDIT: In case this matters, I am using Ubuntu 12.04 with Emacs 23.3.1 (which I believe is default from the 12.04 repo).

share|improve this question
1  
Same here. Did you try Esc-x flyspell-mode? This works for me. –  MMA Feb 18 '13 at 4:55
    
Well, yes. I always start flyspell-mode with M-x, but ESC x does not seem to make a difference. –  cg505 Feb 18 '13 at 13:40
1  
Same here. However I found a default keybinding that works for both versions ESC-TAB. –  McNisse Mar 20 '13 at 20:36
    
Yeah, ESC TAB or M-TAB both work for me. Thanks for the tip @McNisse. –  cg505 Mar 20 '13 at 23:42
add comment

1 Answer

up vote 1 down vote accepted

It looks like the important part of this question was already answered in the comments, but to address the root cause in case you're curious, I think ctrl-. doesn't work in a terminal because of some limitations of terminal emulators. In a standard terminal, ctrl is defined to send the ASCII code of the key you press minus 64 (this is why ctrl-J (74) sends newline (10) and ctrl-I (73) sends tab (9), for example). Since the period's ASCII code is 46, subtracting 64 would give -18, which is invalid because it's negative and there are no negative ASCII codes and therefore nothing for emacs to receive and understand.

When you run emacs in windowed mode, the terminal emulator mechanism is bypassed and instead the more robust keyboard handling of X11 is used, which can handle more obscure keystrokes (rather than reducing each keystroke down to one ASCII character, the program receives the original key plus all applicable modifiers, separately). So it's probably impossible to make tty-based emacs handle ctrl-. unless you make custom modifications to your terminal emulator (and probably also emacs).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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