From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: Re: The new text-mode menu and the cursor in -nw mode Date: Tue, 29 Apr 2014 17:20:58 +0200 Message-ID: <87vbtsupph.fsf@fx.delysid.org> References: <87d2g1iqzp.fsf@fx.delysid.org> <83d2g1o2lc.fsf@gnu.org> <87wqe98goi.fsf@fx.delysid.org> <831twhnvnq.fsf@gnu.org> <87lhup5kro.fsf@fx.delysid.org> <83k3a8mcxp.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1398784937 25767 80.91.229.3 (29 Apr 2014 15:22:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2014 15:22:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 29 17:22:12 2014 Return-path: Envelope-to: ged-emacs-devel@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 1Wf9rG-000462-WB for ged-emacs-devel@m.gmane.org; Tue, 29 Apr 2014 17:22:11 +0200 Original-Received: from localhost ([::1]:50630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wf9rG-0003S2-Ds for ged-emacs-devel@m.gmane.org; Tue, 29 Apr 2014 11:22:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wf9qF-0001eC-6k for emacs-devel@gnu.org; Tue, 29 Apr 2014 11:21:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wf9qA-00014c-Dq for emacs-devel@gnu.org; Tue, 29 Apr 2014 11:21:07 -0400 Original-Received: from fep18.mx.upcmail.net ([62.179.121.38]:47903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wf9qA-0000z0-1j for emacs-devel@gnu.org; Tue, 29 Apr 2014 11:21:02 -0400 Original-Received: from edge03.upcmail.net ([192.168.13.238]) by viefep18-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140429152058.JYCD1555.viefep18-int.chello.at@edge03.upcmail.net> for ; Tue, 29 Apr 2014 17:20:58 +0200 Original-Received: from fx.delysid.org ([80.109.200.215]) by edge03.upcmail.net with edge id vrLy1n00X4fLMH403rLyfa; Tue, 29 Apr 2014 17:20:58 +0200 X-SourceIP: 80.109.200.215 Original-Received: from mlang by fx.delysid.org with local (Exim 4.82) (envelope-from ) id 1Wf9q6-0002fr-2S for emacs-devel@gnu.org; Tue, 29 Apr 2014 17:20:58 +0200 In-Reply-To: <83k3a8mcxp.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 29 Apr 2014 17:24:02 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 62.179.121.38 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171655 Archived-At: Eli Zaretskii writes: >> From: Mario Lang >> Date: Mon, 28 Apr 2014 21:14:35 +0200 >>=20 >> >> However, as mention in this thread, what is important to both >> >> groups, is that the hardware cursor position is update if the >> >> currently "highlighted" area of the screen changes, so that the >> >> screen reader can "follow" the hightlight around on the screen. >> > >> > That's exactly what bothers me: updating a menu might, and generally >> > will, change more than one place on the screen. As a trivial example, >> > moving to the next menu item will redraw both the one which was >> > highlighted before and the one that is to be highlighted now. Screen >> > readers will probably read both (and the help echo in between them), >> > and I'm not sure the user will understand what is going on, not >> > without some training. >>=20 >> I am not really sure about speech based screen readers, but some have >> ways to cope with very fast screen updates, and present the changes in a >> "meaningful" way. All I know, as a braille user, is that the hardware >> cursor position is essential to indicate the highlighted area. Screen >> update ordering is totally irrelevant to me, since the screen updates >> happen way to fast to actually "see" them. However, what I need is the >> hardware cursor on the highlighted item, such that my screen reader >> shows the text "around" the highlight area, instead of going stuck in >> the middle of the currently active window. > > Please try the patch below. If it gives good results, I will install > it. That is exactly what I was looking for, thank you! Tested on trunk. While I can see that this might be counted as a feature by some, I'd like to argue that this change should be installed to the release branch as well. Thanks for a very quick response. > Thanks. > > --- src/term.c~0 2014-03-21 08:34:40 +0200 > +++ src/term.c 2014-04-29 17:20:24 +0300 > @@ -2897,6 +2897,13 @@ tty_menu_display (tty_menu *menu, int x, > menu_help_paneno =3D pn - 1; > menu_help_itemno =3D j; > } > + /* Take note of the coordinates of the active menu item, to > + display the cursor there. */ > + if (mousehere) > + { > + row =3D y + i; > + col =3D x; > + } > display_tty_menu_item (menu->text[j], max_width, face, x, y + i, > menu->submenu[j] !=3D NULL); > } > @@ -3177,6 +3184,7 @@ tty_menu_activate (tty_menu *menu, int * > bool first_time; > Lisp_Object selectface; > int first_item =3D 0; > + int col, row; > > /* Don't allow non-positive x0 and y0, lest the menu will wrap > around the display. */ > @@ -3364,6 +3372,11 @@ tty_menu_activate (tty_menu *menu, int * > faces, x, y, first_item, 1); > tty_hide_cursor (tty); > fflush (tty->output); > + /* The call to display help-echo below will move the cursor, > + so remember its current position as computed by > + tty_menu_display. */ > + col =3D cursorX (tty); > + row =3D cursorY (tty); > } > > /* Display the help-echo message for the currently-selected menu > @@ -3373,6 +3386,10 @@ tty_menu_activate (tty_menu *menu, int * > { > help_callback (menu_help_message, > menu_help_paneno, menu_help_itemno); > + /* Move the cursor to the beginning of the current menu > + item, so that screen readers and other accessibility aids > + know where the active region is. */ > + cursor_to (sf, row, col); > tty_hide_cursor (tty); > fflush (tty->output); > prev_menu_help_message =3D menu_help_message; --=20 CYa, =E2=A1=8D=E2=A0=81=E2=A0=97=E2=A0=8A=E2=A0=95 | Debian Developer .''`. | Get my public key via finger mlang/key@db.debian.org : :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44 `. `' `-