From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: called by a process filter? Date: Thu, 12 May 2005 10:25:39 -0600 Message-ID: References: <87hdh81srh.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1115915594 24998 80.91.229.2 (12 May 2005 16:33:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 May 2005 16:33:14 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 12 18:33:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DWGbe-00011z-Vq for ged-emacs-devel@m.gmane.org; Thu, 12 May 2005 18:32:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DWGkd-0003QU-8m for ged-emacs-devel@m.gmane.org; Thu, 12 May 2005 12:41:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DWGg0-0000zn-Jf for emacs-devel@gnu.org; Thu, 12 May 2005 12:36:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DWGfx-0000y8-7o for emacs-devel@gnu.org; Thu, 12 May 2005 12:36:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DWGfw-0000wJ-O2 for emacs-devel@gnu.org; Thu, 12 May 2005 12:36:40 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DWGdO-0008PG-6U for emacs-devel@gnu.org; Thu, 12 May 2005 12:34:02 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DWGOy-0007Ox-2n for emacs-devel@gnu.org; Thu, 12 May 2005 18:19:08 +0200 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 May 2005 18:19:08 +0200 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 May 2005 18:19:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 31 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37044 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37044 Kim F. Storm wrote: > I would expect it to be buffer local, and as such, it would only be > triggered by filter functions that update that buffer. But when a filter function updates the buffer, this change function (whether global or buffer local) should do nothing. But even the change function were to do the same thing as when triggered by a self-inserting non-word character (which would probably be acceptable), the command loop variables and functions that it uses to determine that return misleading information (and I suspect they are the cause of the error that's been reported to me). > It does indeed seem odd that the after-change-function need to know > what command made the change... Yes, it's odd, but it is necessary because of quirks in Emacs' implementation: ;; One idea is to advise `self-insert-command' to `upcase' ;; `last-command-char' before it is run, but command_loop_1 optimizes ;; out the call to the Lisp binding with its C binding ;; (Fself_insert_command), which prevents any advice from being run. ;; ;; Another idea is to use a before-change-function to `upcase' ;; `last-command-char', but the change functions are called by ;; internal_self_insert, which has already had `last-command-char' ;; passed to it as a C function parameter by command_loop_1. -- Kevin Rodgers