GNU bug report logs -
#6000
describe-text-sexp does not know window-width
Previous Next
Full log
Message #8 received at 6000 <at> debbugs.gnu.org (full text, mbox):
> 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))
This bug report was last modified 3 years and 344 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.