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: Timing of input-method output (was: [Emacs-diffs] master 7b31de4: Add hook for all events) Date: Sat, 02 Feb 2019 11:13:14 -0500 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> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="100980"; 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 Sun Feb 03 16:06:49 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 1gqJM8-000Q9I-QD for ged-emacs-devel@m.gmane.org; Sun, 03 Feb 2019 16:06:48 +0100 Original-Received: from localhost ([127.0.0.1]:56651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqJM7-0006Ft-HR for ged-emacs-devel@m.gmane.org; Sun, 03 Feb 2019 10:06:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqJLy-0006FB-QM for emacs-devel@gnu.org; Sun, 03 Feb 2019 10:06:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqJLy-0001RK-1i for emacs-devel@gnu.org; Sun, 03 Feb 2019 10:06:38 -0500 Original-Received: from pmta31.teksavvy.com ([76.10.157.38]:15247) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqJLx-0001QX-SJ for emacs-devel@gnu.org; Sun, 03 Feb 2019 10:06:37 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2GiCQA/A1dc/0Xhr2xkHAEBAQQBAQcEA?= =?us-ascii?q?QGBZYFbKYE3IRKIXIRHixIBggwTIgGXbYFnDYRmBAICgxEjOBIBAwEBAQEBAQI?= =?us-ascii?q?CAmkohUwBBAFWIwULPxIUGA2DDkuBegiqB4okjFiBf4ERgxKETgESAYV/ApEwk?= =?us-ascii?q?UIJgXOQYIoyiBKbcwyBXSJlcTMaCDCDKIJRjikkjQwPFwSCIwEB?= X-IPAS-Result: =?us-ascii?q?A2GiCQA/A1dc/0Xhr2xkHAEBAQQBAQcEAQGBZYFbKYE3IRK?= =?us-ascii?q?IXIRHixIBggwTIgGXbYFnDYRmBAICgxEjOBIBAwEBAQEBAQICAmkohUwBBAFWI?= =?us-ascii?q?wULPxIUGA2DDkuBegiqB4okjFiBf4ERgxKETgESAYV/ApEwkUIJgXOQYIoyiBK?= =?us-ascii?q?bcwyBXSJlcTMaCDCDKIJRjikkjQwPFwSCIwEB?= X-IronPort-AV: E=Sophos;i="5.56,556,1539662400"; d="scan'208";a="65622523" Original-Received: from 108-175-225-69.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([108.175.225.69]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2019 10:06:35 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id C08FEAE13D; Sat, 2 Feb 2019 11:13:14 -0500 (EST) In-Reply-To: <87munlumyn.fsf@russet.org.uk> (Phillip Lord's message of "Mon, 28 Jan 2019 09:54:08 +0000") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.38 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:232930 Archived-At: >> Hmm... this is a bummer (in some input methods, many/most chars are >> prefixes of something else). IIUC this is not a new problem introduced >> by the use of input-event-functions, tho, right? > My experience is that completion doesn't work when an input method is > half way through, although I only use simple input methods. Right: so this is not a new problem. > Anyway, I checked (should have done this before I sent the last email, > sorry). The buffer is not changed by an input method half way through > (or at least "before-change-function" is not called, which I am assuming > is the same thing). So, when the buffer appears to say "pizza_[`]", if > it does offer a completion at all, it's going to offer one based on > "pizz" because they "a" is not in the buffer. Actually, quail.el does insert the "a", but it does so only temporarily, within a with-silent-modification, and it removes it as soon as we know what will actually be the next result of the input method (to the user, that's basically when the underscore is (re)moved). IOW, the underlined text behaves more or less like it's not in the buffer (technically it is, but it's transient and the *-change-functions aren't notified). For latin-based input methods (especially postfix-style ones) where it's extremely frequent for the first char passed to an input method to end up passed through unmodified, it would make sense to try and change the behavior of quail so it really inserts the first char right away, even if it may later modify it because of some subsequent user input. E.g. currently, in latin-postfix methods, when I type Time0 Time1 ----- ----- e n the input looks (to the rest of Emacs) as if I had typed Time0 Time1 ----- ----- e n this is so that when I type Time0 Time1 ----- ----- e ' Emacs only sees Time0 Time1 ----- ----- =E9 but we it would make sense to try and make it behave such that an input lik= e: Time0 Time1 Time2 Time3 ----- ----- ----- ----- e n e ' results in the following (decoded) input events: Time0 Time1 Time2 Time3 ----- ----- ----- ----- e n e DEL =E9 [ More or less: the DEL there can't be right since the user can bind it to anything else, so we'd have to delete the previous char "manually" rather than by emitting a DEL event. ] This would be a pretty significant change in quail.el (which is likely to require experimentation before we can find something that works well), and is likely to only make sense in some input methods. I think it'd be nice for someone to play with such a quail variant (it's probably easiest to do it be adding a config var to quail.el to control that new behavior) to see if it can fly. Stefan