bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6000: describe-text-sexp does not know window-width


From: Lars Ingebrigtsen
Subject: bug#6000: describe-text-sexp does not know window-width
Date: Sun, 06 Jun 2021 11:03:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

martin rudalics <rudalics@gmx.at> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]