help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C-<digit> key bindings not working on console


From: Tassilo Horn
Subject: Re: C-<digit> key bindings not working on console
Date: Thu, 23 Jan 2014 14:39:17 +0100
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Thorsten Jolitz <tjolitz@gmail.com> writes:

>> I can confirm that C-<digit> is not recognized on the linux console,
>> M-<digit> however is.  But I also don't know it it's a general
>> limitation.
>
> yes, M-<digit> works but I use that already to select windows with
> `window-numbering'

Me, too.  Or rather, I don't use window-numbering anymore because I had
some issue with it (I think with speedbar), but use this simple
replacement instead:

--8<---------------cut here---------------start------------->8---
(defun th/select-nth-window (n)
  "Selects the N-th window.
When called interactively, the N is provided as the last part of
the keybinding.  So you'd usually bind this function to
M-{1,..,9}, and then M-3 selects the third window."
  (interactive
   (list (let ((ev (event-basic-type last-command-event)))
           (string-to-number (char-to-string ev)))))
  (if (> n (length (window-list)))
      (user-error "There's no window %s." n)
    (select-window (window-at 0 0))
    (other-window (1- n))))

(dotimes (i 9)
  (global-set-key (kbd (format "M-%s" (1+ i))) 'th/select-nth-window))
--8<---------------cut here---------------end--------------->8---

> which is very convenient.

Yep.

> I always thought that the M- bindings are more problematic than the C-
> bindings on a console (in fact they are sometimes presented as
> alternatives for not working M- bindings iirc), so I'm a bit
> surprised.

Indeed.  Although I have to confess that I rarely use the console, both
because of not being able to use some keybindings that are deep in my
muscle memory and because of the frequently unreadable color choices
resulting from Emacs trying to make the best out of the definitions in
my angry fruit salad theme.

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]