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: function keys in macro Date: Mon, 25 Nov 2013 21:34:41 +0100 Organization: Aioe.org NNTP Server Message-ID: <87r4a4kyo5.fsf@nl106-137-194.student.uu.se> References: <871u27i26h.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1385412022 10293 80.91.229.3 (25 Nov 2013 20:40:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Nov 2013 20:40:22 +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 Nov 25 21:40:28 2013 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 1Vl2xG-0002Bq-HL for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Nov 2013 21:40:26 +0100 Original-Received: from localhost ([::1]:54937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl2xG-0007tC-4k for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Nov 2013 15:40:26 -0500 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: VVbyYd/iFZoeWNmD9i++cQ.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:XtypYibCiHGq0UgZBnzSU4bNSHo= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:202355 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:94625 Archived-At: Michael Heerdegen writes: > Have you bound M-f2 to any command? Well, I use Emacs in a Linux VT (tty1 to be precise) and M-F2 (or Alt-F2) will switch to tty2. In /etc/console-setup/remap.inc, with # J - Emacs to the left... alt keycode 36 = Decr_Console ctrll alt keycode 36 = Decr_Console # L - ... Linux VTs with tmux to the right alt keycode 38 = Incr_Console ctrll alt keycode 38 = Incr_Console I have bound those functions to Alt-J and Alt-K instead, but I haven't unset those old "short"cuts because I'd never use them for anything else. That's why, in Emacs (in tty1), I can't hit M-F2 and have Emacs process it, because the tty1 will intercept it and jump to tty2. But, I just tried Emacs in X and no: M-F2 is unbound. So, for everything to fall into place like the blocks of Tetris, if I put those keys in a macro, could I jump between the ttys programmatically with Elisp? I have tried the following shell/X tools to accomplish the same task: * chvt (doesn't work from Emacs, tmux, or X, but from an "empty" Linux VT, it works to everywhere including X) * xdotool (works from everywhere, but you cannot get from the "VT world" to X) * xmacroplay (works just like xdotool, which makes sense) So the best solution I found so far, which is 99% satisfactory, is remap from the VT world, and xdotool from X. In fact, I just got a new idea writing this, remap to some unused shortcut (or even Unicode char, if those could be put in macros), and then have a macro "type" that... stay tuned! -- Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu underground experts united: http://user.it.uu.se/~embe8573