From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Braun =?UTF-8?Q?G=C3=A1bor?= Newsgroups: gmane.emacs.bugs Subject: bug#34405: 26.1; 2-line patch Date: Fri, 20 Dec 2019 09:11:28 +0100 Message-ID: <2345661.sRiDIh6uYh@gabor> References: <1631063.cd5q6Ms6ql@gabor> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="64027"; mail-complaints-to="usenet@blaine.gmane.org" To: 34405@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 20 09:12:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iiDOO-000GYw-Qs for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Dec 2019 09:12:12 +0100 Original-Received: from localhost ([::1]:51808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiDON-00075H-2b for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Dec 2019 03:12:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38479) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiDOG-00074w-Dr for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2019 03:12:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iiDOF-0000ig-6b for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2019 03:12:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iiDOE-0000ht-11 for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2019 03:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iiDOD-0003WM-Rq for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2019 03:12:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <1631063.cd5q6Ms6ql@gabor> Resent-From: Braun =?UTF-8?Q?G=C3=A1bor?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Dec 2019 08:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34405 X-GNU-PR-Package: emacs Original-Received: via spool by 34405-submit@debbugs.gnu.org id=B34405.157682950813515 (code B ref 34405); Fri, 20 Dec 2019 08:12:01 +0000 Original-Received: (at 34405) by debbugs.gnu.org; 20 Dec 2019 08:11:48 +0000 Original-Received: from localhost ([127.0.0.1]:45888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iiDO0-0003Vv-7F for submit@debbugs.gnu.org; Fri, 20 Dec 2019 03:11:48 -0500 Original-Received: from mail-wr1-f50.google.com ([209.85.221.50]:39334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iiDNx-0003Vh-Bk for 34405@debbugs.gnu.org; Fri, 20 Dec 2019 03:11:46 -0500 Original-Received: by mail-wr1-f50.google.com with SMTP id y11so8484962wrt.6 for <34405@debbugs.gnu.org>; Fri, 20 Dec 2019 00:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QgHcewBuWZJb3PmlKc0ic9toanrTUucjz5ILxvTo6kU=; b=tiPh4CpF4uBBrJx0Wq2nMOSZRUD920AGyEj6qMFM1ymj57ctzSH3gv/Bp0Mexx+9VF 1pxm5kPUpxB+nkbr8lfNSdPl72lP99pC2X6TU8ZsclzK0A+5lG+4BdTTT22v0u1FvNJs xfSIvK83WrmGI5rbyp84tmWoM3tGOgGT+tGVtFnanp3amEnZZAC8DiDyamo91PDR0x/u aVu7Xjc5ntxboysEThDFs0MIWmPAsQV7pjleN/vmU1sAvbMWhzVWBYeKWyaVqccx5zPy FapPwmTBUoX3UijlN6w3VZTVdp9UgTCGXqCn4xc3upCMhBegFB2tnI5evN79+xeT+kmt zvnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QgHcewBuWZJb3PmlKc0ic9toanrTUucjz5ILxvTo6kU=; b=aQlKu53us4Iym/mjaObTxXYS2gbr4xEJLVWEtSnBFvbqDXfKh56Ptq3YDS8lTjZp/K t4OhqSeWSsI+2mDplVhXLfYkzK3VLRe+dvmwMj/E3/GhLcBA6z3AtakPCWtWuJZ8QHyC NrjkLIWaUBBQv7D0XT8wnz1E3FHlGuYL3pBKx8V3vgz1OaN+jdodwcdeeMpYOdz8nyTc 2io6zt32KS8U3Mk6TEofb/gxzHkWyy2blpSqIykP9k4KbEqiWOZ8yuAb1C75vXGQigC9 7EPfacH6m2IoigthGMyWQVeiorvV7QmXsljHJyhczVvmjfdt5Y+eP9d6AdkBWRv+sFLI 2+Sg== X-Gm-Message-State: APjAAAVkrKumMYomoDw3iguMCY0o8oPFZXtUoB0mBwlg8Z95EDnZKXBk SqHAH5OY+h5XAYErOCeMQKCBrYVk X-Google-Smtp-Source: APXvYqyMiI0l8F9fswOj7lyEzU+5pK1lTCt+ADQJVP7GqnvbOguh+v/OgwH8VofuW0RKQc6TG3EOAA== X-Received: by 2002:adf:b605:: with SMTP id f5mr13364225wre.383.1576829499293; Fri, 20 Dec 2019 00:11:39 -0800 (PST) Original-Received: from gabor.localnet (254C4EEE.nat.pool.telekom.hu. [37.76.78.238]) by smtp.gmail.com with ESMTPSA id u13sm8848421wmd.36.2019.12.20.00.11.38 for <34405@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 00:11:38 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173572 Archived-At: Hi, Please find below a small patch to the problem, which works for me in=20 Emacs 26.1. Instead of calling undo-start, it binds pending-undo-list so that its=20 value is restored after canceling an atomic change group. Presumably this= =20 restoration is what the original code meant to do. (Feel free to reorder the bindings in let if you don't like pending-undo-list between old-car and old-cdr.) Best wishes, G=C3=A1bor =2D-- lisp/subr.el +++ lisp/subr.el @@ -2664,13 +2664,13 @@ cancel-change-group ;; the body of `atomic-change-group' all changes can be undone. (widen) (let ((old-car (car-safe elt)) + (pending-undo-list buffer-undo-list) (old-cdr (cdr-safe elt))) (unwind-protect (progn ;; Temporarily truncate the undo log at ELT. (when (consp elt) (setcar elt nil) (setcdr elt nil)) =2D (unless (eq last-command 'undo) (undo-start)) ;; Make sure there's no confusion. (when (and (consp elt) (not (eq elt (last pending-undo- list)))) (error "Undoing to some unrelated state"))