[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] fix/no-undo-boundary-on-secondary-buffer-change c7a660

From: Stefan Monnier
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]