From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: pre-command-hook with input methods Date: Fri, 06 Feb 2015 10:17:55 -0500 Message-ID: References: <878ugcmqr6.fsf@newcastle.ac.uk> <87fvajb0vs.fsf@newcastle.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423235900 31290 80.91.229.3 (6 Feb 2015 15:18:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Feb 2015 15:18:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: phillip.lord@newcastle.ac.uk (Phillip Lord) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 06 16:18:19 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YJkfi-0004Fk-QV for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 16:18:18 +0100 Original-Received: from localhost ([::1]:48908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJkfi-0002qZ-4I for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 10:18:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJkfS-0002pd-G6 for emacs-devel@gnu.org; Fri, 06 Feb 2015 10:18:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJkfO-0002Wq-FJ for emacs-devel@gnu.org; Fri, 06 Feb 2015 10:18:02 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:33282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJkfO-0002Wm-9t for emacs-devel@gnu.org; Fri, 06 Feb 2015 10:17:58 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t16FHt0U008600; Fri, 6 Feb 2015 10:17:56 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id CAD8BFAD; Fri, 6 Feb 2015 10:17:55 -0500 (EST) In-Reply-To: <87fvajb0vs.fsf@newcastle.ac.uk> (Phillip Lord's message of "Fri, 06 Feb 2015 13:55:19 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5209=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5209> : inlines <2043> : streams <1385758> : uri <1848116> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182536 Archived-At: > Gave that a quick go. As far as I can see, after-insert-chunk-hook > runs after the input is complete. Hmm... > Likewise, b-c-f which only runs when the buffer has changed. No, it should run *before* the buffer is changed, and AFAIK the buffer *is* changed (by inserting an "a") when you hit the "a". this "a" will get removed later (after you hit the "b") before running the self-insert-command which will (re)do the insertion. Oh, wait, I see that quail-input-method starts by let-binding inhibit-modification-hooks, so indeed, before-change-functions won't be run. Hmm... of course, you can still try (add-function :before input-method-function ...) but since its default value is nil (i.e. incompatible with add-function), it'll be a bit more tricky (you'll need an :around advice, and you'll need to check the orig function (in case it's nil) before calling it). There's clearly room for improvement here. Stefan