GNU bug report logs - #6000
describe-text-sexp does not know window-width

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Lennart Borgman <lennart.borgman@HIDDEN>; dated Thu, 22 Apr 2010 12:16:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 6000 <at> debbugs.gnu.org:


Received: (at 6000) by debbugs.gnu.org; 2 Jul 2014 00:18:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 01 20:18:27 2014
Received: from localhost ([127.0.0.1]:39711 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1X28Fn-00049R-Fl
	for submit <at> debbugs.gnu.org; Tue, 01 Jul 2014 20:18:27 -0400
Received: from alc-vshost7.dreamhost.com ([69.163.216.107]:58537
 helo=ps18281.dreamhostps.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <juri@HIDDEN>) id 1X28Fk-00049H-VY
 for 6000 <at> debbugs.gnu.org; Tue, 01 Jul 2014 20:18:25 -0400
Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.222.226])
 by ps18281.dreamhostps.com (Postfix) with ESMTP id BBDBE348328E39;
 Tue,  1 Jul 2014 17:18:18 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Lennart Borgman <lennart.borgman@HIDDEN>
Subject: Re: bug#6000: describe-text-sexp does not know window-width
Organization: JURTA
References: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
Date: Wed, 02 Jul 2014 02:37:10 +0300
In-Reply-To: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
 (Lennart Borgman's message of "Thu, 22 Apr 2010 14:15:26 +0200")
Message-ID: <87simkaazt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 2.4 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  > In describe-text-sexp there is a call to window-width. I
 believe this > gives unreliable results because the help-window might not
 be select > at that point always. > > This shows up in the display of
 (what-cursor-position
 t) where the > sexp are sometimes unnecessary hidden behind "[Show]". > >
 A possible good enough cure is to surround the call to window-width > with
 something like this > > (with-selected-window (or (get-buffer-window "*Help*")
 (selected-window)) > (window-width)) [...] 
 Content analysis details:   (2.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.7 RCVD_IN_XBL            RBL: Received via a relay in Spamhaus XBL
 [69.163.216.107 listed in zen.spamhaus.org]
 1.6 RCVD_IN_BRBL_LASTEXT   RBL: RCVD_IN_BRBL_LASTEXT
 [69.163.216.107 listed in bb.barracudacentral.org]
X-Debbugs-Envelope-To: 6000
Cc: martin rudalics <rudalics@HIDDEN>, 6000 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.4 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has
 identified this incoming email as possible spam.  The original message
 has been attached to this so you can view it (if it isn't spam) or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > In describe-text-sexp there is a call to window-width. I
    believe this > gives unreliable results because the help-window might not
    be select > at that point always. > > This shows up in the display of (what-cursor-position
    t) where the > sexp are sometimes unnecessary hidden behind "[Show]". > >
    A possible good enough cure is to surround the call to window-width > with
    something like this > > (with-selected-window (or (get-buffer-window "*Help*")
    (selected-window)) > (window-width)) [...] 
 
 Content analysis details:   (2.4 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.7 RCVD_IN_XBL            RBL: Received via a relay in Spamhaus XBL
                             [69.163.216.107 listed in zen.spamhaus.org]
  1.6 RCVD_IN_BRBL_LASTEXT   RBL: RCVD_IN_BRBL_LASTEXT
                             [69.163.216.107 listed in bb.barracudacentral.org]

> In describe-text-sexp there is a call to window-width. I believe this
> gives unreliable results because the help-window might not be select
> at that point always.
>
> This shows up in the display of (what-cursor-position t) where the
> sexp are sometimes unnecessary hidden behind "[Show]".
>
> A possible good enough cure is to surround the call to window-width
> with something like this
>
>    (with-selected-window (or (get-buffer-window "*Help*") (selected-window))
>      (window-width))

Martin referred to this bug report from bug#17831, and I noticed
that instead of hard-coding the "*Help*" buffer name, better would be
to use (current-buffer) because the formatted buffer is current:

  (- (if (window-live-p (get-buffer-window (current-buffer) t))
         (with-selected-window (get-buffer-window (current-buffer) t)
           (window-width))
       (window-width))
     (current-column))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#6000; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Apr 2010 12:16:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 22 08:16:01 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1O4vK5-0006cS-1k
	for submit <at> debbugs.gnu.org; Thu, 22 Apr 2010 08:16:01 -0400
Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <lennart.borgman@HIDDEN>) id 1O4vK2-0006cN-8H
	for submit <at> debbugs.gnu.org; Thu, 22 Apr 2010 08:15:58 -0400
Received: from lists.gnu.org ([199.232.76.165]:58625)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <lennart.borgman@HIDDEN>) id 1O4vJw-0003S2-Jm
	for submit <at> debbugs.gnu.org; Thu, 22 Apr 2010 08:15:52 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O4vJv-0004zU-6F
	for bug-gnu-emacs@HIDDEN; Thu, 22 Apr 2010 08:15:51 -0400
Received: from [140.186.70.92] (port=40130 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O4vJs-0004zM-OT
	for bug-gnu-emacs@HIDDEN; Thu, 22 Apr 2010 08:15:49 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=unavailable version=3.3.0
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <lennart.borgman@HIDDEN>) id 1O4vJr-0005gf-Jb
	for bug-gnu-emacs@HIDDEN; Thu, 22 Apr 2010 08:15:48 -0400
Received: from mail-bw0-f225.google.com ([209.85.218.225]:62317)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <lennart.borgman@HIDDEN>) id 1O4vJr-0005gK-E5
	for bug-gnu-emacs@HIDDEN; Thu, 22 Apr 2010 08:15:47 -0400
Received: by bwz25 with SMTP id 25so8403048bwz.8
	for <bug-gnu-emacs@HIDDEN>; Thu, 22 Apr 2010 05:15:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:from:date:received
	:message-id:subject:to:content-type;
	bh=VEPti0+YXbu21cBr8aHqe5vWaqtYPcpLdUrn1azH9Cs=;
	b=p2ahczcaltUgMi82ovFnbuPweg+/qjEzFsYbwGWbtzugro52nl0tFRxIY+3N3qx/jy
	o5B1ttVLWNzXiF3nCqi2uINivktrFqEUkS+eA9SdRHzewO451rVb95OgQdl2NVG7glPc
	nYFooNPSEYW0kKK+8lFcW5ixGzyaE5lLGO5/s=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	b=SvjyZk0jFDfNI+vC0SN7H3/njIi+b1LV0ass6xZtZG7D07234+vUK7E+wnosdrlY5q
	D1wL9ga4zMZOdLCvw6BwnvOSoS9J02tmE9O51MoA4iGtg2NPenTvJL74+wY3DDUcrxm+
	O4xMuX8A/PDbdfkNDuZ800itOP2sbTQCY6QYY=
MIME-Version: 1.0
Received: by 10.239.164.81 with HTTP; Thu, 22 Apr 2010 05:15:26 -0700 (PDT)
From: Lennart Borgman <lennart.borgman@HIDDEN>
Date: Thu, 22 Apr 2010 14:15:26 +0200
Received: by 10.239.158.68 with SMTP id t4mr902745hbc.72.1271938546125; Thu, 
	22 Apr 2010 05:15:46 -0700 (PDT)
Message-ID: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
Subject: describe-text-sexp does not know window-width
To: Emacs Bugs <bug-gnu-emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -4.5 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.5 (----)

In describe-text-sexp there is a call to window-width. I believe this
gives unreliable results because the help-window might not be select
at that point always.

This shows up in the display of (what-cursor-position t) where the
sexp are sometimes unnecessary hidden behind "[Show]".

A possible good enough cure is to surround the call to window-width
with something like this

   (with-selected-window (or (get-buffer-window "*Help*") (selected-window))
     (window-width))





Acknowledgement sent to Lennart Borgman <lennart.borgman@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#6000; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.