From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: C- key bindings not working on console Date: Mon, 27 Jan 2014 11:10:58 +0100 Message-ID: <87bnyxraz1.fsf@gmail.com> References: <87mwin0y6t.fsf@gmail.com> <8761patkpv.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1390817451 21288 80.91.229.3 (27 Jan 2014 10:10:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2014 10:10:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 27 11:10:58 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W7j9d-0005Pq-Sr for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 11:10:58 +0100 Original-Received: from localhost ([::1]:58659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7j9d-0000ST-Ev for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 05:10:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7j9L-0000SC-Re for help-gnu-emacs@gnu.org; Mon, 27 Jan 2014 05:10:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7j9F-0000NM-H2 for help-gnu-emacs@gnu.org; Mon, 27 Jan 2014 05:10:39 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:58564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7j9F-0000LD-6g for help-gnu-emacs@gnu.org; Mon, 27 Jan 2014 05:10:33 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W7j9D-0005GV-EF for help-gnu-emacs@gnu.org; Mon, 27 Jan 2014 11:10:31 +0100 Original-Received: from g231225027.adsl.alicedsl.de ([92.231.225.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jan 2014 11:10:31 +0100 Original-Received: from tjolitz by g231225027.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jan 2014 11:10:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 72 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231225027.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:C7rYZhoDkpd4uJSxMo6hQHLmPdM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95690 Archived-At: Emanuel Berg writes: > Thorsten Jolitz writes: > >>> That's got nothing to do with Emacs: your >>> text-terminal is the culprit. But don't worry: it's >>> not just your text-terminal, it's all(?) known >>> text-terminals. Of course, you can configure your >>> text-terminal (e.g. Linux's console) to send a >>> different escape sequence for those chars, and then >>> tell Emacs to recognize those sequence. >> >> I once investigated how to do that kind of thing, >> unfortunately I forgot most of it by now and will >> have relearn it. > > Linux console/VT/tty solution - tested on Debian. > > I didn't figure out this myself, someone told me, just > as I tell someone, now. But because this question comes > now and then, it would be good to get feedback from the > OP, because then I can make adjustments and, if all > good and well, use this text next time around as > well. Use, reuse, and not reinventing the wheel, > remember? OK: > > Put, in /etc/console-setup/remap.inc > > control keycode 11 = U+0110 > > 11 is 0, and you get that from 'showkey'. [If you use > tmux on top of the VT, use 'sudo showkey' (every time) > or 'chmod u+s /usr/bin/showkey' (once, then just > 'showkey'). Find out where 'showkey' is with 'type' in > bash, and 'type' or 'where' in zsh.] > > The Unicode (U+0110) is arbitrary in the sense it > doesn't matter what it is as long as it isn't in use > already, so make it exotic. > > Then: 'sudo loadkeys /etc/console-setup/remap.inc' > > Next, in an Emacs init file (.emacs, or if you want to > put such things somewhere else, and then `load-file' > from the main init file), in such a file, put: > > (define-key input-decode-map [?\u0110] [C-zero]) > > Now, hit C-0 and it should say " is undefined", > which means you can bind it to whatever: > > (global-set-key (kbd "") 'switch-buffer) > > Note: Because you want to load the modified keymap when > booting the system, but without having to give the sudo > password, one way to do that on Debian is to put > > loadkeys /etc/console-setup/remap.inc > /dev/null > > in /etc/rc.local Thanks for the recipe, I'll try that out when I have enough time. One annoying thing is that M- (i.e. Alt-) are at least partly (left-arrow, right-arrow) occupied by the system, in my case Archlinux, for switching between tty's. That is convenient, but for an Org-mode user these key-combos are much more important inside Org-mode than for tty-navigation. -- cheers, Thorsten