Hello, Daimrod <daim...@gmail.com> writes:
> Thanks for investigating. I made some progress. Alas I didn't find a definitive answer yet. The problem is related to `quail-input-method', which let-binds `inhibit-modifications-hooks' to t. This is usually done around a function that modifies text properties in a buffer. However, in that case, it calls `quail-start-translation', `quail-self-insert-command', `quail-self-insert-command' and eventually `quail-update-translation', which modifies the _contents_ of the buffer (twice actually, with `quail-delete-region' at line 1555 in "quail.el.gz" and with `insert' at line 1579). Since these modifications happen when `inhibit-modifications-hooks' is non-nil, `after-change-functions' are never called, and the cache cannot be updated properly, ending in a corrupted state. There is a workaround for this: if `input-method-use-echo-area' is non-nil, these modifications happen in the minibuffer, and, thus, the buffer is not modified. I also tried to set `inhibit-modifications-hooks' to nil around the two locations where the buffer is modified (see above), but something odd happens. Indeed, in that case, `after-change-functions' are called once too many (i.e, the same buffer modification triggers these calls twice), corrupting again the buffer. Unfortunately, I have no explanation about this yet. Regards, -- Nicolas Goaziou