emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: called by a process filter?


From: Kevin Rodgers
Subject: Re: called by a process filter?
Date: Thu, 12 May 2005 10:25:39 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]