From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Timing of input-method output Date: Tue, 26 Mar 2019 11:12:22 -0400 Message-ID: References: <20190122214637.25164.20429@vcs0.savannah.gnu.org> <20190122214639.B2E13203DD@vcs0.savannah.gnu.org> <40f2dac5-f342-b9f0-a792-796a6baf9a56@dancol.org> <87fttj55t8.fsf@russet.org.uk> <87k1iu2v8x.fsf@russet.org.uk> <87munlumyn.fsf@russet.org.uk> <875zu0edcf.fsf@russet.org.uk> <878syssgr6.fsf@russet.org.uk> <87ftsukmci.fsf@russet.org.uk> <87mun1w61s.fsf@russet.org.uk> <87va06bp7c.fsf@russet.org.uk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="141605"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: phillip.lord@russet.org.uk (Phillip Lord) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 26 16:12:39 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8nkl-000ahe-I8 for ged-emacs-devel@m.gmane.org; Tue, 26 Mar 2019 16:12:39 +0100 Original-Received: from localhost ([127.0.0.1]:33485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8nkk-0002eI-5x for ged-emacs-devel@m.gmane.org; Tue, 26 Mar 2019 11:12:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8nkb-0002du-Dc for emacs-devel@gnu.org; Tue, 26 Mar 2019 11:12:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8nka-0003Db-51 for emacs-devel@gnu.org; Tue, 26 Mar 2019 11:12:29 -0400 Original-Received: from mail01.iro.umontreal.ca ([132.204.25.201]:51806) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8nkZ-0003D1-SO for emacs-devel@gnu.org; Tue, 26 Mar 2019 11:12:28 -0400 Original-Received: from mail01.iro.umontreal.ca (mail01.iro.umontreal.ca [127.0.0.1]) by mail01.iro.umontreal.ca (Postfix) with ESMTP id F337C81D3F78 for ; Tue, 26 Mar 2019 11:12:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; h=content-type:content-type:mime-version:user-agent:in-reply-to :date:date:references:message-id:subject:subject:to:from:from; s=dkim; t=1553613144; x=1554477145; bh=1rISKCcXFKG8oaE3o6yuzJQR urdt4Z7a21h13dznqEA=; b=pMD9DLj3q356txedbOXqVuyuNuAAHv/tJX+C2ZdD ahZuBYxmWeccnYyAyG6CrGJuw5rfhSo0T5LZZq8mHJ1k1I6/4JQzjxEwIk+Y+vlT X0sDoqCYpJwhw7tJyrk99H/60P3f2KJNZ+BYpZ4b2/JxDaCHehGuTFVVVsniouJQ Zu/TxUezAC0snl1eb7vLIE36btAVepP9MZ7u4BxhaNs4g3B9wA7QujIb2IIqkK4V Sm1MWoNm40sBEuXzWXurME1AOcoD+1PIjylEQXh/0FsSUONFDY54nSPiXoH5zBUR pMWMNVgDts0/YcVj50J3Aj4gPP7CPHMwqOoG+FmJc7FoSA== X-Virus-Scanned: amavisd-new at iro.umontreal.ca Original-Received: from mail01.iro.umontreal.ca ([127.0.0.1]) by mail01.iro.umontreal.ca (mail01.iro.umontreal.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O8XIbB2FuWwD for ; Tue, 26 Mar 2019 11:12:24 -0400 (EDT) Original-Received: from pastel (75-119-242-252.dsl.teksavvy.com [75.119.242.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A6B8A81D3F58; Tue, 26 Mar 2019 11:12:23 -0400 (EDT) In-Reply-To: <87va06bp7c.fsf@russet.org.uk> (Phillip Lord's message of "Mon, 25 Mar 2019 21:48:23 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.201 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:234745 Archived-At: > I've done a bit more work on this and come up with a much simpler > solution which is specificially plumbed into quail. It looks like this: > > modified lisp/international/quail.el > @@ -59,6 +59,10 @@ quail > "Quail: multilingual input method." > :group 'leim) > > + > +(defvar quail-pre-translation-hook nil > + "Normal hook run before quail starts or updates a translation.") > + > ;; Buffer local variables > > (defvar quail-current-package nil > @@ -1548,6 +1552,7 @@ quail-update-translation > `quail-current-key'. If CONTROL-FLAG is nil, proceed the translation > with more keys." > (let ((func (quail-update-translation-function))) > + (run-hooks 'quail-pre-translation-hook) > (if func > (setq control-flag (funcall func control-flag)) > (cond ((numberp control-flag) This looks pretty good, but I'd like to better understand why this works well. I.e. how did you end up putting it there rather than elsewhere? > pre-command-hook is current run by "safe_run_hooks". Does > `quail-pre-translation-hook' need to be as well (in which case, it would > need uncovering in lisp)? I guess the counter here is that it's possible > to get out so long as you don't type certain characters, or you change > buffer. But, it leaves emacs fairly unusuable none the less. IIUC C-\ should get you out, so I don't think it's necessary to take any extra caution here. > And, where do you think I should document it? Perhaps "Invoking the > Input Method"; That's probably the best place. Stefan