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/no-undo-boundary-on-secondary-buffer-change c7a6601 1/5: undo-size can count number of boundaries. Date: Fri, 18 Sep 2015 16:26:42 -0400 Message-ID: References: <20150915152129.671.61929@vcs.savannah.gnu.org> <8761395uxx.fsf@russet.org.uk> <8737yd2iju.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442608051 13267 80.91.229.3 (18 Sep 2015 20:27:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Sep 2015 20:27:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: phillip.lord@russet.org.uk (Phillip Lord) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 18 22:27:20 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 1Zd2Fa-0001oF-3F for ged-emacs-devel@m.gmane.org; Fri, 18 Sep 2015 22:27:18 +0200 Original-Received: from localhost ([::1]:41747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd2FZ-0002dM-D8 for ged-emacs-devel@m.gmane.org; Fri, 18 Sep 2015 16:27:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd2FT-0002Xr-9g for emacs-devel@gnu.org; Fri, 18 Sep 2015 16:27:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zd2FQ-0008Ti-4g for emacs-devel@gnu.org; Fri, 18 Sep 2015 16:27:11 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:44506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd2FQ-0008TY-0v for emacs-devel@gnu.org; Fri, 18 Sep 2015 16:27:08 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 1B62524249; Fri, 18 Sep 2015 16:27:07 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 9905A1E5B96; Fri, 18 Sep 2015 16:26:43 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 632D8B40DC; Fri, 18 Sep 2015 16:26:43 -0400 (EDT) In-Reply-To: <8737yd2iju.fsf@russet.org.uk> (Phillip Lord's message of "Thu, 17 Sep 2015 16:04:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:190065 Archived-At: > Because I am using it to provide a backdrop, default, automatically add > a boundary heuristic. Waiting for a boundary to be added defeats the point. I think we're misunderstanding each other. What I'm suggesting is to replace: if(NILP (Vundo_buffer_undoably_changed)){ Fset (Qundo_buffer_undoably_changed,Qt); safe_run_hooks (Qundo_first_undoable_change_hook); } with if (NILP (CAR (BVAR (current_buffer, undo_list))) safe_run_hooks (Qundo_first_undoable_change_hook); and do it right before we add something to the undo-list (so the test of undo_list indeed tells us if this is the first new change pushed since the last boundary). It should give us the same behavior but without the need for that variable. Stefan