guix-devel
[Top][All Lists]
Advanced

[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/



reply via email to

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