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
_______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel