From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Changes in frame/window code Date: Tue, 29 Jul 2014 13:23:01 +0300 Message-ID: <83y4vcfoqi.fsf@gnu.org> References: <53CE6A44.1010708@gmx.at> <53D4FF76.1060804@gmx.at> <8338dmj1of.fsf@gnu.org> <83wqayhe0o.fsf@gnu.org> <53D542B3.20206@gmx.at> <83tx62hane.fsf@gnu.org> <53D6172A.5010909@gmx.at> <83fvhlhad5.fsf@gnu.org> <53D656BB.3010201@gmx.at> <83egx5h86z.fsf@gnu.org> <53D68806.9080101@gmx.at> <838undgxiu.fsf@gnu.org> <53D76758.2030707@gmx.at> <831tt4h58x.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1406629405 10562 80.91.229.3 (29 Jul 2014 10:23:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Jul 2014 10:23:25 +0000 (UTC) Cc: jan.h.d@swipnet.se, emacs-devel@gnu.org To: rudalics@gmx.at Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 29 12:23:17 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 1XC4Yr-0001Q9-Sj for ged-emacs-devel@m.gmane.org; Tue, 29 Jul 2014 12:23:13 +0200 Original-Received: from localhost ([::1]:44562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC4Yr-0007NJ-CP for ged-emacs-devel@m.gmane.org; Tue, 29 Jul 2014 06:23:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC4Yj-0007NE-W5 for emacs-devel@gnu.org; Tue, 29 Jul 2014 06:23:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XC4Ye-0001dA-QY for emacs-devel@gnu.org; Tue, 29 Jul 2014 06:23:05 -0400 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:46356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC4Ye-0001d0-Ht for emacs-devel@gnu.org; Tue, 29 Jul 2014 06:23:00 -0400 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0N9G00300XUW4A00@mtaout26.012.net.il> for emacs-devel@gnu.org; Tue, 29 Jul 2014 13:19:08 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9G00JUYXZW8190@mtaout26.012.net.il>; Tue, 29 Jul 2014 13:19:08 +0300 (IDT) In-reply-to: <831tt4h58x.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.182 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:173242 Archived-At: > Date: Tue, 29 Jul 2014 12:41:02 +0300 > From: Eli Zaretskii > Cc: jan.h.d@swipnet.se, emacs-devel@gnu.org > > > > You need to reverse the meaning of START and END for the R2L case: > > > > > > end = whole - w->hscroll * FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)); > > > start = end - box_width; > > > > > > (Note that current-bidi-paragraph-direction returns the results at > > > buffer's point, so you will need to temporarily go to the window's > > > point marker.) > > > > As soon as you have some spare time (I know you never do) please try it. > > I can only try this on MS-Windows. The patch below almost works. "Almost" because of 2 issues that still need to be taken care of: . As soon as I click on the scroll-bar thumb, which is correctly drawn flushed all the way to the right when point is an a R2L line, the scroll bar "jumps" to the left edge. Where's the code which does that? . The code below is for the selected window, where point is up to date. But what about non-selected windows, should we use window-point there? === modified file 'src/xdisp.c' --- src/xdisp.c 2014-07-27 13:21:30 +0000 +++ src/xdisp.c 2014-07-29 10:17:58 +0000 @@ -15814,6 +15814,17 @@ set_horizontal_scroll_bar (struct window left. */ whole = max (whole, w->hscroll + box_width); whole = max (whole, end - start); + if (it.bidi_p) + { + Lisp_Object pdir; + + pdir = Fcurrent_bidi_paragraph_direction (Qnil); + if (EQ (pdir, Qright_to_left)) + { + end = whole - w->hscroll * FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)); + start = end - box_width; + } + } if (old_buffer) set_buffer_internal (old_buffer);