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 18:29:08 +0100	[thread overview]
Message-ID: <87tuddxlwb.fsf@metalevel.at> (raw)
In-Reply-To: <83leyp1mte.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Feb 2022 15:10:21 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>
> If I modify the snippet as below, it behaves the same no matter
> whether you press a key or not.
>

Thank you a lot for looking into this issue! You are right: For the
snippet I originally posted, I can fix the issue as you outline.

Since the issue I faced in my original program cannot be solved in this
way, I have now constructed a snippet that shows the problem in a way
that apparently cannot be solved in this way, using the forms that
follow this message.

On OSX, if you save these forms in redisplay.el and then invoke Emacs
with:

    $ emacs -Q redisplay.el -f eval-buffer

then the forms will open UnicodeData.txt which ships with Emacs (please
adjust the path if necessary), and then will apply a certain
transformation on each line of the file.

You will see that each line is changed as intended, and we see each
change immediately as it takes effect. However, unexpectedly, when
several keys are pressed quickly in a row, the program apparently
stalls, and no longer performs any actions, for several seconds.

I found that the settings of interprogram-cut-function and
save-interprogram-paste-before-kill are relevant to reproduce this
issue. Could it be that how these settings are treated internally may
interfere with how Emacs redisplays things, and whether it stalls?

To forms to reproduce the issue follow below.

Thank you a lot!
Markus

;; please adapt this as necessary to find UnicodeData.txt
(find-file "~/emacs/admin/unidata/UnicodeData.txt")

(defun transform-line ()
  (insert "code_description(")
  (forward-word)
  (delete-char 1)
  (insert ", \"")
  (search-forward ";")
  (delete-char -1)
  (insert "\").")
  (kill-line)
  (forward-line))

(defun paste-to-osx (text &optional push)
  (let ((process-connection-type nil))
    (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
      (process-send-string proc text)
      (process-send-eof proc))))

(setq interprogram-cut-function 'paste-to-osx)
(setq save-interprogram-paste-before-kill t)

(while t
  (transform-line)
  (redisplay)
  (or (sit-for 0.1)
      (read-char)))





  reply	other threads:[~2022-02-05 17:29 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 [this message]
2022-02-05 18:04     ` Eli Zaretskii
2022-02-05 18:24       ` Markus Triska
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=87tuddxlwb.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).