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: Mon, 28 Jul 2014 21:15:37 +0300 Message-ID: <838undgxiu.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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1406571349 25674 80.91.229.3 (28 Jul 2014 18:15:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jul 2014 18:15:49 +0000 (UTC) Cc: jan.h.d@swipnet.se, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 28 20:15:42 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 1XBpSX-0006c6-6m for ged-emacs-devel@m.gmane.org; Mon, 28 Jul 2014 20:15:41 +0200 Original-Received: from localhost ([::1]:41774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpSW-0005IV-MN for ged-emacs-devel@m.gmane.org; Mon, 28 Jul 2014 14:15:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpSM-0005IO-1n for emacs-devel@gnu.org; Mon, 28 Jul 2014 14:15:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBpSF-0006wx-SA for emacs-devel@gnu.org; Mon, 28 Jul 2014 14:15:29 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:44257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBpSF-0006ws-E0 for emacs-devel@gnu.org; Mon, 28 Jul 2014 14:15:23 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N9F00000OVUTK00@mtaout27.012.net.il> for emacs-devel@gnu.org; Mon, 28 Jul 2014 21:10:45 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9F001UGP5X9X00@mtaout27.012.net.il>; Mon, 28 Jul 2014 21:10:45 +0300 (IDT) In-reply-to: <53D68806.9080101@gmx.at> 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.183 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:173223 Archived-At: > Date: Mon, 28 Jul 2014 19:27:34 +0200 > From: martin rudalics > CC: emacs-devel@gnu.org > > I still have no feeling for how hscrolling works with bidi text. IIUC > with L2R and R2L paragraphs in the same window, like > > LLLLLLLLLLLLLLLLLLLLLL2RRRRRRRRRRRRRRRRRRR > > RRRRRRR2LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL > > hscrolling will NOT preserve the aspect that the two "2" visually appear > above each other. Correct? Yes. As the hscroll amount grows, the characters in the L2R lines will move to the left, while characters in the R2L lines will move to the right. > > I feel there's some misunderstanding here, because I don't believe > > you'd ask about such trivia. What am I missing? What's bothering > > you? > > What you said earlier, that "Horizontal scrolling of mixed-direction > paragraphs is a hard problem". It's a hard problem primarily because it's hard to know what is TRT, and there's no "prior art" to follow. > >> Is the size of the slider correct in the sense described above? > > > > Yes. > > Did you check with a window containg say one huge L2R line and all > other lines short and one huge R2L line and all other lines short? Yes. Again, this is just normal hscroll, which works with bidirectional text since v24.1. The fact that hscroll is triggered by clicking the scroll bar does not matter, as long as the direction of the scroll is interpreted correctly. The changes I made simply took care of translating the scroll-bar clicks to hscroll amount. > The whole idea would be then to change the positions of > > start = w->hscroll * FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)); > > and > > end = start + box_width; > > on lines 15808 and 15810 of xdisp.c according to the value of > `current-bidi-paragraph-direction'. But how? 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.)