From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#18412: 24.3.93 regression: undo boundary inserted by delete-selection-mode (CUA) Date: Sun, 07 Sep 2014 22:04:29 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1410141927 7181 80.91.229.3 (8 Sep 2014 02:05:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Sep 2014 02:05:27 +0000 (UTC) Cc: 18412@debbugs.gnu.org To: David Reitter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 08 04:05:20 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XQoKW-0007Wt-FG for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Sep 2014 04:05:20 +0200 Original-Received: from localhost ([::1]:40232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQoKV-0004Ke-Sm for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Sep 2014 22:05:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQoKM-0004Jd-FF for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 22:05:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQoKF-0006ac-0U for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 22:05:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQoKE-0006Zi-U1 for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 22:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XQoKE-0008Qm-DY for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 22:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Sep 2014 02:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18412 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18412-submit@debbugs.gnu.org id=B18412.141014187832359 (code B ref 18412); Mon, 08 Sep 2014 02:05:02 +0000 Original-Received: (at 18412) by debbugs.gnu.org; 8 Sep 2014 02:04:38 +0000 Original-Received: from localhost ([127.0.0.1]:33079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQoJq-0008Pr-2T for submit@debbugs.gnu.org; Sun, 07 Sep 2014 22:04:38 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3292) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQoJo-0008Pb-14 for 18412@debbugs.gnu.org; Sun, 07 Sep 2014 22:04:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhAIAIDvNVNFpZEG/2dsb2JhbABZgwaDSghKvF2DDoEXF3SCJQEBAQECAQwXMyMFCwkCGgIYDgICFBgNJIgECJMDnBiifheBKY0eMweCb4FJBKkZgWqBcYFbIQ X-IPAS-Result: AhAIAIDvNVNFpZEG/2dsb2JhbABZgwaDSghKvF2DDoEXF3SCJQEBAQECAQwXMyMFCwkCGgIYDgICFBgNJIgECJMDnBiifheBKY0eMweCb4FJBKkZgWqBcYFbIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="89046904" Original-Received: from 69-165-145-6.dsl.teksavvy.com (HELO ceviche.home) ([69.165.145.6]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Sep 2014 22:04:29 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id C98D4660C4; Sun, 7 Sep 2014 22:04:29 -0400 (EDT) In-Reply-To: (David Reitter's message of "Fri, 5 Sep 2014 12:37:06 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93123 Archived-At: > This is a regression in the 24.4 pretest compared to 24.3. > M-x cua-mode > (enter and) select a word =E2=80=9Chello", e.g., via double-click > enter single char, e.g., =E2=80=9Cx=E2=80=9D > C-_ (undo) > In Emacs 24.3, the undo will restore =E2=80=9Chello=E2=80=9D. > In Emacs 24.3.93 pretest, the undo will only delete =E2=80=9Cx=E2=80=9D, = but not > restore =E2=80=9Chello=E2=80=9D. > An undo boundary is present in buffer-undo-list between the > delete-selection step and the insertion of =E2=80=9Cx=E2=80=9D. Indeed, that's a difference between delete-selection-mode and cua's earlier reimplementation of the feature. To the extent that noone complained about it for delete-selection-mode, I think this bug is not super-urgent to fix. IOW, we should take the time to think how to fix it right. > Looking at how self-insert-command deletes the undo boundary to merge > itself, we can either prevent the undo boundary from being inserted (I > couldn=E2=80=99t figure out where that happens), or pretend that the > delete-selection action was a self-insert-command. The patch below is > a proof of concept. The undo-boundary is added by command_loop_1 in keyboard.c just before calling command_execute. Maybe the right fix is to change it so it's push before running pre-command-hook? Of course, maybe an even better fix is to change delete-selection-mode so it doesn't rely on pre-command-hook. Stefan