LINUX.ORG.RU

Emacs. Смена раскладки

 , ,


0

3

В русской раскладке не реагирует на запросы команд. При попытке изменить способ ввода (input-mode) с помощью внутренней переключалки выдаёт следующее:

Quail package "russian-computer" can’t be activated
  because library "quail/cyrillic" is not in ‘load-path’.

The most common case is that you have not yet installed appropriate
libraries in LEIM (Libraries of Emacs Input Method) which is
distributed separately from Emacs.

LEIM is available from the same ftp directory as Emacs.

Что ему нужно?

GNU Emacs 25.0.92.1

Лично мне помогло добавление в конфиг вот этого колдунства.

;;Фикс для работы комбинаций клавиш на русской раскладке
(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)

najlus ★★★★★
()
Ответ на: комментарий от najlus

Пробовал и так (хотя вроде, для версии 24+ этого не требуется, насколько я понял), но на старте выдаёт:

Warning (initialization): An error occurred while loading ‘~/.emacs’:

error: Can’t use the Quail package ‘russian-computer’

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

Dreamdrawer
() автор топика
Ответ на: комментарий от najlus

Проблема решилась установкой пакета:

emacs-leim

(GNU Emacs Lisp code for international input methods​)

А прописывать вышеназванное колдунство (Фикс для работы комбинаций клавиш на русской раскладке) таки надо.

Dreamdrawer
() автор топика
Ответ на: комментарий от Dreamdrawer

Проблема решилась установкой пакета:
emacs-leim

Такого даже в сборке найти не могу. Видать мейнтейнеры арча без пакетов нужные файлы в комплект с емаксом положили.

najlus ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.