emacs-devel
[Top][All Lists]
Advanced

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

Re: Is there a sane way to type Hebrew with nikud with Emacs 25/Mac?


From: Juri Linkov
Subject: Re: Is there a sane way to type Hebrew with nikud with Emacs 25/Mac?
Date: Thu, 15 Dec 2016 00:05:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)

>> Give to this command the name of the Emacs input method
>> that works correctly for your keyboard
>
> so I don't see how this applies to the case I'm describing,
> that is, using the built-in input method (built into the OS)
> rather than Emacs's input method, not using any input method
> of Emacs's.  Can you help me understand?

Emacs doesn't know about key mappings of the OS built-in input method,
so one way to get some mappings is from the input methods in the
Quail package.  After you review and confirm that one of available
Quail input methods corresponds to your OS input method,
you can use it to create an inverse mapping.  So you only
get the information about key mappings from the input method,
not directly using it.

Have you tried the proposed command?  What happens?

> ----- Original message -----
> From: Juri Linkov <address@hidden>
> To: "Mark H. David" <address@hidden>
> Cc: Eli Zaretskii <address@hidden>, address@hidden, address@hidden
> Subject: Re: Is there a sane way to type Hebrew with nikud with Emacs 25/Mac?
> Date: Tue, 13 Dec 2016 23:27:15 +0200
>
> We already solved the same problem for Cyrillic:
> https://debbugs.gnu.org/9751#85
>
> You can use the same solution for Hebrew as well.
> Give to this command the name of the Emacs input method
> that works correctly for your keyboard, and it will create
> a reverse mapping converting all entered keys with modifiers
> to ASCII without the need to activate the Emacs input method:
>
> (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))))
>
> If a list of modifiers '(control) (meta) (control meta)' is not enough,
> then you can add more combinations of modifiers with:
>
> (defun powerset (S)
>     (let ((x (car S)))
>       (if (cdr S)
>           (let ((y (powerset (remove x S))))
>             (append (list (list x))
>                     (mapcar (lambda (e) (cons x e)) y)
>                     y))
>         (list (list x)))))
>
> and
>
> (powerset '(control meta super hyper))



reply via email to

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