[Top][All Lists]

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

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

From: Stefan Monnier
Subject: Re: Line height issues with display-line-number-mode
Date: Tue, 07 May 2019 16:30:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> Rather than try and guess it based on the presence of a display/overlay,
>> maybe we could require a specific text-property like `no-line-number`?
> We already have such a text property (display-line-number-disable),
> but it cannot help here,

But it *can* help for the *vc-log* case, tho it's a bit cumbersome, see
patch below.  Also the line then runs not just through the text but also
through the line-number-area (I guess that's OK, but that's not the
behavior I was expecting).


diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index 1ae219eed5..1cf58b994c 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -383,7 +383,8 @@ log-edit-font-lock-keywords
          nil lax))
       (progn (goto-char (match-end 0)) (1+ (match-end 0))) nil
-      (0 '(:height 0.1 :inverse-video t))))
+      (0 '(face (:height 0.1 :inverse-video t)
+           display-line-numbers-disable t rear-nonsticky t))))
     (log-edit--match-first-line (0 'log-edit-summary))))
 (defvar log-edit-font-lock-gnu-style nil
@@ -487,6 +488,9 @@ log-edit-mode
   (set (make-local-variable 'font-lock-defaults)
        '(log-edit-font-lock-keywords t))
+  (make-local-variable 'font-lock-extra-managed-props)
+  (cl-pushnew 'rear-nonsticky font-lock-extra-managed-props)
+  (cl-pushnew 'display-line-numbers-disable font-lock-extra-managed-props)
   (setq-local jit-lock-contextually t)  ;For the "first line is summary".
   (make-local-variable 'log-edit-comment-ring-index)
   (add-hook 'kill-buffer-hook 'log-edit-remember-comment nil t)

reply via email to

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