]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/log-edit.el: Keep separator line thin even with line-numbers
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 12 Dec 2020 15:37:42 +0000 (10:37 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 12 Dec 2020 15:37:42 +0000 (10:37 -0500)
(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

index feafe5f5f0a3f989e2fa25ef143ce4450e56e88f..5f978daec021124b545b6a68a55cd5ee246bece4 100644 (file)
@@ -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)