From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel 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 Organization: LINKOV.NET Message-ID: <87d1gvh639.fsf@mail.linkov.net> References: <1481056342.3486002.810530185.08361AFB@webmail.messagingengine.com> <1481151750.3863289.811957801.45609D8B@webmail.messagingengine.com> <83h96fhysl.fsf@gnu.org> <1481576998.3109775.816718105.3FD7FFFA@webmail.messagingengine.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481664935 12175 195.159.176.226 (13 Dec 2016 21:35:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2016 21:35:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) Cc: Eli Zaretskii , rms@gnu.org, emacs-devel@gnu.org To: "Mark H. David" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 13 22:35:31 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGujR-0002Mb-PD for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2016 22:35:29 +0100 Original-Received: from localhost ([::1]:40775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGujV-0000ic-TJ for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2016 16:35:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGuj9-0000Y7-HD for emacs-devel@gnu.org; Tue, 13 Dec 2016 16:35:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGuj8-0005Nt-EB for emacs-devel@gnu.org; Tue, 13 Dec 2016 16:35:11 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:34208 helo=homiemail-a100.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cGuj6-0005JJ-Hg; Tue, 13 Dec 2016 16:35:08 -0500 Original-Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id 7A26231A073; Tue, 13 Dec 2016 13:35:00 -0800 (PST) Original-Received: from localhost.linkov.net (m77-218-55-160.cust.tele2.ee [77.218.55.160]) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPA id 3F6B931A061; Tue, 13 Dec 2016 13:34:59 -0800 (PST) In-Reply-To: <1481576998.3109775.816718105.3FD7FFFA@webmail.messagingengine.com> (Mark H. David's message of "Mon, 12 Dec 2016 13:09:58 -0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 69.163.253.7 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210415 Archived-At: > The goal of this exercise is to allow one to use the built-in input method > (here, Hebrew keyboard MacOS (or Windows or GNU/Linux)), without needing > Emacs's input methods. Nowadays, built-in input methods involve very little > setup work on all the platforms. And then you have a uniform way to enter your > text in many apps, e.g., firefox, chrome, safari, terminal, mail, what have you. > So, just want Emacs to behave like these apps. It kind of does, as far as > self-inserting characters are concerned, but having to switch back to US keyboard > just to type C-x, C-c, C-s, et al, is "insane". How to fix it? 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))