[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Let’s translate!
From: |
Meiyo Peng |
Subject: |
Re: Let’s translate! |
Date: |
Sat, 13 Apr 2019 17:46:18 +0800 |
Hi znavko,
address@hidden writes:
> I've found this emacs config (~/.emacs) in linux.org.ru, that makes workable
> emacs commands (such as C-c C-c) when keyboard layout is not English. It
> works for me in Russian layout, and Chinese too as I tried.
>
> ;;Make emacs commands work when keyboard layout is not English
> (defun reverse-input-method (input-method)
> "Build the reverse mapping of single letters from INPUT-METHOD."
> (interactive
> (list (read-input-method-name "Use input method (default current): ")))
> (if (and input-method (symbolp input-method))
> (setq input-method (symbol-name input-method)))
> (let ((current current-input-method)
> (modifiers '(nil (control) (meta) (control meta))))
> (when input-method
> (activate-input-method input-method))
> (when (and current-input-method quail-keyboard-layout)
> (dolist (map (cdr (quail-map)))
> (let* ((to (car map))
> (from (quail-get-translation
> (cadr map) (char-to-string to) 1)))
> (when (and (characterp from) (characterp to))
> (dolist (mod modifiers)
> (define-key local-function-key-map
> (vector (append mod (list from)))
> (vector (append mod (list to)))))))))
> (when input-method
> (activate-input-method current))))
>
> (defadvice read-passwd (around my-read-passwd act)
> (let ((local-function-key-map nil))
> ad-do-it))
>
> (reverse-input-method 'russian-computer)
>
>
> There are suggestions for emacs config to make po-mode by default and also
> ispell spellchecker in my blog:
> dev-znavko.pantheonsite.io
>
> Hope it helps!
Thank you for the trick. The default behavior of Emacs is indeed
annoying if a special input method is enabled. But I only enable
Chinese Input Method when I input Chinese characters. That's less than
1% of my time with Emacs. So I am OK with the default behavior.
--
Meiyo Peng
https://www.pengmeiyu.com/
- Re: [PATCH 1/2] bootstrap: Break automake dependency on generated files. (was Re: Let’s translate!), (continued)
- Re: [PATCH 1/2] bootstrap: Break automake dependency on generated files. (was Re: Let’s translate!), Ludovic Courtès, 2019/04/23
- Re: [PATCH 1/2] bootstrap: Break automake dependency on generated files. (was Re: Let’s translate!), Miguel, 2019/04/23
- Re: [PATCH 1/2] bootstrap: Break automake dependency on generated files. (was Re: Let’s translate!), Julien Lepiller, 2019/04/24
- Re: [PATCH 1/2] bootstrap: Break automake dependency on generated files. (was Re: Let’s translate!), Ludovic Courtès, 2019/04/25
- Re: [PATCH 1/2] bootstrap: Break automake dependency on generated files. (was Re: Let’s translate!), Julien Lepiller, 2019/04/25
- Re: [PATCH 1/2] bootstrap: Break automake dependency on generated files. (was Re: Let’s translate!), Ludovic Courtès, 2019/04/26
- Message not available
- Re: [PATCH 2/2] doc: Add Spanish translation. (was Re: Let’s translate!), Ludovic Courtès, 2019/04/23
- Re: Let’s translate!, znavko, 2019/04/13
- Re: Let’s translate!,
Meiyo Peng <=
- Re: Let’s translate!, Ludovic Courtès, 2019/04/15
Re: Let’s translate!, znavko, 2019/04/13
New template for 'guix-manual' made available, Translation Project Robot, 2019/04/24
New template for 'guix-manual' made available, Translation Project Robot, 2019/04/30