all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, Noam Postavsky <npostavs@gmail.com>,
	monnier@iro.umontreal.ca
Subject: Re: Line height issues with display-line-number-mode
Date: Fri, 10 May 2019 08:15:36 +0200	[thread overview]
Message-ID: <87pnoq6div.fsf@gmail.com> (raw)
In-Reply-To: <83h8a4hj5d.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 May 2019 21:54:06 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> Maybe we should simply add a feature that would allow display of a
> thin line across the window.  Then all of the problems we discussed
> will just go away.

There does seem to several use-cases for this feature (in addition to
Clément's), where it is emulated in various ways each, having its own
deficiencies.

I don't think I saw a post in this thread cataloguing all of these
methods (though most of them have been mentioned), so for the record, if
it helps anyone:

- describe-symbol

    (insert "\n\n"
            (eval-when-compile
              (propertize "\n" 'face '(:height 0.1 :inverse-video t)))
            "\n")

- custom-group-value-create

    ;; Draw a horizontal line (this works for both graphical
    ;; and text displays):
    (let ((p (point)))
      (insert "\n")
      (put-text-property p (1+ p) 'face '(:underline t))
      (overlay-put (make-overlay p (1+ p))
                   'before-string
                   (propertize "\n" 'face '(:underline t)
                               'display '(space :align-to 999))))

- log-edit-font-lock-keywords

    (0 '(:height 0.1 :inverse-video t))

On MELPA:

- magit-blame--format-separator
  https://github.com/magit/magit/blob/master/lisp/magit-blame.el

    (concat (propertize "\s" 'display '(space :height (2)))
            (propertize "\n" 'line-height t))

- transient--show
  https://github.com/magit/transient/blob/master/lisp/transient.el

    (insert (propertize "__" 'face 'transient-separator
                        'display '(space :height (1))))
    (insert (propertize "\n" 'face 'transient-separator 'line-height t)))

- page-break-lines.el
  https://github.com/purcell/page-break-lines/blob/master/page-break-lines.el

    (let ((default-height (face-attribute 'default :height nil 'default)))
      (set-face-attribute 'page-break-lines nil :height default-height)
      (let* ((cwidth (char-width page-break-lines-char))
             (wwidth-pix (- (window-width nil t)
                            (if (bound-and-true-p display-line-numbers)
                                (line-number-display-width t)
                              0)))
             (width (- (/ wwidth-pix (frame-char-width) cwidth)
                       (if (display-graphic-p) 0 1)))
             (glyph (make-glyph-code page-break-lines-char 'page-break-lines))
             (new-display-entry (vconcat (make-list width glyph))))
        (unless (equal new-display-entry (elt buffer-display-table ?\^L))
          (aset buffer-display-table ?\^L new-display-entry))))

- form-feed.el
  https://github.com/wasamasa/form-feed/blob/master/form-feed.el

(The latter two are both packages for displaying ^L as thin lines; I
wasn't sure which sections of form-feed would be relevant to include.)

FWIW, page-break-lines does seem to behave correctly when
display-line-numbers is enabled; not sure how applicable its method is
in the general case.



  reply	other threads:[~2019-05-10  6:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 16:40 Line height issues with display-line-number-mode Clément Pit-Claudel
2019-05-07 17:12 ` Noam Postavsky
2019-05-07 18:36   ` Eli Zaretskii
2019-05-07 19:00     ` Eli Zaretskii
2019-05-07 19:09       ` Stefan Monnier
2019-05-07 19:43         ` Eli Zaretskii
2019-05-07 20:30           ` Stefan Monnier
2019-05-08  6:43             ` Eli Zaretskii
2019-05-08 13:39               ` Stefan Monnier
2019-05-08 14:05                 ` Eli Zaretskii
2019-05-08 14:13                   ` Noam Postavsky
2019-05-08 15:04                     ` Stefan Monnier
2019-05-08 18:39                       ` Noam Postavsky
2019-05-08 18:54                         ` Eli Zaretskii
2019-05-10  6:15                           ` Kévin Le Gouguec [this message]
2019-05-10  7:58                             ` Eli Zaretskii
2019-05-10 13:24                             ` Stefan Monnier
2019-05-08 14:17                   ` Stefan Monnier
2019-05-08 17:30                     ` Eli Zaretskii
2019-05-08 17:46                       ` Stefan Monnier
2019-05-08 18:02                         ` Eli Zaretskii
2019-05-08 18:39                           ` Stefan Monnier
2019-05-08 18:48                             ` Eli Zaretskii
2019-05-08 19:03                               ` Stefan Monnier
2019-05-07 19:49         ` Ergus
2019-05-08  5:51           ` Eli Zaretskii
2019-05-08 13:40             ` Stefan Monnier
2019-05-08 14:07               ` Eli Zaretskii
2019-05-07 18:31 ` Eli Zaretskii
2019-05-07 21:08   ` Clément Pit-Claudel
2019-05-08  7:01     ` Eli Zaretskii
2019-05-08 12:24       ` Clément Pit-Claudel
2019-05-08 14:00         ` Eli Zaretskii
2019-05-08 18:04           ` Clément Pit-Claudel
2019-05-08 18:25             ` Eli Zaretskii
2019-05-08 18:45             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnoq6div.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.