[Top][All Lists]

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

expand-abbrev and markers

From: Martin Stjernholm
Subject: expand-abbrev and markers
Date: Tue, 26 Aug 2003 01:16:21 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux)

This misfeature applies both to Emacs 21.3 and to XEmacs 21.4.13:

The function expand-abbrev first deletes the original abbrev and then
inserts the expansion. That causes problems with markers and text
properties in the vicinity of the abbrev, e.g. a "front sticky" marker
after the abbrev will end up before the expansion. It would be better
if the abbrev was replaced with the expansion in one logical step, so
that the positions before and after the abbrev/expansion never gets
mixed together.

This is especially confusing when the expansion is the same as the
abbrev, i.e. when the user only wants to get a call to a function from
the abbrev. That's possible to work around in Emacs, where the
replacement operation can be avoided completely by specifying a
non-string expansion, but not in XEmacs.

Technically the replacement would be accomplished by inserting the
expansion after the abbrev using insert-before-markers (or rather
insert-before-markers-and-inherit) and then delete the abbrev. That
would keep front and rear sticky markers (and text properties/extents)
apart at both endpoints. It seems like a good idea to me to even make
a standard function for such a replacement operation.

reply via email to

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