unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: emacs-devel@gnu.org
Cc: Phillip Lord <phillip.lord@newcastle.ac.uk>
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	[thread overview]
Message-ID: <jwva8sn1vhu.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <E1Zbs2z-0000By-Qe@vcs.savannah.gnu.org> (Phillip Lord's message of "Tue, 15 Sep 2015 15:21:29 +0000")

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



       reply	other threads:[~2015-09-15 16:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150915152129.671.61929@vcs.savannah.gnu.org>
     [not found] ` <E1Zbs2z-0000By-Qe@vcs.savannah.gnu.org>
2015-09-15 16:57   ` Stefan Monnier [this message]
2015-09-17  8:08     ` [Emacs-diffs] fix/no-undo-boundary-on-secondary-buffer-change c7a6601 1/5: undo-size can count number of boundaries Phillip Lord
2015-09-17 12:53       ` Stefan Monnier
2015-09-17 15:04         ` Phillip Lord
2015-09-18 20:26           ` Stefan Monnier
2015-09-22 10:45             ` Phillip Lord
2015-09-22 12:49               ` Stefan Monnier
2015-09-22 21:41                 ` Phillip Lord
2015-09-23  1:23                   ` Stefan Monnier
2015-09-23  8:39                     ` Phillip Lord
2015-09-23 13:44                       ` Stefan Monnier
2015-09-28 19:37                         ` Phillip Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwva8sn1vhu.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=phillip.lord@newcastle.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).