From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: New undo element (fun . args) Date: Sun, 30 Jan 2005 18:22:45 +0100 Message-ID: References: <87fz0jyn19.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1107107258 32069 80.91.229.6 (30 Jan 2005 17:47:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Jan 2005 17:47:38 +0000 (UTC) Cc: snogglethorpe@gmail.com, emacs-devel@gnu.org, rms@gnu.org, miles@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 30 18:47:31 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CvJAZ-0000CH-00 for ; Sun, 30 Jan 2005 18:47:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CvJNG-0003uI-VW for ged-emacs-devel@m.gmane.org; Sun, 30 Jan 2005 13:00:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CvJLX-0003ji-Ho for emacs-devel@gnu.org; Sun, 30 Jan 2005 12:58:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CvJLP-0003fb-F2 for emacs-devel@gnu.org; Sun, 30 Jan 2005 12:58:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CvJLM-0003YL-3Z for emacs-devel@gnu.org; Sun, 30 Jan 2005 12:58:40 -0500 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CvImd-0004jT-JH; Sun, 30 Jan 2005 12:22:47 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepc.post.tele.dk (Postfix) with SMTP id 06EE32628B8; Sun, 30 Jan 2005 18:22:44 +0100 (CET) Original-To: Stefan Monnier In-Reply-To: <87fz0jyn19.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 30 Jan 2005 10:07:22 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:32645 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32645 Stefan Monnier writes: >>> To fix both of these problems, I suggest to change the format to: >>> >>> (apply FUN ARGS BEG . END) > >> How about: > >> (apply FUN BEG END . ARGS) > >> Seems more natural... > > 100% agreement. I even suggest we pass the BEG and END args to FUN. > I.e. basically keep the current setup, except require the first 2 args to be > BEG and END. I was about to suggest that, but I couldn't quite understand the implications if BEG and END are modified in the undo-in-region undo list -- but probably it it the correct thing to do. However, it occurred to me that we need to record a value for the undo-delta of this undo entry if we want this to work with undo-in-region. So something like: (apply FUN BEG END DELTA . ARGS) seems to be needed. IIUC, the DELTA is the amount of data insert in or deleted from the region by this command (i.e. the number of bytes added to or subtracted from END). But I'm not into every detail of the undo-in-region, so someone who understands that code should comment on this, pls. Maybe if DELTA is nil, this entry should be ignored during undo-in-region (whatever the implications of that could be). -- Kim F. Storm http://www.cua.dk