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: Tue, 15 Sep 2015 12:57:37 -0400 Message-ID: References: <20150915152129.671.61929@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442336276 20133 80.91.229.3 (15 Sep 2015 16:57:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Sep 2015 16:57:56 +0000 (UTC) Cc: Phillip Lord To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 15 18:57:46 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 1ZbtYA-0003Kh-9G for ged-emacs-devel@m.gmane.org; Tue, 15 Sep 2015 18:57:46 +0200 Original-Received: from localhost ([::1]:44688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbtY9-00034l-MF for ged-emacs-devel@m.gmane.org; Tue, 15 Sep 2015 12:57:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbtY5-00034Y-Js for emacs-devel@gnu.org; Tue, 15 Sep 2015 12:57:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbtY2-0003TD-EQ for emacs-devel@gnu.org; Tue, 15 Sep 2015 12:57:41 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:36572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbtY2-0003Sy-9S for emacs-devel@gnu.org; Tue, 15 Sep 2015 12:57:38 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t8FGvb44025168; Tue, 15 Sep 2015 12:57:37 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 8C9CC6612A; Tue, 15 Sep 2015 12:57:37 -0400 (EDT) In-Reply-To: (Phillip Lord's message of "Tue, 15 Sep 2015 15:21:29 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 2 Rules triggered BODY_START_GREETING=0.1, RV5430=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5430> : inlines <3798> : streams <1505710> : uri <2041025> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:189983 Archived-At: Hi Philip, Here are some nitpicks and suggestions on your code. > + if(n){ Please try to reproduce the code layout you see around. (and/or (re)read the GNU Coding Standards which describe the coding style to use). In the above: - Add a space before the open paren. - Please the open brace on its own line. > + // we have a boundary, so check we do not have too many Please capitalize and punctuate your comments. > + if (XCAR (elt) == Qnil) Don't compare Lisp_Objects with == but with "EQ (x, y)" or in this case with "NILP (elt)". While hacking on the C code I recommend you ./configure --enable-checking --enable-check-lisp-object-type which will help you catch those problems and a few others. > + if(NILP (Vundo_buffer_undoably_changed)){ > + Fset (Qundo_buffer_undoably_changed,Qt); > + safe_run_hooks (Qundo_first_undoable_change_hook); > + } Why do you need Vundo_buffer_undoably_changed? Doesn't (car-safe buffer-undo-list) give you the same information? > + doc: /* Normal hook run when a buffer has its first recent undo-able change. Rather than "recent undo-able change", I'd talk about the "first undo record after a boundary". > +This hook will be run with `current-buffer' as the buffer that > +has changed. Recent means since the value of `undo-buffer-undoably-changed' ^^^ Please try and follow the sentence-end-double-space convention. Stefan