all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs -nw FILE incurs 2-second wait before displaying anything
@ 2014-05-26 17:41 Jim Meyering
  2014-05-26 19:04 ` Eli Zaretskii
  2014-05-26 20:19 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Jim Meyering @ 2014-05-26 17:41 UTC (permalink / raw
  To: emacs-devel

I've been annoyed with emacs -nw for a while (always building
from latest), and finally have investigated enough to report this.

When I run emacs -nw on an existing file, e.g.,

  echo xxx > foo
  emacs -nw foo

I see the normal start-up signs, then a two-second pause,
and then finally the contents of "foo" are displayed.

However, if I type anything before that two-minute pause,
I avoid the delay. Likewise, if I run emacs without -nw, this
two-second pause does not appear.

I traced it to the pselect call in wait_reading_process_output
that is in turn called from kbd_buffer_get_event.

It seems to me that it would be fine to wait for keyboard events
*after* the buffer has been displayed.  Not before.

Thanks for improving emacs!



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs -nw FILE incurs 2-second wait before displaying anything
  2014-05-26 17:41 emacs -nw FILE incurs 2-second wait before displaying anything Jim Meyering
@ 2014-05-26 19:04 ` Eli Zaretskii
  2014-05-26 20:19 ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2014-05-26 19:04 UTC (permalink / raw
  To: Jim Meyering; +Cc: emacs-devel

> From: Jim Meyering <jim@meyering.net>
> Date: Mon, 26 May 2014 10:41:37 -0700
> 
> I've been annoyed with emacs -nw for a while (always building
> from latest), and finally have investigated enough to report this.
> 
> When I run emacs -nw on an existing file, e.g.,
> 
>   echo xxx > foo
>   emacs -nw foo
> 
> I see the normal start-up signs, then a two-second pause,
> and then finally the contents of "foo" are displayed.
> 
> However, if I type anything before that two-minute pause,
> I avoid the delay. Likewise, if I run emacs without -nw, this
> two-second pause does not appear.

Looks like the code in xterm.el which asks the terminal something and
waits for response.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs -nw FILE incurs 2-second wait before displaying anything
  2014-05-26 17:41 emacs -nw FILE incurs 2-second wait before displaying anything Jim Meyering
  2014-05-26 19:04 ` Eli Zaretskii
@ 2014-05-26 20:19 ` Stefan Monnier
  2014-05-27  2:51   ` Jim Meyering
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2014-05-26 20:19 UTC (permalink / raw
  To: Jim Meyering; +Cc: emacs-devel

> However, if I type anything before that two-minute pause,
> I avoid the delay. Likewise, if I run emacs without -nw, this
> two-second pause does not appear.

Which terminal emulator are you running?
Can you show the output of `C-h l' right after this 2s pause?


        Stefan



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs -nw FILE incurs 2-second wait before displaying anything
  2014-05-26 20:19 ` Stefan Monnier
@ 2014-05-27  2:51   ` Jim Meyering
  2014-05-27  3:28     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Meyering @ 2014-05-27  2:51 UTC (permalink / raw
  To: Stefan Monnier; +Cc: emacs-devel

On Mon, May 26, 2014 at 1:19 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> However, if I type anything before that two-minute pause,
>> I avoid the delay. Likewise, if I run emacs without -nw, this
>> two-second pause does not appear.
>
> Which terminal emulator are you running?
> Can you show the output of `C-h l' right after this 2s pause?

Good call.
This problem arises only with OS X's "Terminal" (2.3 (309)), but not
with aterm, xterm, or iTerm.  Here's the output of "C-h l":

ESC [ > 8 3 ; 4 0 0 0 3 ; 0 c C-h l

I had TERM set to xterm-256color.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs -nw FILE incurs 2-second wait before displaying anything
  2014-05-27  2:51   ` Jim Meyering
@ 2014-05-27  3:28     ` Stefan Monnier
  2014-05-27  4:35       ` Jim Meyering
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2014-05-27  3:28 UTC (permalink / raw
  To: Jim Meyering; +Cc: emacs-devel

> This problem arises only with OS X's "Terminal" (2.3 (309)), but not
> with aterm, xterm, or iTerm.  Here's the output of "C-h l":

> ESC [ > 8 3 ; 4 0 0 0 3 ; 0 c C-h l

Hmmm... can you check with the Emacs pretest (24.3.91 or checked out
from `emacs-24')?  If you still see the problem there, please make it
a bug report so we can better track it.


        Stefan



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: emacs -nw FILE incurs 2-second wait before displaying anything
  2014-05-27  3:28     ` Stefan Monnier
@ 2014-05-27  4:35       ` Jim Meyering
  2014-06-12 13:35         ` bug#17607: " Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Meyering @ 2014-05-27  4:35 UTC (permalink / raw
  To: Stefan Monnier, bug-gnu-emacs; +Cc: emacs-devel

On Mon, May 26, 2014 at 8:28 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> This problem arises only with OS X's "Terminal" (2.3 (309)), but not
>> with aterm, xterm, or iTerm.  Here's the output of "C-h l":
>
>> ESC [ > 8 3 ; 4 0 0 0 3 ; 0 c C-h l
>
> Hmmm... can you check with the Emacs pretest (24.3.91 or checked out
> from `emacs-24')?  If you still see the problem there, please make it
> a bug report so we can better track it.

I confirm that the 2-second delay still strikes when using a
just-bootstrapped-from-"emacs-24" binary and running
src/emacs -nw -Q FILE.  I see the same output as above for "C-h l".

As mentioned above, it appears to be terminal specific,
striking only when using OS X's "Terminal".
The delay arises before the contents of the FILE is first displayed,
and can be skipped if you know to type a key during that short
interval.  For some initial discussion, see this thread:

  https://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00445.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#17607: emacs -nw FILE incurs 2-second wait before displaying anything
  2014-05-27  4:35       ` Jim Meyering
@ 2014-06-12 13:35         ` Stefan Monnier
  2014-06-13  0:35           ` Jim Meyering
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2014-06-12 13:35 UTC (permalink / raw
  To: Jim Meyering; +Cc: 17607

[ Please don't crosspost messages between emacs-devel and bug-gnu-emacs.
  Or between bug-gnu-emacs and pretty much anything else.  ]

>>> This problem arises only with OS X's "Terminal" (2.3 (309)), but not
>>> with aterm, xterm, or iTerm.  Here's the output of "C-h l":
>>> ESC [ > 8 3 ; 4 0 0 0 3 ; 0 c C-h l
>> Hmmm... can you check with the Emacs pretest (24.3.91 or checked out
>> from `emacs-24')?  If you still see the problem there, please make it
>> a bug report so we can better track it.
> I confirm that the 2-second delay still strikes when using a
> just-bootstrapped-from-"emacs-24" binary and running
> src/emacs -nw -Q FILE.  I see the same output as above for "C-h l".

Does the patch below fix the 2-second wait?


        Stefan


=== modified file 'lisp/term/xterm.el'
--- lisp/term/xterm.el	2014-04-22 20:35:33 +0000
+++ lisp/term/xterm.el	2014-06-12 13:30:56 +0000
@@ -509,6 +509,10 @@
           ;; Gnome terminal 3.6.1 reports 1;3406;0
           ;; Gnome terminal 2.32.1 reports 1;2802;0
           (setq version 200))
+        (when (and (> version 2000) (equal (match-string 1 str) "83"))
+          ;; OSX's Terminal.app (version 2.3 (309), which returns 83;40003;0)
+          ;; seems to also lack support for some of these.
+          (setq version 240))
         ;; If version is 242 or higher, assume the xterm supports
         ;; reporting the background color (TODO: maybe earlier
         ;; versions do too...)






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#17607: emacs -nw FILE incurs 2-second wait before displaying anything
  2014-06-12 13:35         ` bug#17607: " Stefan Monnier
@ 2014-06-13  0:35           ` Jim Meyering
  2014-06-13 15:07             ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Meyering @ 2014-06-13  0:35 UTC (permalink / raw
  To: Stefan Monnier; +Cc: 17607

On Thu, Jun 12, 2014 at 6:35 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
...
> Does the patch below fix the 2-second wait?
...

Yes, it does.  Thank you!





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#17607: emacs -nw FILE incurs 2-second wait before displaying anything
  2014-06-13  0:35           ` Jim Meyering
@ 2014-06-13 15:07             ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2014-06-13 15:07 UTC (permalink / raw
  To: Jim Meyering; +Cc: 17607-done

>> Does the patch below fix the 2-second wait?
> Yes, it does.  Thank you!

Thanks, installed into emacs-24.


        Stefan





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-13 15:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-26 17:41 emacs -nw FILE incurs 2-second wait before displaying anything Jim Meyering
2014-05-26 19:04 ` Eli Zaretskii
2014-05-26 20:19 ` Stefan Monnier
2014-05-27  2:51   ` Jim Meyering
2014-05-27  3:28     ` Stefan Monnier
2014-05-27  4:35       ` Jim Meyering
2014-06-12 13:35         ` bug#17607: " Stefan Monnier
2014-06-13  0:35           ` Jim Meyering
2014-06-13 15:07             ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.