all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: 6000@debbugs.gnu.org
Subject: bug#6000: describe-text-sexp does not know window-width
Date: Wed, 02 Jul 2014 02:37:10 +0300	[thread overview]
Message-ID: <87simkaazt.fsf@mail.jurta.org> (raw)
In-Reply-To: <h2ye01d8a51004220515xa9578490nc6c05fba97e670c0@mail.gmail.com> (Lennart Borgman's message of "Thu, 22 Apr 2010 14:15:26 +0200")

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





  reply	other threads:[~2014-07-01 23:37 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 [this message]
2021-06-03  9:07   ` Lars Ingebrigtsen
2021-06-03 20:25     ` Juri Linkov
2021-06-04  9:18       ` martin rudalics
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

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

  git send-email \
    --in-reply-to=87simkaazt.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=6000@debbugs.gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.