From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1713 invoked by alias); 24 Jan 2006 21:49:03 -0000 Received: (qmail 1705 invoked by uid 22791); 24 Jan 2006 21:49:02 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 24 Jan 2006 21:49:00 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F1W26-0007Ib-3v for gdb-patches@sourceware.org; Tue, 24 Jan 2006 16:48:58 -0500 Date: Tue, 24 Jan 2006 21:49:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: RFC: Clean up "show remote" Message-ID: <20060124214858.GA27783@nevyn.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <20060122201759.GA28863@nevyn.them.org> <20060123051544.GA5009@nevyn.them.org> <20060124165326.GA19716@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00381.txt.bz2 On Tue, Jan 24, 2006 at 11:20:26PM +0200, Eli Zaretskii wrote: > > > if a translator is anal about where to break, he should use non-breaking spaces > > > (such as Unicode 160) and those answer false for iswspace > > > > > iow, doing mbstowcs, breaking at iswspace, and converting back, should work. > > > but it's sort of a mess > > > > > ask eli if that's correct. maybe it's not. > > > > Is that right? > > I'm not sure I understand what Paolo is saying. If he is saying that > translators should bear the burden of forcing GDB not to break by > using NBSP, then I think it's ridiculous: software should help us, not > force us to work harder. What he's saying is that a space in the output can be assumed to be a safe place to line break, and if there is some reason why it should not - from my look over the Unicode spec, a relatively rare and less important case - then the translator would be well advised to use an NBSP. But, let's not focus on that yet - see below. > > If not, is there some forum where I could get a definitive answer? > > For the definitive answer, look in the Unicode standard (not for the > faint at heart): > > http://www.unicode.org/reports/tr14/ > > > Right now we just write overlength messages to the screen. I don't see > > how that can be an improvement over breaking them at whitespace instead > > of at the margins, but maybe I'm missing something? > > I think, as long as we are not sure about how to solve this in > general, manually breaking into two messages is better than letting > code blissfully break at whitespace, because that leaves the job of > breaking in other languages to a (human) translator. Asking the translator do it defeats my goal - which is to adapt to the user's terminal width, automatically. I spent fifteen minutes or so looking over the relevant Unicode TR; thank you for the reference. I'd even be willing to implement a substantial subset of it, if that's what it took to make GDB wrap output prettily. However, before I even think of doing that, I'd like to rephrase my question. Right now the GDB CLI is generally run either in a TTY or in some wrapping environment (e.g. emacs). I don't know much about the Emacs case, but at least on a TTY, when we encounter the terminal's physical margins we wrap - always. No matter where we are within a word. How is wrapping after spaces, as suggested by the Unicode TR but without the remaining complexity of the TR, inferior to that? We'd check widths and space characters on the results of gettext, of course, using appropriate wide character routines. There are probably some cases where this would lead to oddly placed line breaks. I'm hypothesizing that there would be fewer oddly placed line breaks even in the affected scripts than there are today. -- Daniel Jacobowitz CodeSourcery