emacs-devel
[Top][All Lists]
Advanced

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

Re: Line height issues with display-line-number-mode


From: Noam Postavsky
Subject: Re: Line height issues with display-line-number-mode
Date: Wed, 8 May 2019 10:13:36 -0400

On Wed, 8 May 2019 at 10:06, Eli Zaretskii <address@hidden> wrote:
>
> > From: Stefan Monnier <address@hidden>
> > Cc: address@hidden
> > Date: Wed, 08 May 2019 09:39:58 -0400
> >
> > > Btw, any reasons (other than "because we can") why we use these
> > > tricks, instead of actually producing an underline?
> >
> > Not sure what "producing an underline" means concretely.
>
> Using the 'underline' face, obviously.

We tried this in magit, getting the line to extend to the edge of the
window is not so obvious. But we did get something working in the end.
Here it is as a patch against describe-symbol:

--- i/lisp/help-fns.el
+++ w/lisp/help-fns.el
@@ -1257,7 +1257,17 @@ describe-symbol
                            (progn (skip-chars-backward " \t\n") (point)))
             (insert "\n\n"
                     (eval-when-compile
-                      (propertize "\n" 'face '(:height 0.1 :inverse-video t)))
+                      (propertize
+                       "\n" 'face '(:underline t)
+                       'display `(space
+                                  :align-to
+                                  (+ (0 . right)
+                                     ,(min (window-hscroll)
+                                           (- (line-end-position)
+                                              (line-beginning-position)))))
+                       ;; This prevents the cursor from being rendered at the
+                       ;; edge of the window.
+                       'cursor t))
                     "\n")
             (when name
               (insert (symbol-name symbol)



reply via email to

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