unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
       [not found] ` <20210311223948.2A4E320B2E@vcs0.savannah.gnu.org>
@ 2021-03-12  0:26   ` Lars Ingebrigtsen
  2021-03-12  1:03     ` Yuan Fu
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-12  0:26 UTC (permalink / raw)
  To: emacs-devel; +Cc: Yuan Fu

monnier@iro.umontreal.ca (Stefan Monnier) writes:

> branch: master
> commit 71ef0122abf5215eafa2dc414b75630a709de008
> Author: Yuan Fu <casouri@gmail.com>
> Commit: Stefan Monnier <monnier@iro.umontreal.ca>
>
>     Map redo records for undo in region to 'undo-in-region
>
>     * lisp/simple.el (undo-equiv-table): Add explaination for
>     undo-in-region, undo to the beginning of undo list and null undo.
>     (undo): If equiv is 'undo-in-region, empty or t, set pending-undo-list
>     to t.  If the redo is undo-in-region, map buffer-undo-list to
>     'undo-in-region instead of t, if it is an identity mapping, map to
>     'empty.

This seems to lead to the following two test failures:

2 unexpected results:
   FAILED  simple-tests--undo
   FAILED  simple-tests--undo-equiv-table

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
  2021-03-12  0:26   ` master 71ef012: Map redo records for undo in region to 'undo-in-region Lars Ingebrigtsen
@ 2021-03-12  1:03     ` Yuan Fu
  2021-03-12  1:40       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Yuan Fu @ 2021-03-12  1:03 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel



> On Mar 11, 2021, at 7:26 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> monnier@iro.umontreal.ca (Stefan Monnier) writes:
> 
>> branch: master
>> commit 71ef0122abf5215eafa2dc414b75630a709de008
>> Author: Yuan Fu <casouri@gmail.com>
>> Commit: Stefan Monnier <monnier@iro.umontreal.ca>
>> 
>>    Map redo records for undo in region to 'undo-in-region
>> 
>>    * lisp/simple.el (undo-equiv-table): Add explaination for
>>    undo-in-region, undo to the beginning of undo list and null undo.
>>    (undo): If equiv is 'undo-in-region, empty or t, set pending-undo-list
>>    to t.  If the redo is undo-in-region, map buffer-undo-list to
>>    'undo-in-region instead of t, if it is an identity mapping, map to
>>    'empty.
> 
> This seems to lead to the following two test failures:
> 
> 2 unexpected results:
>   FAILED  simple-tests--undo
>   FAILED  simple-tests--undo-equiv-table
> 

How is the test above ran? Maybe I can setup something similar and investigate. All the tests passed on my machine (with master and -q).

Yuan




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
  2021-03-12  1:03     ` Yuan Fu
@ 2021-03-12  1:40       ` Lars Ingebrigtsen
  2021-03-12  2:04         ` Yuan Fu
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-12  1:40 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

Yuan Fu <casouri@gmail.com> writes:

>> This seems to lead to the following two test failures:
>> 
>> 2 unexpected results:
>>   FAILED  simple-tests--undo
>>   FAILED  simple-tests--undo-equiv-table
>> 
>
> How is the test above ran? Maybe I can setup something similar and
> investigate. All the tests passed on my machine (with master and -q).

cd test/; make simple-tests

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
  2021-03-12  1:40       ` Lars Ingebrigtsen
@ 2021-03-12  2:04         ` Yuan Fu
  2021-03-12 17:00           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Yuan Fu @ 2021-03-12  2:04 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel



> On Mar 11, 2021, at 8:40 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>>> This seems to lead to the following two test failures:
>>> 
>>> 2 unexpected results:
>>>  FAILED  simple-tests--undo
>>>  FAILED  simple-tests--undo-equiv-table
>>> 
>> 
>> How is the test above ran? Maybe I can setup something similar and
>> investigate. All the tests passed on my machine (with master and -q).
> 
> cd test/; make simple-tests
> 

I see. It fails when executing regional undo. Does Emacs not have regional undo when running in batch mode? (Maybe push-mark-command behaves differently?)

Yuan


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
  2021-03-12  2:04         ` Yuan Fu
@ 2021-03-12 17:00           ` Lars Ingebrigtsen
  2021-03-12 17:24             ` Yuan Fu
  2021-03-12 17:31             ` Glenn Morris
  0 siblings, 2 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-12 17:00 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Glenn Morris, emacs-devel

Yuan Fu <casouri@gmail.com> writes:

> I see. It fails when executing regional undo. Does Emacs not have
> regional undo when running in batch mode? (Maybe push-mark-command
> behaves differently?)

I'm not sure, but I see that Glenn has disabled the tests for now, so
perhaps he knows more.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
  2021-03-12 17:00           ` Lars Ingebrigtsen
@ 2021-03-12 17:24             ` Yuan Fu
  2021-03-12 19:12               ` Stefan Monnier
  2021-03-12 17:31             ` Glenn Morris
  1 sibling, 1 reply; 9+ messages in thread
From: Yuan Fu @ 2021-03-12 17:24 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Glenn Morris, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]



> On Mar 12, 2021, at 12:00 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>> I see. It fails when executing regional undo. Does Emacs not have
>> regional undo when running in batch mode? (Maybe push-mark-command
>> behaves differently?)
> 
> I'm not sure, but I see that Glenn has disabled the tests for now, so
> perhaps he knows more.
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no

This patch should fix it for batch mode. I’m not sure if I need to mention Glenn’s commit in the commit message (like “Revert commit xxx" or something), maybe someone can edit it to the correct format.

Yuan


[-- Attachment #2: fix-test.patch --]
[-- Type: application/octet-stream, Size: 1472 bytes --]

From fd3a6ce674c86af42087c685c514dbd1b9909f81 Mon Sep 17 00:00:00 2001
From: Yuan Fu <casouri@gmail.com>
Date: Fri, 12 Mar 2021 12:18:22 -0500
Subject: [PATCH] Fix simple-tests

* test/lisp/simple-tests.el (simple-tests--undo-in-region,
simple-tests--undo-equiv-table): Re-enable in batch mode. Enable
'transient-mark-mode' in temp buffer.
---
 test/lisp/simple-tests.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 8fa8295765..601eca6cd4 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -469,8 +469,11 @@ simple-tests--undo
 
 (ert-deftest simple-tests--undo-in-region ()
   ;; Test undo/redo in region.
-  (skip-unless (not noninteractive))
   (with-temp-buffer
+    ;; Enable `transient-mark-mode' so `region-active-p' works as
+    ;; expected. `region-active-p' is used to determine whether to
+    ;; perform regional undo in `undo'.
+    (transient-mark-mode)
     (buffer-enable-undo)
     (dolist (x '("a" "b" "c" "d" "e"))
       (insert x)
@@ -506,9 +509,9 @@ simple-tests--sans-leading-nil
   lst)
 
 (ert-deftest simple-tests--undo-equiv-table ()
-  (skip-unless (not noninteractive))
   (with-temp-buffer
     (buffer-enable-undo)
+    (transient-mark-mode)
     (let ((ul-hash-table (make-hash-table :test #'equal)))
       (dolist (x '("a" "b" "c"))
         (insert x)
-- 
2.24.3 (Apple Git-128)


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
  2021-03-12 17:00           ` Lars Ingebrigtsen
  2021-03-12 17:24             ` Yuan Fu
@ 2021-03-12 17:31             ` Glenn Morris
  2021-03-12 17:45               ` Yuan Fu
  1 sibling, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2021-03-12 17:31 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Yuan Fu, emacs-devel

Lars Ingebrigtsen wrote:

> I'm not sure, but I see that Glenn has disabled the tests for now, so
> perhaps he knows more.

I know nothing, I'm just really tired of people breaking the test suite.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
  2021-03-12 17:31             ` Glenn Morris
@ 2021-03-12 17:45               ` Yuan Fu
  0 siblings, 0 replies; 9+ messages in thread
From: Yuan Fu @ 2021-03-12 17:45 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Lars Ingebrigtsen, emacs-devel



> On Mar 12, 2021, at 12:31 PM, Glenn Morris <rgm@gnu.org> wrote:
> 
> Lars Ingebrigtsen wrote:
> 
>> I'm not sure, but I see that Glenn has disabled the tests for now, so
>> perhaps he knows more.
> 
> I know nothing, I'm just really tired of people breaking the test suite.

Sorry Glenn, I didn’t know that running the test in batch mode would turn out differently. Do you see the patch I attached to my previous message? That should fix the problem.

Yuan


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
  2021-03-12 17:24             ` Yuan Fu
@ 2021-03-12 19:12               ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2021-03-12 19:12 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Glenn Morris, Lars Ingebrigtsen, emacs-devel

> This patch should fix it for batch mode. I’m not sure if I need to mention
> Glenn’s commit in the commit message (like “Revert commit xxx" or
> something), maybe someone can edit it to the correct format.

LGTM, pushed to `master`, thanks,


        Stefan




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-12 19:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210311223946.8801.94147@vcs0.savannah.gnu.org>
     [not found] ` <20210311223948.2A4E320B2E@vcs0.savannah.gnu.org>
2021-03-12  0:26   ` master 71ef012: Map redo records for undo in region to 'undo-in-region Lars Ingebrigtsen
2021-03-12  1:03     ` Yuan Fu
2021-03-12  1:40       ` Lars Ingebrigtsen
2021-03-12  2:04         ` Yuan Fu
2021-03-12 17:00           ` Lars Ingebrigtsen
2021-03-12 17:24             ` Yuan Fu
2021-03-12 19:12               ` Stefan Monnier
2021-03-12 17:31             ` Glenn Morris
2021-03-12 17:45               ` Yuan Fu

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).