From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: Timing of input-method output Date: Thu, 28 Mar 2019 13:54:18 +0000 Message-ID: <878swzyuid.fsf@russet.org.uk> 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="131938"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 28 14:56:15 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 1h9VVu-000Xyv-Uf for ged-emacs-devel@m.gmane.org; Thu, 28 Mar 2019 14:56:15 +0100 Original-Received: from localhost ([127.0.0.1]:37017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9VVt-0001HN-V4 for ged-emacs-devel@m.gmane.org; Thu, 28 Mar 2019 09:56:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9VUv-0001DV-Eb for emacs-devel@gnu.org; Thu, 28 Mar 2019 09:55:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9VUn-0006tu-JK for emacs-devel@gnu.org; Thu, 28 Mar 2019 09:55:10 -0400 Original-Received: from cloud103.planethippo.com ([78.129.138.110]:41600) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h9VUn-0006iD-17 for emacs-devel@gnu.org; Thu, 28 Mar 2019 09:55:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1BO8x3w48Tne8CyVY+r5/nPCwghiQqo/MZb8CEZ/arE=; b=UOVTw1NimFutXDTz2uFLBuO7/ QZfZGl9NA1tIDPKapmar5lRp9gKlzxQMBywIyeYeCdxMonKe3FfXA4bjLFc50x2/w8p+aoK/irP9F Rxhyq5rx7dAyS25+QfLmsrFeAfJ8sOD2d5fDlLrwZdgM0a08nUH4lp1+ffL3GzhtX4VIEbQGOa7KY /q0ptTrkq04peHzCJaNOJfcY7rwlJdTKx8lJL/04otl5rAg6YbikWvQ6DA4mu4nsCRKK0K9V8LR7E WmPKspbfRBNprvhttZ6BygOVjxl0jeSaqJl64DiACBSsO+RgwWV8EhpdRXL9XSiefCKgHoBjPPMyd Hpx1Wqf8Q==; Original-Received: from janus-nat-128-240-225-124.ncl.ac.uk ([128.240.225.124]:59608 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1h9VU2-00050F-I3; Thu, 28 Mar 2019 13:54:18 +0000 In-Reply-To: (Stefan Monnier's message of "Tue, 26 Mar 2019 11:12:22 -0400") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 78.129.138.110 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:234799 Archived-At: Stefan Monnier writes: >> 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? I do not have a terribly principled answer to this; quail is complicated and has lots of edge cases that I do not understand. If I understand it correctly, I could equally have put this into quail-self-insert-command; but here it is right before the bit that the translation actually happens. >> 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. Yes, if you know what is causing the problem. But you are correct, it is escapable. > >> And, where do you think I should document it? Perhaps "Invoking the >> Input Method"; > > That's probably the best place. Will extend. Phil