From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Martin Stjernholm Newsgroups: gmane.emacs.xemacs.beta,gmane.emacs.bugs Subject: expand-abbrev and markers Date: Tue, 26 Aug 2003 01:16:21 +0200 Sender: xemacs-beta-admin@xemacs.org Message-ID: <5bn0dxs4ze.fsf@lister.roxen.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1061853614 2322 80.91.224.253 (25 Aug 2003 23:20:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Aug 2003 23:20:14 +0000 (UTC) Original-X-From: xemacs-beta-admin@xemacs.org Tue Aug 26 01:19:43 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19rQch-0002oN-00 for ; Tue, 26 Aug 2003 01:19:43 +0200 Original-Received: from gwyn.tux.org ([199.184.165.135]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19rQiR-0005OE-00 for ; Tue, 26 Aug 2003 01:25:39 +0200 Original-Received: from gwyn.tux.org (localhost.localdomain [127.0.0.1]) by gwyn.tux.org (8.11.6p2/8.9.1) with ESMTP id h7PNH5125573; Mon, 25 Aug 2003 19:17:05 -0400 Original-Received: (from turnbull@localhost) by gwyn.tux.org (8.11.6p2/8.9.1) id h7PNGTI25316 for xemacs-beta-mailman@xemacs.org; Mon, 25 Aug 2003 19:16:29 -0400 Original-Received: (from mail@localhost) by gwyn.tux.org (8.11.6p2/8.9.1) id h7PNGS525305 for turnbull@tux.org; Mon, 25 Aug 2003 19:16:28 -0400 Original-Received: from mail.roxen.com (godzilla.roxen.com [194.52.182.190]) by gwyn.tux.org (8.11.6p2/8.9.1) with ESMTP id h7PNGR125298 for ; Mon, 25 Aug 2003 19:16:27 -0400 Original-Received: by mail.roxen.com (Postfix, from userid 52) id F107499F8; Tue, 26 Aug 2003 01:16:23 +0200 (MEST) Original-Received: from lister.roxen.com (lister.roxen.com [194.52.182.147]) by mail.roxen.com (Postfix) with ESMTP id 333CD99F5; Tue, 26 Aug 2003 01:16:20 +0200 (MEST) Original-Received: from mast by lister.roxen.com with local (Exim 3.36 #1 (Debian)) id 19rQZR-0004Hv-00; Tue, 26 Aug 2003 01:16:21 +0200 Original-To: bug-gnu-emacs@gnu.org, xemacs-beta@xemacs.org User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux) X-XEmacs-List: beta Errors-To: xemacs-beta-admin@xemacs.org X-BeenThere: xemacs-beta@xemacs.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: XEmacs Beta Testers List-Unsubscribe: , Xref: main.gmane.org gmane.emacs.xemacs.beta:11034 gmane.emacs.bugs:5635 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:5635 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.