From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#53798: 27.1; OSX: (redisplay) does not reliably redisplay Date: Sat, 05 Feb 2022 18:29:08 +0100 Message-ID: <87tuddxlwb.fsf@metalevel.at> References: <83leyp1mte.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29899"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 53798@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 05 18:31:20 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGOu8-0007cr-0W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Feb 2022 18:31:20 +0100 Original-Received: from localhost ([::1]:38318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGOu6-00071v-TO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Feb 2022 12:31:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGOsu-00071j-0P for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 12:30:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGOst-0005Cn-DC for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 12:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGOst-0002L0-0P for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 12:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Markus Triska Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Feb 2022 17:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53798 X-GNU-PR-Package: emacs Original-Received: via spool by 53798-submit@debbugs.gnu.org id=B53798.16440821518899 (code B ref 53798); Sat, 05 Feb 2022 17:30:02 +0000 Original-Received: (at 53798) by debbugs.gnu.org; 5 Feb 2022 17:29:11 +0000 Original-Received: from localhost ([127.0.0.1]:35504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGOs3-0002JT-DA for submit@debbugs.gnu.org; Sat, 05 Feb 2022 12:29:11 -0500 Original-Received: from [78.47.144.35] (port=44960 helo=metalevel.at) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGOs1-0002JL-Li for 53798@debbugs.gnu.org; Sat, 05 Feb 2022 12:29:10 -0500 Original-Received: by metalevel.at (Postfix, from userid 1000) id 2F3F59C754; Sat, 5 Feb 2022 18:29:08 +0100 (CET) In-Reply-To: <83leyp1mte.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Feb 2022 15:10:21 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:226079 Archived-At: Eli Zaretskii 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)))