unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Juri Linkov <juri@jurta.org>, Lars Ingebrigtsen <larsi@gnus.org>
Cc: Lennart Borgman <lennart.borgman@gmail.com>, 6000@debbugs.gnu.org
Subject: bug#6000: describe-text-sexp does not know window-width
Date: Fri, 4 Jun 2021 11:18:35 +0200	[thread overview]
Message-ID: <148710df-bd9c-0ddb-f00b-a2e429d600dd@gmx.at> (raw)
In-Reply-To: <87h7ie3isy.fsf@mail.linkov.net>

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





  reply	other threads:[~2021-06-04  9:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22 12:15 bug#6000: describe-text-sexp does not know window-width Lennart Borgman
2014-07-01 23:37 ` Juri Linkov
2021-06-03  9:07   ` Lars Ingebrigtsen
2021-06-03 20:25     ` Juri Linkov
2021-06-04  9:18       ` martin rudalics [this message]
2021-06-04  9:49         ` Lars Ingebrigtsen
2021-06-04 12:44           ` martin rudalics
2021-06-06  9:03             ` Lars Ingebrigtsen
2021-06-06  7:42       ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148710df-bd9c-0ddb-f00b-a2e429d600dd@gmx.at \
    --to=rudalics@gmx.at \
    --cc=6000@debbugs.gnu.org \
    --cc=juri@jurta.org \
    --cc=larsi@gnus.org \
    --cc=lennart.borgman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).