From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: C-= ? Date: Sun, 19 Jul 2015 10:10:50 +0200 Message-ID: <87mvysva7p.fsf@nl106-137-147.student.uu.se> References: <87oaj99v18.fsf@skimble.plus.com> <20150719011508.19549.09878E5B@ahiker.mooo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1437293565 1177 80.91.229.3 (19 Jul 2015 08:12:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jul 2015 08:12:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 19 10:12:36 2015 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 1ZGji8-0002DW-2K for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Jul 2015 10:12:36 +0200 Original-Received: from localhost ([::1]:50732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGji7-0005pe-8X for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Jul 2015 04:12:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGjhx-0005pZ-K1 for help-gnu-emacs@gnu.org; Sun, 19 Jul 2015 04:12:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGjhu-00035z-DC for help-gnu-emacs@gnu.org; Sun, 19 Jul 2015 04:12:25 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGjhu-00035v-5v for help-gnu-emacs@gnu.org; Sun, 19 Jul 2015 04:12:22 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZGjht-00028X-1d for help-gnu-emacs@gnu.org; Sun, 19 Jul 2015 10:12:21 +0200 Original-Received: from nl106-137-156.student.uu.se ([130.243.137.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jul 2015 10:12:21 +0200 Original-Received: from embe8573 by nl106-137-156.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jul 2015 10:12:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 137 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-156.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:lrqBeSFbTYfhtRPzNqjrL0HRAkI= 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:105842 Archived-At: Ian Zimmerman writes: > I'll just add that there's a good reason emacs > doesn't use this "key": there's no ASCII code > Control-=, so such a binding will not work in emacs > running on a text terminal, including an emulated > terminal like xterm. It can only work in a true GUI > emacs session where emacs knows about every physical > key press and release. It is possible to get C-= up and running in a couple of minutes in the ttys, which are as far from "true GUI" anyone will ever want to wander. I have described this process a couple of times, so I'll see if I can find a reference. If not, see if you can deduct it from examining these to files - one a config file for the tty, and one an Emacs init file. As ever, that is all you need. http://user.it.uu.se/~embe8573/conf/remap.inc http://user.it.uu.se/~embe8573/conf/emacs-init/console-keys.el ... Yes, here it is, with some modification to clarify the process. Originally written 2014-01-23. Seems like ages ago ... This file: http://user.it.uu.se/~embe8573/tty-emacs-keys.txt The Linux console: special shortcuts in Emacs --------------------------------------------- How to get special shortcuts (e.g., C-0) to work in a tty Emacs instance. This is the Linux console/VT/tty solution that works on Debian, and probably on many other distros as well with minor or none modifications. In the file /etc/console-setup/remap.inc put control keycode 11 = U+0110 11 is the keycode for the key '0', and you learn that from showkey(1). -*- Note: If you use tmux on top of the VT, you might get this error with showkey: Couldn't get a file descriptor referring to the console If so, do either $ sudo showkey # every time or $ chmod u+s /usr/bin/showkey # once If showkey is somewhere else than /usr/bin/showkey, do $ type showkey in bash or zsh to find out where. -*- Let's return to the line control keycode 11 = U+0110 This syntax reads: assign the shortcut C-0 (in Emacs notation; remember showkey has told us '0 = 11') so that when pressed, insert the char which has Unicode U+0110. (That char turns out a diamond in the ttys, so it must be something fancy that we will never need for anything else.) The Unicode (the particular code, i.e. U+0110) is arbitrary in the sense it doesn't matter what it is as long as the char isn't in use already. Make it exotic. When you have found one exotic char, it is easy to find more just by adding or subtracting one for each shortcut you add. It is the hexadecimal system. OK, now save the remap.inc file and use this zsh function (or a bash equivalent, or just type the command) to see that it works: lkeys () { loadkeys -q -c -s /etc/console-setup/remap.inc } Again, do the '+s' thing if you don't want to do sudo each time. After invoking lkeys, hit C-0 when in the shell. Now the diamond should appear! (The options to loadkeys(1) are not relevant to this tutorial, but I use it for other purposes as well. The man page tells more, as always.) 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), anyway in such a file, put: (define-key input-decode-map [?\u0110] [C-0]) Now, hit `C-0' and it should say: is undefined which means you can bind it to whatever: (global-set-key [C-0] 'switch-buffer) One last hint: Because you want to load the modified keymap each time when starting the system, but without having to input the sudo password, one way to do that (at least on Debian) is to put: loadkeys /etc/console-setup/remap.inc > /dev/null in /etc/rc.local Tutorial by: Emanuel Berg (embe8573@student.uu.se) Last modified: July 19, 2015 More cool stuff: http://user.it.uu.se/~embe8573 -- underground experts united http://user.it.uu.se/~embe8573