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: bidi at startup Date: Tue, 21 Jun 2011 20:13:50 +0300 Message-ID: <83y60vumy9.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1308679387 25749 80.91.229.12 (21 Jun 2011 18:03:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2011 18:03:07 +0000 (UTC) Cc: emacs-devel@gnu.org, handa@m17n.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 21 20:02:58 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QZ5Hu-0000jF-65 for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2011 20:02:58 +0200 Original-Received: from localhost ([::1]:34804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZ5Hs-0005iB-K8 for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2011 14:02:56 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZ4Wa-0008VH-AE for emacs-devel@gnu.org; Tue, 21 Jun 2011 13:14:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZ4WX-0001sH-Vc for emacs-devel@gnu.org; Tue, 21 Jun 2011 13:14:03 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:33521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZ4WX-0001rS-66 for emacs-devel@gnu.org; Tue, 21 Jun 2011 13:14:01 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LN500E00GZKA900@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Tue, 21 Jun 2011 20:13:50 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.124.66.211]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LN500EJYH707O40@a-mtaout23.012.net.il>; Tue, 21 Jun 2011 20:13:50 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.175 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:140791 Archived-At: > From: Stefan Monnier > Cc: Kenichi Handa , emacs-devel@gnu.org > Date: Tue, 21 Jun 2011 11:12:12 -0400 > > >> Is it used when we run emacs with -batch? > > That doesn't matter for preloading. I think it does, because temacs is normally run with -batch. > > I think in -batch mode Emacs should not reorder bidirectional text. > > Mainly because if the underlying terminal is bidi-aware, it will > > reorder it by itself, and if it isn't aware, most probably it doesn't > > support the corresponding scripts anyway, and scripts that need > > reordering will come out garbled. > > > So I think bidi-display-reordering should be set early during startup, > > but only in interactive sessions, i.e. dynamically. > > As mentioned a few days ago in another thread, thinking in terms of > "interactive/noninteractive" session is the wrong way to look at it. Maybe in general, but not in this case, see below. > Instead, you want to think about which terminal is used. E.g. think of > the case of an Emacs server that did not daemonize: some terminals will > be GUIs, others will be ttys The device where Emacs displays is of no importance, as long as the display engine supports it, because the bidi reordering works on all of them. > and there'll be one more which is just > stdin/stdout. IIUC you're saying that the special initial terminal > (bound to stdin/stdout) should not do bib-processing, which sounds fine. No. stdout is not a display device in this context; a text terminal is. When Emacs writes to stdout from `message' and such likes, the result doesn't trigger redisplay, and thus doesn't invoke the reordering. Reordering happens when the result of `message' is inserted into some buffer, like the minibuffer, because that triggers redisplay, which reorders. What I was saying was that "emacs -batch" does not need reordering services, because text we write to stdout should not be reordered. Therefore, I think bidi-display-reordering should be initialized to nil in xdisp.c, then set to t during startup if Emacs is invoked interactively or as a daemon. Do you agree?