unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* (insert ?\n) spuriously calls before-change-functions twice. Help!
@ 2010-01-05 11:09 Alan Mackenzie
  2010-01-05 15:22 ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Alan Mackenzie @ 2010-01-05 11:09 UTC (permalink / raw)
  To: emacs-devel

Hi, Emacs.

The following is a partial diagnosis of a bug reported by an AWK user.
(AWK Mode throws an error when require-final-newline is t).

In emacs -Q, in an AWK buffer, do M-: (insert ?\n).  The following
happens:
1. before-change-functions is invoked with arguments (beg end) (16 16).
2. The NL is inserted at position 16.
3. before-change-functions is invoked with arguments (16 17).
This all happens before after-change-functions is invoked.

However, M-: (insert "\n") just does the Right Thing.

This second invocation of before-change-functions is surely a bug.  I
can make this happen in a Fundamental Mode buffer in my normal Emacs
session, but not in Emacs -Q.

What is causing this spurious invocation?  Does anybody have any idea?
I've perused the C source for `insert', without finding anything.  Could
it be anything to do with text-properties?

Thanks for the help!

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-01-19 22:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05 11:09 (insert ?\n) spuriously calls before-change-functions twice. Help! Alan Mackenzie
2010-01-05 15:22 ` Stefan Monnier
2010-01-05 17:31   ` Alan Mackenzie
2010-01-05 19:52     ` Stefan Monnier
2010-01-06 13:05       ` Alan Mackenzie
2010-01-06 14:33         ` Stefan Monnier
2010-01-19 13:23       ` Alan Mackenzie
2010-01-19 15:11         ` Chong Yidong
2010-01-19 17:11           ` Alan Mackenzie
2010-01-19 18:02             ` Chong Yidong
2010-01-19 22:30               ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).