From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] fix/undo-point-in-wrong-place 01beb39 2/2: Store value of point at beginning of last command. Date: Mon, 23 Nov 2015 12:27:27 -0500 Message-ID: References: <20151123171755.27551.5615@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448299675 7542 80.91.229.3 (23 Nov 2015 17:27:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Nov 2015 17:27:55 +0000 (UTC) Cc: Phillip Lord To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 23 18:27:40 2015 Return-path: Envelope-to: ged-emacs-devel@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 1a0utr-00073J-6z for ged-emacs-devel@m.gmane.org; Mon, 23 Nov 2015 18:27:35 +0100 Original-Received: from localhost ([::1]:33705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0utr-00059W-MZ for ged-emacs-devel@m.gmane.org; Mon, 23 Nov 2015 12:27:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0uto-00059R-PK for emacs-devel@gnu.org; Mon, 23 Nov 2015 12:27:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0utk-0004KJ-DQ for emacs-devel@gnu.org; Mon, 23 Nov 2015 12:27:32 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:25618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0utk-0004KA-90 for emacs-devel@gnu.org; Mon, 23 Nov 2015 12:27:28 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CsCwA731xV/yr292hcgxCEAsEMCYdLBAICgTw5FAEBAQEBAQGBCkEFg10BAQRWIxALNAcLFBgNiGPPIwEBAQcBAQEBHos6hQUHFoQXBYwwqFQjgjuBWyCCeAEBAQ X-IPAS-Result: A0CsCwA731xV/yr292hcgxCEAsEMCYdLBAICgTw5FAEBAQEBAQGBCkEFg10BAQRWIxALNAcLFBgNiGPPIwEBAQcBAQEBHos6hQUHFoQXBYwwqFQjgjuBWyCCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="179094944" Original-Received: from 104-247-246-42.cpe.teksavvy.com (HELO pastel.home) ([104.247.246.42]) by ironport2-out.teksavvy.com with ESMTP; 23 Nov 2015 12:27:28 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 149CB6016E; Mon, 23 Nov 2015 12:27:27 -0500 (EST) In-Reply-To: (Phillip Lord's message of "Mon, 23 Nov 2015 17:17:56 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195125 Archived-At: > + if (last_point_position != beg && > + current_buffer == prev_buffer ) > + { > + record_point (last_point_position); > + } If last_point_position really records the position of point at the beginning of the command, then you'll get weird results if the comment explicitly calls undo-boundary in the middle of its changes, since the "second bundle" will end up with a spurious point movement. I think you'd be better off just preserving the previous behavior (i.e. make my suggested patch work and just fix the comments): less work, and more guarantee that it won't introduce new regressions. Stefan