Eli Zaretskii writes: >> Date: Sat, 28 Dec 2024 22:15:28 +0100 >> From: Arsen Arsenović via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> Reproduction steps: >> 1. emacs -Q >> 2. M-x display-line-numbers-mode RET >> 3. M-x ruler-mode RET >> 4. C-x C-+ C-+ C-+ C-+ >> >> You should notice that the ruler is misaligned. > > Ruler mode doesn't work well with text-scale, as the comment there says. > >> I've hotfixed this in my running Emacs by applying: >> >> modified lisp/ruler-mode.el >> @@ -636,7 +636,7 @@ ruler-mode-ruler >> ;; FIXME: ruler-mode relies on I being an integer, so >> ;; the column numbers might be slightly off if the >> ;; line-number face is customized. >> - (round (line-number-display-width 'columns)) >> + (+ (round (line-number-display-width)) 2) >> 0)) >> (j (ruler-mode-text-scaled-window-hscroll)) >> ;; Setup the scrollbar, fringes, and margins areas. >> >> ... and re-evaling the ruler-mode-ruler defun. >> >> Per the line-number-display-width doc, when it is called with 'columns, >> it returns the number of columns in the frames canonical font size, but >> that's not the font size that is used for the fringes: the fringes seem >> to use the font the buffer is using, at least after text-scale-mode does >> its thing. > > I'm not sure I understand what you mean by "fringes seem to use the > font the buffer is using". When I type "C-x C-+ C-+...", the fringes > stay at their original width. Do you see something different? Hm, yes, fringe might be the wrong word. I am referring to the column where the ruler and line number are, which I've outlined in red: