From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Mark H. David" 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 15:41:09 -0800 Message-ID: <1481672469.224304.818155361.2AEAC78D@webmail.messagingengine.com> 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> <87d1gvh639.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481672514 29563 195.159.176.226 (13 Dec 2016 23:41:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2016 23:41:54 +0000 (UTC) Cc: Eli Zaretskii , rms@gnu.org, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 00:41:49 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 1cGwhh-0006Xo-8B for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2016 00:41:49 +0100 Original-Received: from localhost ([::1]:44625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGwhj-0002XI-So for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2016 18:41:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGwhC-0002S3-Rn for emacs-devel@gnu.org; Tue, 13 Dec 2016 18:41:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGwhB-000359-PY for emacs-devel@gnu.org; Tue, 13 Dec 2016 18:41:18 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42903) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cGwh7-00033j-1V; Tue, 13 Dec 2016 18:41:13 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4484520A9C; Tue, 13 Dec 2016 18:41:09 -0500 (EST) Original-Received: from web1 ([10.202.2.211]) by compute1.internal (MEProxy); Tue, 13 Dec 2016 18:41:09 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=smtpout; bh=px Emh5l2VESf5NYamy6kMVf+up4=; b=GrlL6EXsjot+uXY21GxZl4qQe8CQPlfKXq vG9f7jczPC2TaoGzar2tXP8iLPnZAPrlMTg0c/4sZjyKTAFbjXSdGYYcC7qrO18R ZBvgXt6g9K4fryppY92rGihBOZjs6sFkdOVyH9c4SjyUxUjG8HMxJD1Q7SMwGVor VADN9FYK4= X-ME-Sender: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 10DA3AA6C0; Tue, 13 Dec 2016 18:41:09 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface - ajax-9be5b4de In-Reply-To: <87d1gvh639.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 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:210420 Archived-At: But Juri, you say > 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? Thanks, Mark ----- Original message ----- From: Juri Linkov To: "Mark H. David" Cc: Eli Zaretskii , rms@gnu.org, emacs-devel@gnu.org 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 > 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))