unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Leo Liu <sdl.web@gmail.com>
Cc: 23002@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#23002: 25.0.92; sluggish M-x
Date: Tue, 15 Mar 2016 17:14:46 +0900	[thread overview]
Message-ID: <wly49kb1jd.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <m24mc9n0yl.fsf@gmail.com>

>>>>> On Mon, 14 Mar 2016 12:21:54 +0800, Leo Liu <sdl.web@gmail.com> said:

> On 2016-03-13 18:08 +0200, Eli Zaretskii wrote:
>> I cannot reproduce this on my system.  (You didn't say which system is
>> yours, nor which commit is was built from, so I cannot compare that.)
>> Here, the cursor exits the minibuffer immediately, and if I type
>> something, the hint message is never shown (as I'd expect).
>> 
>> Sounds like sit-for is not working correctly on your system, but I
>> have no idea why that should happen.

> At the time of reporting I didn't have access to a NS build. I just did
> one and couldn't reproduce it either. I have emailed MacPort maintainer
> to take a look at this bug and will act accordingly. Thanks.

Not updating the display on the Mac port is because it avoids frequent
flushes and input reads for overall performance.  Flushing is deferred
until the next input reading, and in the case that
execute-extended-command--shorter takes a long time, it will be at the
timing of the next polling (every 2 seconds by default).

However, the sluggishness during the evaluation of
execute-extended-command--shorter is common to the both ports on OS X,
or non-interrupt-driven systems that use polling with SIGALRM for
quit/while-no-input handling, in general.  I'm thinkng about applying
the following patch to the Mac port, but it might also be useful for
other systems.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

diff --git a/lisp/simple.el b/lisp/simple.el
index 4954763..57b7ca6 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1642,6 +1642,7 @@ execute-extended-command--shorter
   (let ((candidates '())
         (max (length typed))
         (len 1)
+        (use-polling (and (null (car (current-input-mode))) throw-on-input))
         binding)
     (while (and (not binding)
                 (progn
@@ -1652,6 +1653,11 @@ execute-extended-command--shorter
                   ;; Don't show the help message if the binding isn't
                   ;; significantly shorter than the M-x command the user typed.
                   (< len (- max 5))))
+      ;; On non-interrupt-driven systems, while-no-input polls for
+      ;; input every `polling-period' (default 2) seconds, and that is
+      ;; not frequent enough.  So we call input-pending-p manually.
+      (if (and use-polling (input-pending-p))
+          (signal 'quit nil))
       (let ((candidate (pop candidates)))
         (when (equal name
                        (car-safe (completion-try-completion





  reply	other threads:[~2016-03-15  8:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-13  4:01 bug#23002: 25.0.92; sluggish M-x Leo Liu
2016-03-13 16:03 ` Drew Adams
2016-03-13 16:08 ` Eli Zaretskii
2016-03-14  4:21   ` Leo Liu
2016-03-15  8:14     ` YAMAMOTO Mitsuharu [this message]
2016-03-15 11:10       ` Leo Liu
2016-03-15 14:21       ` Stefan Monnier
2016-03-15 23:52         ` YAMAMOTO Mitsuharu
2016-03-16  1:31           ` Stefan Monnier
2016-03-20  9:10             ` Leo Liu
2016-12-25  6:48               ` Leo Liu
2020-09-05 14:08                 ` Lars Ingebrigtsen
2020-10-07  3:45                   ` Lars Ingebrigtsen

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=wly49kb1jd.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=23002@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=sdl.web@gmail.com \
    /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).