Valery V. Vorotyntsev (vorotylo) wrote in ru_emacs,
Valery V. Vorotyntsev

Fwd: Cue a key

Наиболее элегантное из виденных мной решений "Проблемы переключения раскладки" предложено Никитой Даниловым:

; Map Modifier-CyrillicLetter to the underlying Modifier-LatinLetter, so that
; control sequences can be used when keyboard mapping is changed outside of
; Emacs.
; For this to work correctly, .emacs must be encoded in the default coding
; system.
 (lambda (r e) ; R and E are matching Russian and English keysyms
   ; iterate over modifiers
   (mapc (lambda (mod)
    (define-key input-decode-map
      (vector (list mod r)) (vector (list mod e))))
  '(control meta super hyper))
   ; finally, if Russian key maps nowhere, remap it to the English key without
   ; any modifiers
   (define-key local-function-key-map (vector r) (vector e)))
  • Post a new comment


    default userpic

    Your reply will be screened