From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Editing change groups Date: Sat, 10 Nov 2018 13:07:44 -0500 Message-ID: References: <87sh0an0wf.fsf@web.de> <87h8gpv8he.fsf@web.de> <87d0rclx4m.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541874140 21833 195.159.176.226 (10 Nov 2018 18:22:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2018 18:22:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 10 19:22:16 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gLXtd-0005S7-4J for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2018 19:22:13 +0100 Original-Received: from localhost ([::1]:39495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLXvj-00036j-KS for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2018 13:24:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLXsT-0007gM-32 for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 13:21:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gLXff-0000zp-Pd for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 13:08:20 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:57887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gLXff-0000tl-EG for help-gnu-emacs@gnu.org; Sat, 10 Nov 2018 13:07:47 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wAAI7jRu010040; Sat, 10 Nov 2018 13:07:45 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 70D76602FC; Sat, 10 Nov 2018 13:07:44 -0500 (EST) In-Reply-To: <87d0rclx4m.fsf@web.de> (Michael Heerdegen's message of "Sat, 10 Nov 2018 17:23:37 +0100") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6415=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6415> : inlines <6959> : streams <1803881> : uri <2747438> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118637 Archived-At: > My original example (now with the line you criticized removed): > > #+begin_src emacs-lisp > (defun my-test-change-groups () > (interactive) > (insert "0\n") > (let ((g (prepare-change-group))) > (activate-change-group g) > (insert "b\n") > (insert "c\n") > (cancel-change-group g))) > #+end_src > > and why it doesn't behave as I expect (I guess you can guess what I > expect). Oh, yes, it's a bug in the change-groups code: the undo entries for (insert "0\n"), (insert "b\n"), and (insert "c\n") are merged into a single entry in the undo log (as a form of optimization). The change-group code should prevent such a merge, e.g. by adding some dummy undo element which will work like a "fence". Can you file this as a proper bug report (and put me in X-Debbugs-Cc)? Stefan