unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Glenn Morris <rgm@gnu.org>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: master 71ef012: Map redo records for undo in region to 'undo-in-region
Date: Fri, 12 Mar 2021 12:24:04 -0500	[thread overview]
Message-ID: <6AF21570-1380-41B3-A87A-01276FA92432@gmail.com> (raw)
In-Reply-To: <878s6sux2k.fsf@gnus.org>

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


  reply	other threads:[~2021-03-12 17:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2021-03-12 19:12               ` Stefan Monnier
2021-03-12 17:31             ` Glenn Morris
2021-03-12 17:45               ` Yuan Fu

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=6AF21570-1380-41B3-A87A-01276FA92432@gmail.com \
    --to=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=rgm@gnu.org \
    /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).