From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17497: 24.4.50; TTY menu glitches Date: Mon, 02 Jun 2014 18:17:08 +0300 Message-ID: <83zjhv9w97.fsf@gnu.org> References: <83vbslbuqr.fsf@gnu.org> <20140531200947.GA779@aerie.jexium-island.net> <83lhtgbrd6.fsf@gnu.org> <20140601152657.GA15078@aerie.jexium-island.net> <838upgbnra.fsf@gnu.org> <20140601171244.GA9362@aerie.jexium-island.net> <20140601171817.GB9362@aerie.jexium-island.net> <834n04bhak.fsf@gnu.org> <20140601194600.GA4565@aerie.jexium-island.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1401722309 12172 80.91.229.3 (2 Jun 2014 15:18:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Jun 2014 15:18:29 +0000 (UTC) Cc: 17497@debbugs.gnu.org To: Thomas Dickey , Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 02 17:18:20 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WrU0A-0007oi-BV for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jun 2014 17:18:18 +0200 Original-Received: from localhost ([::1]:47172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrU09-0007ld-Km for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jun 2014 11:18:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrU00-0007jg-NS for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 11:18:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrTzv-0007hc-81 for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 11:18:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrTzv-0007hW-4i for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 11:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WrTzu-0003af-ER for bug-gnu-emacs@gnu.org; Mon, 02 Jun 2014 11:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jun 2014 15:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17497 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17497-submit@debbugs.gnu.org id=B17497.140172225313760 (code B ref 17497); Mon, 02 Jun 2014 15:18:02 +0000 Original-Received: (at 17497) by debbugs.gnu.org; 2 Jun 2014 15:17:33 +0000 Original-Received: from localhost ([127.0.0.1]:41029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrTzN-0003Zo-Br for submit@debbugs.gnu.org; Mon, 02 Jun 2014 11:17:33 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:48784) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WrTzH-0003ZQ-Sb for 17497@debbugs.gnu.org; Mon, 02 Jun 2014 11:17:27 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N6J00200RMEEB00@mtaout25.012.net.il> for 17497@debbugs.gnu.org; Mon, 02 Jun 2014 18:13:53 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N6J000AARN4BB20@mtaout25.012.net.il>; Mon, 02 Jun 2014 18:13:53 +0300 (IDT) In-reply-to: <20140601194600.GA4565@aerie.jexium-island.net> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:89885 Archived-At: > Date: Sun, 01 Jun 2014 15:46:00 -0400 > From: Thomas Dickey > Cc: dickey@his.com, 17497@debbugs.gnu.org > > > So buffering output more aggressively could help, is that what you are > > saying? > > > > We currently fflush the stream every 900 bytes and also every 10 > > screen lines or so. Does that sound reasonable? > > I don't think that will be enough: the output stream simply is not fast > enough to keep up. That'd be strange, since it evidently does succeed to keep up when we redraw the display "normally", i.e. not due to dropping down or updating a menu. Anyway, I took another look at all the screenshots posted in this bug report, and my conclusion is that all of the artifacts seem to be caused by 2 root causes: . Incorrect position of the cursor when a menu item is redrawn. This explains why some menu items are "duplicated" elsewhere in the menu, and also why items that needed to be redrawn with blue background (i.e. in the "non-selected" face) are left with the red background of the "selected" face. In all of these cases, it looks like the cursor was positioned at the EOB of the buffer (*scratch*) displayed beneath the menu. This is the "normal" cursor position, as Emacs perceives it, and that's where redisplay leaves the cursor after updating the frame display. We override that in the menu-display code, by sending a cursor motion command after the frame is completely displayed; it looks like in at least some of the cases this cursor motion command was not obeyed. . The insert mode is not turned off before some string is written to the display. This explains why we see menu items to the right of the menu: they were "pushed" by writing some other text to their left, while in insert mode. There are similar problems in some of the screenshots with the help-echo displayed in the echo area. Alternatively, this type of artifacts can also be explained by incorrect cursor position in the horizontal axis. To decide which explanation is correct, I'd need to see the artifacts when the underlying window is full of some buffer text, not almost empty as in *scratch*. Glenn, could I persuade you to try that and show the screenshots? Does the above ring any bells? Please also note that Emacs tries to be "clever" about cursor motion on a TTY: it chooses out of several possible methods of moving the cursor, comparing their "costs" (see cm.c:cmgoto for details). So it's possible that different cursor movements emit different commands to the terminal driver, and somehow trigger these strange effects. Finally, one difference between the "normal" screen update and the one we use to display and update TTY menus is that the latter seems to cause significantly more cursor motion. One possible way to cut down on that is to set show-help-function to nil. Glenn, can I ask you to try that and see if it helps in any way? TIA