Subject: Re: bug#34513: display-line-numbers in term mode

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 20 Sep 2020 21:56:54 +0200

Eli Zaretskii <[email-masked]> writes:

> Not even if you call line-number-display-width with arg of 'columns'?

Yes, this works -- the Emacs-in-Emacs displays perfectly with this patch:

diff --git a/lisp/window.el b/lisp/window.el
index f1ee87aad2..72957d846a 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2172,7 +2172,8 @@ window-max-chars-per-line
   (with-selected-window (window-normalize-window window t)
     (let* ((window-width (window-body-width window t))
 	   (font-width (window-font-width window face))
-	   (ncols (/ window-width font-width)))
+	   (ncols (- (/ window-width font-width)
+                     (line-number-display-width 'columns))))
       (if (and (display-graphic-p)
 	       overflow-newline-into-fringe
                (not

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