all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* expand-abbrev and markers
@ 2003-08-25 23:16 Martin Stjernholm
  0 siblings, 0 replies; only message in thread
From: Martin Stjernholm @ 2003-08-25 23:16 UTC (permalink / raw)


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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-25 23:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-25 23:16 expand-abbrev and markers Martin Stjernholm

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.