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.
Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 6000) by debbugs.gnu.org; 6 Jun 2021 09:04:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 06 05:04:03 2021
Received: from localhost ([127.0.0.1]:50618 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lpohP-0005B1-FF
	for submit <at> debbugs.gnu.org; Sun, 06 Jun 2021 05:04:03 -0400
Received: from quimby.gnus.org ([95.216.78.240]:57126)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lpohK-0005AU-2t
 for 6000 <at> debbugs.gnu.org; Sun, 06 Jun 2021 05:04:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=+SGWih5IW+iGn30TBIEh6Dzh62lbC8x7F+foqOW+2dc=; b=BwmL6lZlKQNjz6z67DTETJ2CJD
 HC2z/e6yuBbhyAX621wgbFLMY8hatz0rylgkjA3SnL3g91ufX8pZccu+v4NRO41jl/kIB9WUMJev/
 Xvgde7DTzYs/V23EdM/E6yuGyTifRXJzSQ7yGAMPYzteHlyYBG1xMwec1779db0Pw1/0=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lpoh9-0004g2-NV; Sun, 06 Jun 2021 11:03:51 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#6000: describe-text-sexp does not know window-width
References: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
 <87simkaazt.fsf@HIDDEN> <87o8cn71us.fsf@HIDDEN>
 <87h7ie3isy.fsf@HIDDEN>
 <148710df-bd9c-0ddb-f00b-a2e429d600dd@HIDDEN>
 <87v96uyn6n.fsf@HIDDEN>
 <b7cf674b-63b7-9711-0af5-66d98eb29c5d@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEX489f+/Obe2sPY
 z66ckVlgYCIvLxn///8+Oln3AAAAAWJLR0QHFmGI6wAAAAd0SU1FB+UGBgg6EBZ7FUgAAAFoSURB
 VDjLnZRtkoMgDIax9gAyvYArPYBD2v3dGaEH2GIOsJXc/wgN+IWWzuxs/CHDY94XAlEUMhdVJfJA
 zkBppaAEUKDbLQAdZhWA1hsQhxzFXkrKg9JB6OsN5MzPZhe3CVz7Xfz8D8i/AJMBzuQynP0oNRPM
 euAHc2doiucGuFYcs+DBVS/vM5AjYG+81eLUAY92GXQTolIDGGMX8+8IdC3EBYew0d9NBtSNyCzX
 mq6F2mLcaZoBtQLXnvpj2GgCnG7U2XfQcobHdVXoAEpL/hKsfeKBXA+wSF2/A70drDNIw5WmVcll
 uehZhh73WJ0UjIUfLCttM0ZAHgl9moE+fMovpD6p7nSAPtbGj1LFYh4pZ+wAfxowMvBvUoEiET6X
 jOV+REArIBxrEbSI/ArCnGeTsI35liwgmET/cB5V7FPxFrGFQysKwTfhsEyPrV0V/OMotWq0bvhR
 rZCrSNUkUciN+q7LP8cL2tDmE4p07lIAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMDYtMDZUMDg6
 NTg6MTYrMDA6MDBCAGq6AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTA2LTA2VDA4OjU4OjE2KzAw
 OjAwM13SBgAAAABJRU5ErkJggg==
X-Now-Playing: Andy Strain's _Breathing Instruments_: "Patience"
Date: Sun, 06 Jun 2021 11:03:47 +0200
In-Reply-To: <b7cf674b-63b7-9711-0af5-66d98eb29c5d@HIDDEN> (martin rudalics's
 message of "Fri, 4 Jun 2021 14:44:38 +0200")
Message-ID: <87sg1vuzyk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: martin rudalics <rudalics@HIDDEN> writes: >
 `describe-text-sexp'
 always works on the current buffer > > (defun describe-text-sexp (sexp) >
 "Insert a short description of SEXP in the current buffer." > > so the added
 line will avoid the [Show] [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 6000
Cc: Juri Linkov <juri@HIDDEN>, Lennart Borgman <lennart.borgman@HIDDEN>,
 6000 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.7 (-)

martin rudalics <rudalics@HIDDEN> writes:

> `describe-text-sexp' always works on the current buffer
>
> (defun describe-text-sexp (sexp)
>   "Insert a short description of SEXP in the current buffer."
>
> so the added line will avoid the [Show] button iff the selected window
> doesn't show the current buffer which should be rare enough.

That's what I thought should happen, but your proposed change is the
patch below, which seems to do the opposite?  I.e., it'll always do the
[Show] button if the selected window doesn't show the current buffer...

diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 85017de5d5..f92f37d53d 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -51,7 +51,8 @@ describe-text-sexp
       (setq pp (substring pp 0 (1- (length pp)))))
 
     (if (and (not (string-match-p "\n" pp))
-    	     (<= (length pp) (- (window-width) (current-column))))
+             (eq (window-buffer) (current-buffer))
+             (<= (length pp) (- (window-width) (current-column))))
 	(insert pp)
       (insert-text-button
        "[Show]"


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

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


Received: (at 6000) by debbugs.gnu.org; 6 Jun 2021 07:42:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 06 03:42:36 2021
Received: from localhost ([127.0.0.1]:50534 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lpnQZ-000141-Vb
	for submit <at> debbugs.gnu.org; Sun, 06 Jun 2021 03:42:36 -0400
Received: from mout.gmx.net ([212.227.17.22]:46619)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1lpnQY-00013n-8u
 for 6000 <at> debbugs.gnu.org; Sun, 06 Jun 2021 03:42:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1622965347;
 bh=YKystbV4YV50b+tFxC1CrAfm16UYVnQ6vGsWpWTrW6g=;
 h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To;
 b=XKnq43BFY5jpEvIQiHJd++Wy7Jk6ECHIxAgKhngfYrqyzzLvPyNPgy/o+fRzRIxv3
 DGfDuT2oVOtQecHkvuj07TU+vKDUHD5MYOweDhWQbLD2mYsGqSqBolCz24fc07rLyC
 7KMdQ6/2Z86nsswA9Q6hvjeWnO8Xj61bJ0RGGYps=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.100] ([46.125.249.84]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MvsJ5-1lXzSW02Rr-00stt5; Sun, 06
 Jun 2021 09:42:27 +0200
Subject: Re: bug#6000: describe-text-sexp does not know window-width
To: Juri Linkov <juri@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
References: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
 <87simkaazt.fsf@HIDDEN> <87o8cn71us.fsf@HIDDEN>
 <87h7ie3isy.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
Message-ID: <b4e75298-339c-b41e-3e42-e1cb88974faa@HIDDEN>
Date: Sun, 6 Jun 2021 09:42:22 +0200
MIME-Version: 1.0
In-Reply-To: <87h7ie3isy.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:CeCsw/A+pjZc0L921pvmHkvLlIEMicZMDRquiA3l4Qj1YSbXJyC
 3Eo2V5OMxGAFtiYVPK8NPWXxadf9ThD0ilPzcj8RELDH1N3mTN2pNw/eHuYSLw+4D90QPF+
 QLUeRVRpkVu7qgvUc6V0tHxSzRULxFoeu2uIk29NRXBLDKDnSG6ZhsNdOFe/xOSBF5AAyU7
 JAEybZNER0US16XcpOsCg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:rSWOPMdWejc=:pYLB1kqcIoCvcmydS3qavC
 jbfdVx++xqqJMsrExXDvGmmXOybMyDXhz3B2+67XiQ6qygGEMWiOtGC0h2PjtGOf7juG97yOQ
 6bFUB6/EgFAZhYUBJ2KPUdUAnBirhK5O184ZF7RbaFDSh9jy6QmlrXqURWVVoPzMu7ycA44ZL
 Et0YgjNhVzBSzV1OXatpCmsTxN2myj+X4VdjjkgCDUlht9ejK6K2Fgk8OPzIvwdaOSLS5bwgm
 9/nbdcat8CQ8OAnaxXQ8Bi/Rk+wQVpdMDC6zVfEorjpQys1iwajRb9cCHybJhJPl283WiXnoC
 LPjFuTiTF9bF/Zd1Plhi4suq9hcTlC/G6NGCqd01/qkyF2KO+6i+QQetp6HHBV0DBeRmHOjBf
 Gc5dwvDqmeRY/4kkU4xYOyLISVtFQ/d52H007Irop1ao7ipZdlEghnVSMwAv673LDoHpEupZQ
 T90wkRStQMbIyxKBzmXLEESyPVcR3xLI5dUflcYICupMpbxZR6k5O4mZM78P8S3V+esU7EPmp
 0PT2S5ygF6sFvkmSHPuLQjb+/jwSggRf8ydgwSaso9hUtsIUYSLLuZlhEqDq+1oxQYnARl8UT
 jfqe7NWDB+ntfCh2TkOqgO+5y29mmniiuEuwnxP/gHyqTJpRyuOs+HDKu3MIV/19tbtSPrw8S
 VeyCX9c2Cnwc81FBNd89egB9C/mDgVwEQfd+9eS96jMdwe2TlqxpMrYlNPlNlLsRwA70jCC5n
 4XRCtt0cweKzoPo+5JWMkzk8WlM5ZozAmENwgYbYD3SBbJGNd6DUBT8h9JdogV1r5DpsxcKwd
 U2n4i1jSart3Lhi3fxiVImkjW2/mhDn/PTq/S6fEICIJ/x5RcoNsqvDAttvrFyJrKpOXE9mhO
 u4yTT0GlqKIY5Cp57TyWC45SbO+cfJaIB2eb7sITUg/nNT/o4dj2A0RbVsUsd+oimf/19dr8B
 xF8WrYeuoBmuvtQ8eRPWNkHZtE47w/gmh6nsrfIYb74KW28tEryUxuuKkH1tQqW1Ou7vZgV+u
 lR1WsS/FQPRD/6WXJWAkfaLPvc8zkc76o1fS2SibmjhYbrYJ26uVZDiv9subq9sZy9TI7e/77
 RtsHUAl5peU7BM8f2IAMA+J30b/6aP0FmnK
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  >> Does anybody have a test case that displays the problem
 (in case it's >> still in place after all these years)? > > Indeed a test
 case would be needed,
 but I have none. With emacs -Q evaluate (progn (split-window
 nil -20 t) (put-text-property 1 2 'foo "This is a very long text property")
 (describe-char 1)) 
 Content analysis details:   (1.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
 [46.125.249.84 listed in dnsbl.sorbs.net]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (rudalics[at]gmx.at)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [212.227.17.22 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [212.227.17.22 listed in list.dnswl.org]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 6000
Cc: 6000 <at> debbugs.gnu.org, Lennart Borgman <lennart.borgman@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: 0.5 (/)

 >> Does anybody have a test case that displays the problem (in case it's
 >> still in place after all these years)?
 >
 > Indeed a test case would be needed, but I have none.

With emacs -Q evaluate

(progn
   (split-window nil -20 t)
   (put-text-property 1 2 'foo "This is a very long text property")
   (describe-char 1))

or

(progn
   (setq split-height-threshold nil)
   (setq split-width-threshold 20)
   (put-text-property 1 2 'foo "This is a very long text property")
   (describe-char 1))

Here these show a *Help* window on the right where not the entire text
property string is visible.  Depending on your settings it won't matter
much because the rest of that buffer is only partially visible too.

To show the inverse effect, again with emacs -Q, evaluate

(progn
   (split-window nil 20 t)
   (put-text-property 1 2 'foo t)
   (describe-char 1))

Here this shows *Help* in the window on the right with a line

   foo                  [Show]

where clicking on [Show] will show "t" in the window on the left.
This is embarrassingly silly.

Obviously, there are many more scenarios but most of them require to
customize `display-buffer-alist'.  Presumably, most people don't notice
the behavior - they just got used to it.

We could

- Do nothing: If, in the earlier scenarios, we'd insert a "Show" button
   instead of the text, clicking that button might again pop up a too
   narrow *Pp Eval Output* window and nothing has been gained.  As for
   the last scenario, we could tell users that they are on their own when
   they invoke `describe-char' in a too narrow window.

- Skip the `window-width' check in `describe-text-sexp' and maybe
   recommend using `temp-buffer-resize-mode' with a few tweaks like

(progn
   (temp-buffer-resize-mode)
   (setq temp-buffer-max-width 100)
   (setq fit-window-to-buffer-horizontally t)
   (setq split-height-threshold nil)
   (setq split-width-threshold 20)
   (put-text-property 1 2 'foo "This is a very long text property")
   (describe-char 1))

   But some people don't like `temp-buffer-resize-mode'.

- Calculate the maximum width of text in the buffer preceding the line
   where to insert the property with a function like

(defun max-column-in-frame ()
   "Return maximum column of current buffer in selected frame.
The return value is the longest column from the beginning of the
buffer to the line specified by the selected frame's height."
   (save-excursion
     (goto-char (point-min))
     (let ((width (frame-width))
	  (height (frame-height))
	  (line 0)
	  (max-column 0)
	  column)
       (while (and (< line height) (< (point) (point-max)))
	(setq column (move-to-column width))
	(when (> column max-column)
	  (setq max-column column))
	(forward-line 1)
	(setq line (1+ line)))
       max-column)))

and use that instead of `window-width' in `describe-text-sexp' as

     	     (<= (length pp) (- (max-column-in-frame) (current-column))))

This will delegate the problem to those who inserted text earlier into
that buffer.  If they were right, `describe-text-sexp' won't do anything
wrong.

martin




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

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


Received: (at 6000) by debbugs.gnu.org; 4 Jun 2021 12:44:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 04 08:44:48 2021
Received: from localhost ([127.0.0.1]:45768 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lp9Bw-0000hs-9u
	for submit <at> debbugs.gnu.org; Fri, 04 Jun 2021 08:44:48 -0400
Received: from mout.gmx.net ([212.227.15.15]:34157)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1lp9Bu-0000hf-5u
 for 6000 <at> debbugs.gnu.org; Fri, 04 Jun 2021 08:44:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1622810679;
 bh=SBpNkw21zGmqxZoURwztO/qEiSEVqISoK//8jr9z2A8=;
 h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To;
 b=LJJBKpuJNJsx+CxyMl55QeS69ftW+Gh2V0cZM3kIShPGDzrERMBozufkHKyaK0YFG
 Ed/Rkyz3p6i0MYRKdOJVEFfutjpNMMuExlTNEf3v/nvXGnFCeKyucS6vjdoypevOrD
 vzq0uYVtFdBdHDPF3umboMsK5tE+oizXJUG0kGio=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.100] ([213.142.96.52]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MIdeR-1ldJL81Qmr-00Eb3A; Fri, 04
 Jun 2021 14:44:39 +0200
Subject: Re: bug#6000: describe-text-sexp does not know window-width
To: Lars Ingebrigtsen <larsi@HIDDEN>
References: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
 <87simkaazt.fsf@HIDDEN> <87o8cn71us.fsf@HIDDEN>
 <87h7ie3isy.fsf@HIDDEN>
 <148710df-bd9c-0ddb-f00b-a2e429d600dd@HIDDEN> <87v96uyn6n.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
Message-ID: <b7cf674b-63b7-9711-0af5-66d98eb29c5d@HIDDEN>
Date: Fri, 4 Jun 2021 14:44:38 +0200
MIME-Version: 1.0
In-Reply-To: <87v96uyn6n.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:IQeC037o9zQZb3KFeik8IUfUz2arm72xDRXXwI1slvm91BNp93V
 SaOOehmTLaFUDBR4hP8PARCeftHT2VYez42dzNHc8eE0l8SjjjE1YtjbdQlKtoMAcoz+UMN
 bMh/GLBnlrk58Y6RP/C41NQHop0ZsCQm+P/PMzoDCebprGfsPAzF1gKRvJ3A8jYt4Peu5Q+
 l3eH4XmwFNb8JQX1UmR1w==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:Z1QiOsvlNRw=:R8n5sDEQfmTYCwvR7UNQq2
 TEcLdDHlfLDLwpuDz0TsESL9iSb2hAmUgXixC8mgmDkW1/nYvWa0o+0vB8DaI7ulo5j/MPHxu
 uBRpT/edsLfFja5km7UumuZgqT897uAio92houvaLlV3y1OWSrIDSJBhb7jttRRAJLf9RoxP/
 poQ4gnKk6jd8dId29pI3DQPiyX83vgZy2Np/tMq+NrgMPYYKvz2a5dsTkY7vPlwJhpzewcLum
 AzRtry66bLvQm5uL8hN6H6MqFwm/3S3vguwzlOIEztSe+WylWVLYEsTRh3sB2EjuvYK5ByQqr
 h/ASyV05tylm/oNl3Ve5VfpHaOf2kptEoPpwkulOXf5Bb/zmFWYpXl4NwxZjTPxbvrcDSlh87
 xFPnyeNtjkXOQpI4jTvTF9EopPHqOdHhmupR2Rgj8GQGvekYsurECfXo90fLZ6MnIWUd3Wlo2
 Ia3P/ZBcvlXjSU4T48Xfc9F+BwU1LkE1ijnfjL7wXeOVTQgGRekQa+JaioHs7w04uZT/ruQq3
 1W1P438g5hTpxj9a6F3l59w+5ZOmKu6gZymysr4kCJHVhWG5cl3o7l2iGAkU2cgWTCoUUI/kj
 8stmGCmGG/q58alxZXxVf5e02Ojg+GzjBHJMDR2L7XydO6JdeJyWH8Op1aPdHdptrYon3Xmr2
 zS3lK+lq9r5b1KpX1MnvZ05b94YzsV2wlyAQeEfb4VjxyEoF1FgV0k3PISVdYoUHypqoWaw4C
 v4yOAFjeqWoUz+cfpPMPOU/JiiLjFQtsZP/jgkLa7CDmatPdPizApEV19gjbHiZp9hjkoVylM
 ZO3DqhqEzGQf1qg09wSGva8vNVm9sWhdprWQNJ+xb4sSZUma5+E0YsnqcTxeC4E3pGTWya4Dh
 PPmXeAyzlcHDHAFQsaYaH8vkLT2tKXV9oM5MH72iMY9GW2xz++HDDZF5Fcz6xMqqyZOyqWkpw
 mXY8zx97CUpuR7HULrQnzld0bGQm0PJnqOUP1/se2Xr/C6Ip2omIxpfxJHEMBwzc1OFNso5FS
 lnai8xZpIePtZPG/TwGJz6/iKyV93a6durrXMGSdDhy+wuvZCqbopDnHizNxWlb2RaPiBb3gv
 g0DlxGpHp5lYyp4HCE7ZCtp8n1ppUaGS7rc
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 6000
Cc: Juri Linkov <juri@HIDDEN>, Lennart Borgman <lennart.borgman@HIDDEN>,
 6000 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.0 (-)

 >> and M-x foo in some window.  Dependent on the width of that window,
 >> `describe-text-sexp' will decide whether to insert the expression in
 >> *foo* or display a "Show" button instead.  When you eventually display
 >> *foo* you will see the result.  I think a simple check like
 >>
 >>      (if (and (not (string-match-p "\n" pp))
 >>               (eq (window-buffer) (current-buffer))
 >>               (<= (length pp) (- (window-width) (current-column))))
 >> 	(insert pp)
 >>
 >> should work.
 >
 > Hm...  this will always insert the [Show] button if the *foo* buffer
 > isn't the current buffer?  Is that what we want here?

`describe-text-sexp' always works on the current buffer

(defun describe-text-sexp (sexp)
   "Insert a short description of SEXP in the current buffer."

so the added line will avoid the [Show] button iff the selected window
doesn't show the current buffer which should be rare enough.

martin




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

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


Received: (at 6000) by debbugs.gnu.org; 4 Jun 2021 09:49:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 04 05:49:37 2021
Received: from localhost ([127.0.0.1]:45407 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lp6SP-0001oh-CX
	for submit <at> debbugs.gnu.org; Fri, 04 Jun 2021 05:49:37 -0400
Received: from quimby.gnus.org ([95.216.78.240]:60832)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lp6SK-0001oR-AR
 for 6000 <at> debbugs.gnu.org; Fri, 04 Jun 2021 05:49:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=VXTdQOyhG/RzRqSniSnQ5nGowAYYL8JxNWnij+RQILw=; b=UKawhxJ1uwytc4Dk4VHxkl61GE
 Fg8bVb85bboFv4yBxL/+VqOwycFSjanCrjFnuO3RMFOQk1ab6xIP0XJSB4QTcExQ4P+1UqZi3E6XW
 TKiO6hOLZQaHuUb8px3gZM6i+y8x3FqVI9XbmeuUIyUAYcgiFisiCiabzw5ibLjsfcbg=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lp6S9-0003yV-8o; Fri, 04 Jun 2021 11:49:25 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#6000: describe-text-sexp does not know window-width
References: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
 <87simkaazt.fsf@HIDDEN> <87o8cn71us.fsf@HIDDEN>
 <87h7ie3isy.fsf@HIDDEN>
 <148710df-bd9c-0ddb-f00b-a2e429d600dd@HIDDEN>
X-Now-Playing: Rhoda with The Special AKA's _Make More Noise (3)_: "The Boiler"
Date: Fri, 04 Jun 2021 11:49:20 +0200
In-Reply-To: <148710df-bd9c-0ddb-f00b-a2e429d600dd@HIDDEN> (martin rudalics's
 message of "Fri, 4 Jun 2021 11:18:35 +0200")
Message-ID: <87v96uyn6n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  martin rudalics <rudalics@HIDDEN> writes: > and M-x foo in
 some window. Dependent on the width of that window, > `describe-text-sexp'
 will decide whether to insert the expression in > *foo* or display a "Show"
 button instead. When you eventua [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 6000
Cc: Juri Linkov <juri@HIDDEN>, Lennart Borgman <lennart.borgman@HIDDEN>,
 6000 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.7 (-)

martin rudalics <rudalics@HIDDEN> writes:

> and M-x foo in some window.  Dependent on the width of that window,
> `describe-text-sexp' will decide whether to insert the expression in
> *foo* or display a "Show" button instead.  When you eventually display
> *foo* you will see the result.  I think a simple check like
>
>     (if (and (not (string-match-p "\n" pp))
>              (eq (window-buffer) (current-buffer))
>              (<= (length pp) (- (window-width) (current-column))))
> 	(insert pp)
>
> should work.

Hm...  this will always insert the [Show] button if the *foo* buffer
isn't the current buffer?  Is that what we want here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

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


Received: (at 6000) by debbugs.gnu.org; 4 Jun 2021 09:18:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 04 05:18:45 2021
Received: from localhost ([127.0.0.1]:45342 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lp5yX-0000vj-BR
	for submit <at> debbugs.gnu.org; Fri, 04 Jun 2021 05:18:45 -0400
Received: from mout.gmx.net ([212.227.17.20]:52167)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1lp5yV-0000vS-1T
 for 6000 <at> debbugs.gnu.org; Fri, 04 Jun 2021 05:18:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1622798316;
 bh=2fFS1XHUpvEgLpzM+soU0wHgT3csWQTezwyfNR433bI=;
 h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To;
 b=C8380aoPerBZyFV8fvspdr0uZ9aKxsIDs7LqSm7QtrTNRjJxPt95KpnxxKfoaZE4q
 DjYSYLZNVu488hHunjD1Do2SQoQEncrPhtr9jTHO0B/829j4KxXjfkDrZHU2ebEQPx
 Ixr/KTJMDNIvL+/tu7v+67XA3ts6hWMfVVx32QWs=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.100] ([213.142.96.52]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MrQEx-1l3uW326i7-00oWDF; Fri, 04
 Jun 2021 11:18:36 +0200
Subject: Re: bug#6000: describe-text-sexp does not know window-width
To: Juri Linkov <juri@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
References: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
 <87simkaazt.fsf@HIDDEN> <87o8cn71us.fsf@HIDDEN>
 <87h7ie3isy.fsf@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
Message-ID: <148710df-bd9c-0ddb-f00b-a2e429d600dd@HIDDEN>
Date: Fri, 4 Jun 2021 11:18:35 +0200
MIME-Version: 1.0
In-Reply-To: <87h7ie3isy.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:R/p6aP4X07Bhe57OTlbHr0AP+ksmLmwA4nI47eNnv16vnHIdbUo
 xUe6yiLAz6dl2F2t0ardZ0yXq0dAIKfhHKRpG55zpMX4vbeMCHZdtIASVoDfk4Rv4bI6ShD
 2jlZpHesF3Lwc8tNubvuxMyi+qU4xbtBVZKkcfl3QIyYykcGZvCALfGxeiY8oxM5X78LgRn
 6ofk9Re3L/ZyNach2jO2w==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:lOXQu81sn3s=:WjqDlmcbpgNI7GYUume0Tc
 51iq52s/XR0gOxq3u27sZeQVEoRktWmeNy3GCbrFttKZpSlIQXgVqaJmPb6188geXAK5JNd2P
 0TKqUgrtOfhmp+Cz3kB5ZKz9amtTRHgPSAoOiVJEwHpJ75sATOxTU25rPDVdeq/yxZPxgUHuO
 xOu1M4hhNhRvEb0tPqVM2UyGYqhB//CiFQWL5fg6Hr3DlUW/yrtP6S9aUfCyukjkULHgjMoa+
 kopibBKOfdO8dQQj9TfHgPx7/xf+7j9AVIi7XLbvPt0maLN4TY/Kqs5f3EtKFf6BJ5SRAyNeF
 0OBgbWd3jepHCXqfaq3Jpfi+JsDcsqDyKHGhwzNGbPGXxMPrNDVXI6iw28aUZcaO8BXRQ+gI1
 4i2HdH1YzafKpVPG5OK1hIcSeUylOffn+F4xW0Rv2SmWcI5zv7Yd73kHqz5pMBGe64XlvWjCD
 3mhopOrCdNh/2ECOMoyJmL4sAMeXKHRyUT9I6eB8KietaGXynA7jlwgJz66xKGhRp7lc88weU
 drVC90uqWkPhrL8mfaZs1Dc14Y6WHp6EawYCvJV2g4pqxyXMfdw5M0ZYhO/4dCej6JIcam+gO
 q0F9WOHpsHq5BLEyvIRxeibtFkmyAwuuyYGm2929cPD3k2rXKs6ilNIOudLDnmgFscPyxios4
 L3Jf3xU9VdiYc2TdyPmeLaJleM+MT0pcnyS8UxNHi1sbROOmX5wt8JYdtbdl59TtyPntORPKI
 qUqjN8Bh5oy2dam56hruteSEQwwWcAd2UigvZ6zNXEBQ72SWejJ5eRF6UWC6HdFKfVvhmGiC0
 Ot72bX169oiOE7akrrooPu3fN09BF6o0ivqy3qwgV3jWTZpiUVYsK0fHq/sLoPQ1S/5Hy54xv
 vf8MHBRaXG4UWgqHCvL/L3sfMM8FDOK7IfJ5554odoD6YV7N1YosGWzKbxH/gSmB6MJLX8NGI
 VzpSKdZG0WdHC/sJ2/oxI9dhm1k/UF+Qi1cnFCcqaVengARdwZSmYr+6C3poCtiboNwq1KTzG
 aZoGdIyPXaKQ3qtfyLhhV3oDrOWXskEt4uKtjJQCoZAprPuh6Gdhk4jkT0LHoENRSSPZuk0Fl
 S3gMf5YKHNpiN8dT0rEtTcO1FntbKy25ljC
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 6000
Cc: 6000 <at> debbugs.gnu.org, Lennart Borgman <lennart.borgman@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.0 (-)

 >> This sounds like a good idea to me, but there wasn't a recipe to
 >> reproduce whatever error this bug report was talking about, so I can't
 >> test.
 >>
 >> Does anybody have a test case that displays the problem (in case it's
 >> still in place after all these years)?
 >
 > Indeed a test case would be needed, but I have none.

There's no realistic test case for this.  You can do

(defun foo ()
   (interactive)
   (with-current-buffer (get-buffer-create "*foo*")
     (describe-text-sexp 'foooooooooooooooooooooooooooooooooo)))

and M-x foo in some window.  Dependent on the width of that window,
`describe-text-sexp' will decide whether to insert the expression in
*foo* or display a "Show" button instead.  When you eventually display
*foo* you will see the result.  I think a simple check like

     (if (and (not (string-match-p "\n" pp))
              (eq (window-buffer) (current-buffer))
              (<= (length pp) (- (window-width) (current-column))))
	(insert pp)

should work.

martin




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

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


Received: (at 6000) by debbugs.gnu.org; 3 Jun 2021 20:33:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 03 16:33:18 2021
Received: from localhost ([127.0.0.1]:44751 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lou1l-0002Yu-W8
	for submit <at> debbugs.gnu.org; Thu, 03 Jun 2021 16:33:18 -0400
Received: from relay6-d.mail.gandi.net ([217.70.183.198]:50681)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1lou1l-0002Yf-1u
 for 6000 <at> debbugs.gnu.org; Thu, 03 Jun 2021 16:33:17 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 12CADC0003;
 Thu,  3 Jun 2021 20:33:08 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#6000: describe-text-sexp does not know window-width
Organization: LINKOV.NET
References: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
 <87simkaazt.fsf@HIDDEN> <87o8cn71us.fsf@HIDDEN>
Date: Thu, 03 Jun 2021 23:25:20 +0300
In-Reply-To: <87o8cn71us.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 03 Jun 2021 11:07:39 +0200")
Message-ID: <87h7ie3isy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 6000
Cc: martin rudalics <rudalics@HIDDEN>, 6000 <at> debbugs.gnu.org,
 Lennart Borgman <lennart.borgman@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.4 (-)

> This sounds like a good idea to me, but there wasn't a recipe to
> reproduce whatever error this bug report was talking about, so I can't
> test.
>
> Does anybody have a test case that displays the problem (in case it's
> still in place after all these years)?

Indeed a test case would be needed, but I have none.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#6000; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 6000) by debbugs.gnu.org; 3 Jun 2021 09:07:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 03 05:07:50 2021
Received: from localhost ([127.0.0.1]:42261 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lojKQ-0000MS-B3
	for submit <at> debbugs.gnu.org; Thu, 03 Jun 2021 05:07:50 -0400
Received: from quimby.gnus.org ([95.216.78.240]:40520)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lojKO-0000M9-Kx
 for 6000 <at> debbugs.gnu.org; Thu, 03 Jun 2021 05:07:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=pVVm/aQ3IDVVHhJYuSe8WkHXScgTlB/UrJOJP20zEzc=; b=F37e+2gv75q2M0BSnOLxGB4oOq
 dUJmmajkyJdAWqME4KIy9q+IsbJHT4l8h1pvhduiVv0PoyIHJ9PtCzHK39u9ZtZts+7YaRoICngLl
 xezr2ZcD1hMOWs572LZwhV3bplXJmueNkHxTb9AR9qiyhiKUijlEB8sRkhOoT4Imyf1E=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lojKF-0000DH-Ot; Thu, 03 Jun 2021 11:07:41 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#6000: describe-text-sexp does not know window-width
References: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@HIDDEN>
 <87simkaazt.fsf@HIDDEN>
X-Now-Playing: Little Simz's _Grey Area_: "Offence"
Date: Thu, 03 Jun 2021 11:07:39 +0200
In-Reply-To: <87simkaazt.fsf@HIDDEN> (Juri Linkov's message of "Wed,
 02 Jul 2014 02:37:10 +0300")
Message-ID: <87o8cn71us.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Juri Linkov <juri@HIDDEN> writes: >> (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 " [...] 
 Content analysis details:   (-1.8 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL
 blocklist [URIs: jurta.org]
 1.0 URIBL_SBL Contains an URL's NS IP listed in the Spamhaus SBL
 blocklist [URIs: jurta.org]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 6000
Cc: martin rudalics <rudalics@HIDDEN>, 6000 <at> debbugs.gnu.org,
 Lennart Borgman <lennart.borgman@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.0 (-)

Juri Linkov <juri@HIDDEN> writes:

>>    (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))

This sounds like a good idea to me, but there wasn't a recipe to
reproduce whatever error this bug report was talking about, so I can't
test.

Does anybody have a test case that displays the problem (in case it's
still in place after all these years)?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

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: Sun, 4 Jul 2021 15:00:01 UTC

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