From a12fe07a8849da0fb68b7233cef839a6a60a6241 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 12 Dec 2020 10:37:42 -0500 Subject: [PATCH] * lisp/vc/log-edit.el: Keep separator line thin even with line-numbers (log-edit-font-lock-keywords): Disable line-number display on the thin separator line. (log-edit-mode): Adjust `font-lock-extra-managed-props` accordingly. (log-edit-changelog-entries): Don't use a nil buffer-local `change-log-default-name`. --- lisp/vc/log-edit.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index feafe5f5f0a..5f978daec02 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -387,7 +387,8 @@ The first subexpression is the actual text of the field.") nil lax)) ("^\n" (progn (goto-char (match-end 0)) (1+ (match-end 0))) nil - (0 '(:height 0.1 :inverse-video t :extend t)))) + (0 '(face (:height 0.1 :inverse-video t :extend 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 @@ -490,6 +491,9 @@ commands (under C-x v for VC, for example). \\{log-edit-mode-map}" (setq-local 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". (setq-local fill-paragraph-function #'log-edit-fill-entry) (make-local-variable 'log-edit-comment-ring-index) @@ -983,16 +987,17 @@ where LOGBUFFER is the name of the ChangeLog buffer, and each (visiting-buffer (find-buffer-visiting file))) ;; If there is a buffer visiting FILE, and it has a local ;; value for `change-log-default-name', use that. - (if (and visiting-buffer + (or (and visiting-buffer (local-variable-p 'change-log-default-name - visiting-buffer)) - (with-current-buffer visiting-buffer - change-log-default-name) - ;; `find-change-log' uses `change-log-default-name' if set - ;; and sets it before exiting, so we need to work around - ;; that memoizing which is undesired here. - (setq change-log-default-name nil) - (find-change-log))))) + visiting-buffer) + (with-current-buffer visiting-buffer + change-log-default-name)) + ;; `find-change-log' uses `change-log-default-name' if set + ;; and sets it before exiting, so we need to work around + ;; that memoizing which is undesired here. + (progn + (setq change-log-default-name nil) + (find-change-log)))))) (when (or (find-buffer-visiting changelog-file-name) (file-exists-p changelog-file-name) add-log-dont-create-changelog-file) -- 2.39.2