unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Markus Triska <triska@metalevel.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 53798@debbugs.gnu.org
Subject: bug#53798: 27.1; OSX: (redisplay) does not reliably redisplay
Date: Sat, 05 Feb 2022 19:24:28 +0100	[thread overview]
Message-ID: <87h79duq77.fsf@metalevel.at> (raw)
In-Reply-To: <83ee4h196x.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Feb 2022 20:04:38 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> If you press several keys, you need to call read-char that number of
> time, or empty the input queue in some other way.  Otherwise, you
> still have input available after calling read-char, like in the
> original recipe, because you pressed more than one key.

I tried to do this by using as the final form instead:

    (while t
      (transform-line)
      (redisplay)
      (while (input-pending-p)
        (read-char))
      (sit-for 0.1))


This reads characters as long as input-pending-p succeeds, in order to
read all characters that are pending. However, I still can reproduce the
issue.

>
> I'm not on macOS, so I commented out the part of the recipe that deals
> with interprogram-cut-function.  When I run the result, I see no
> abnormal behavior, even if I press several keys.

I can reproduce this: When I remove these settings, everything works as
intended. This confirms that these settings are relevant to reproduce
this issue.

> I'm not sure I understand what you are trying to establish with these
> recipes.  What is the actual issue you are trying to solve, and why
> the call to redisplay/sit-for and pressing keys are part of that?

The issue I am facing is the following: I have programmed Emacs to
automate several tasks for me. For instance, in the example I posted,
the task is to convert UnicodeData.txt to a collection of Prolog facts
that can be queried and reasoned about with Scryer Prolog. This is an
example of an actual task I am trying to solve. I noticed that when I
start the automation, and then accidentally press a key, the program
seems to stall instead of proceeding as intended, *even* when I take
provisions, within the program, that aim to counteract the stall. For
example, in the sample snippet I posted, I tried to manually enforce a
redisplay by calling (redisplay), and still I do not see a
redisplay. Instead, I see no display update at all for many iterations.

> What do you mean by "how Emacs redisplays things"?  In these recipes,
> you actually force Emacs to do redisplay, both by calling 'redisplay'
> and by calling 'sit-for', instead of letting it do it "naturally".  So
> I wonder where all this is going, and why.

I am *trying* to force Emacs to redisplay. The issue I am facing is that
the redisplay does *not* happen, even though I am using (redisplay).  In
other words, Emacs seems to be active in the sense that it does perform
the operations I ask of it, but it does not show the result even though
I ask them to be shown.

Does this explanation help? Please let me know if there is anything I
can do to help reproduce this.

Thank you a lot!
Markus





  reply	other threads:[~2022-02-05 18:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-05 12:42 bug#53798: 27.1; OSX: (redisplay) does not reliably redisplay Markus Triska
2022-02-05 13:10 ` Eli Zaretskii
2022-02-05 17:29   ` Markus Triska
2022-02-05 18:04     ` Eli Zaretskii
2022-02-05 18:24       ` Markus Triska [this message]
2022-02-05 18:38         ` Eli Zaretskii
2022-02-05 18:55           ` Markus Triska

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=87h79duq77.fsf@metalevel.at \
    --to=triska@metalevel.at \
    --cc=53798@debbugs.gnu.org \
    --cc=eliz@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).