From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#13399: 24.3.50; Word-wrap can't wrap at zero-width space U-200B Date: Sat, 02 Feb 2013 19:52:19 +0200 Message-ID: <83a9rmbo30.fsf@gnu.org> References: <50EE7BE5.2060806@gmx.at> <83hamohmtj.fsf@gnu.org> <50EFCA6D.7090702@gmx.at> <83ip74ume7.fsf@gnu.org> <50EFE99A.5070508@gmx.at> <838v80ugv1.fsf@gnu.org> <50F021EC.4040107@gmx.at> <50F054A0.2040606@gmx.at> <83libztt68.fsf@gnu.org> <83hammu7og.fsf@gnu.org> <510D436A.1000603@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1359827595 13768 80.91.229.3 (2 Feb 2013 17:53:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Feb 2013 17:53:15 +0000 (UTC) Cc: 13399@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 02 18:53:36 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1U1hHP-0003Hm-Iw for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Feb 2013 18:53:31 +0100 Original-Received: from localhost ([::1]:43788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1hH7-0002R3-Cc for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Feb 2013 12:53:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1hH3-0002Qv-6y for bug-gnu-emacs@gnu.org; Sat, 02 Feb 2013 12:53:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1hH2-000708-08 for bug-gnu-emacs@gnu.org; Sat, 02 Feb 2013 12:53:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1hH1-000704-Sh for bug-gnu-emacs@gnu.org; Sat, 02 Feb 2013 12:53:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U1hHt-0006kB-VK for bug-gnu-emacs@gnu.org; Sat, 02 Feb 2013 12:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Feb 2013 17:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13399 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13399-submit@debbugs.gnu.org id=B13399.135982759825844 (code B ref 13399); Sat, 02 Feb 2013 17:54:01 +0000 Original-Received: (at 13399) by debbugs.gnu.org; 2 Feb 2013 17:53:18 +0000 Original-Received: from localhost ([127.0.0.1]:33120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1hHB-0006in-8S for submit@debbugs.gnu.org; Sat, 02 Feb 2013 12:53:17 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:56702) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1hH8-0006iX-4d for 13399@debbugs.gnu.org; Sat, 02 Feb 2013 12:53:15 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MHL00L00TF4HS00@a-mtaout22.012.net.il> for 13399@debbugs.gnu.org; Sat, 02 Feb 2013 19:52:18 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MHL00LWTTN48Q70@a-mtaout22.012.net.il>; Sat, 02 Feb 2013 19:52:17 +0200 (IST) In-reply-to: <510D436A.1000603@gmx.at> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70611 Archived-At: > Date: Sat, 02 Feb 2013 17:48:42 +0100 > From: martin rudalics > CC: Stefan Monnier , 13399@debbugs.gnu.org > > I rewrote `fit-window-to-buffer' and `fit-frame-to-buffer' using the > display iterator. Please have a look at the attached patch. I looked at the C parts. > --- src/dispextern.h 2013-01-02 16:13:04 +0000 > +++ src/dispextern.h 2013-02-02 14:56:54 +0000 > @@ -2489,6 +2489,9 @@ > pixel_width with each call to produce_glyphs. */ > int current_x; > > + /* Maximum x pixel position encountered within a display line. */ > + int max_current_x; Adding a struct member for the sake of just one user sounds unjustified. Can we instead make move_it_to accumulate the value internally and return it? In any case, the comment is inaccurate, since the value is accumulated across all the display lines traversed by the iterator, not computed per display line. > +DEFUN ("window-buffer-pixel-size", Fwindow_buffer_pixel_size, Swindow_buffer_pixel_size, 0, 5, 0, Why not window-text-pixel-size? The "buffer" part doesn't belong here, I think. > + doc: /* Return size of WINDOW's buffer in pixels. > +WINDOW must be a live window and defaults to the selected one. The > +return value is a cons of the maximum pixel-width of any line and the > +maximum pixel-height of all lines. > + > +The optional argument X_LIMIT, if non-nil, specifies the maximum > +pixel-width that can be returned. X_LIMIT nil or omitted, means to use > +the pixel-width of WINDOW's body; use this if you do not intend to > +change the width of WINDOW. Use the maximum width WINDOW can be > +expanded to if you intend to change WINDOW's width. > + > +The optional argument Y_LIMIT, if non-nil, specifies the maximum > +pixel-height to scan. Lines starting below Y_LIMIT are not scanned. "Lines starting below Y_LIMIT" is ambiguous. I suggest Lines whose y-coordinate is beyond Y_LIMIT will not be scanned. > +Since calculating the pixel-height of a large buffer can take some time, > +it makes sense to specify this argument if the size of the buffer is > +unknown. */) The doc string keeps silent about arguments FROM and TO. > + /* Actually, we never want move_it_to stop at to_x. But to make sure > + that move_it_in_display_line_to always moves far enough, we set it > + to MOST_POSITIVE_FIXNUM and specify MOVE_TO_X. */ > + move_it_to (&it, end, MOST_POSITIVE_FIXNUM, max_y, -1, > + MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); Did you test what this does when END is covered by a display string? Thanks.