[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Distinguish between regional undo and undo to the beginning in undo-
From: |
Stefan Monnier |
Subject: |
Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table |
Date: |
Wed, 03 Mar 2021 16:29:04 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> This patch applies on top of the first one. I added more docstrings since
> you seem to appreciate it.
Great!
> I couldn’t wrap my head around the original tests so I started a new
> one below.
That's perfectly fine.
Earlier you wrote:
> if you undo-in-region, break the undo chain, then undo-in-region again
> with undo-only, ulist would be set to t and it breaks at (setq
> undo-elt (car ulist)).
I don't see which of the tests corresponds to this.
Is it this one:
> + (should (equal (buffer-string) "abcde")))
> + ;; Test undo/redo in region.
> + (with-temp-buffer
> + (buffer-enable-undo)
> + (dolist (x '("a" "b" "c" "d" "e"))
> + (insert x)
> + (undo-boundary))
> (should (equal (buffer-string) "abcde"))
> - ))
> + (simple-tests--exec '(move-beginning-of-line
> + push-mark-command
> + forward-char
> + forward-char
> + undo))
> + (should (equal (buffer-string) "acde"))
> + (simple-tests--exec '(undo-only))
> + (should (equal (buffer-string) "cde"))
> + (simple-tests--exec '(undo-redo))
> + (should (equal (buffer-string) "acde"))
> + (simple-tests--exec '(undo-redo))
> + (should (equal (buffer-string) "abcde"))))
?
Stefan
- Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/02
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Stefan Monnier, 2021/03/02
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/03
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Stefan Monnier, 2021/03/03
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/03
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table,
Stefan Monnier <=
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/03
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/03
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Stefan Monnier, 2021/03/03
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/04
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Stefan Monnier, 2021/03/05
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/06
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Stefan Monnier, 2021/03/06
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/11
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Stefan Monnier, 2021/03/11
- Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table, Yuan Fu, 2021/03/11