mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Fix fontification in short unintegrated changes logs (bug#81215)
Do not merge to master. * lisp/vc/vc.el (vc--shortlog): New variable. (vc-print-log-internal): * lisp/vc/vc-git.el (vc-git-log-view-mode): * lisp/vc/vc-hg.el (vc-hg-log-view-mode): Use it.
This commit is contained in:
parent
7b23e17eb8
commit
2c6a03b08c
3 changed files with 20 additions and 6 deletions
|
|
@ -1975,17 +1975,22 @@ log entries."
|
||||||
(setq-local log-view-file-re regexp-unmatchable)
|
(setq-local log-view-file-re regexp-unmatchable)
|
||||||
(setq-local log-view-per-file-logs nil)
|
(setq-local log-view-per-file-logs nil)
|
||||||
(setq-local log-view-message-re
|
(setq-local log-view-message-re
|
||||||
(if (not (memq vc-log-view-type '(long log-search with-diff)))
|
(if (if (eq vc-log-view-type 'log-unintegrated)
|
||||||
|
vc--shortlog
|
||||||
|
(not (memq vc-log-view-type '(long log-search with-diff))))
|
||||||
(cadr vc-git-root-log-format)
|
(cadr vc-git-root-log-format)
|
||||||
"^commit +\\([0-9a-z]+\\)"))
|
"^commit +\\([0-9a-z]+\\)"))
|
||||||
;; Allow expanding short log entries.
|
;; Allow expanding short log entries.
|
||||||
(when (memq vc-log-view-type
|
(when (if (eq vc-log-view-type 'log-unintegrated)
|
||||||
'(short log-outgoing log-incoming log-unintegrated mergebase))
|
vc--shortlog
|
||||||
|
(memq vc-log-view-type '(short log-outgoing log-incoming mergebase)))
|
||||||
(setq truncate-lines t)
|
(setq truncate-lines t)
|
||||||
(setq-local log-view-expanded-log-entry-function
|
(setq-local log-view-expanded-log-entry-function
|
||||||
'vc-git-expanded-log-entry))
|
'vc-git-expanded-log-entry))
|
||||||
(setq-local log-view-font-lock-keywords
|
(setq-local log-view-font-lock-keywords
|
||||||
(if (not (memq vc-log-view-type '(long log-search with-diff)))
|
(if (if (eq vc-log-view-type 'log-unintegrated)
|
||||||
|
vc--shortlog
|
||||||
|
(not (memq vc-log-view-type '(long log-search with-diff))))
|
||||||
(list (cons (nth 1 vc-git-root-log-format)
|
(list (cons (nth 1 vc-git-root-log-format)
|
||||||
(nth 2 vc-git-root-log-format)))
|
(nth 2 vc-git-root-log-format)))
|
||||||
(append
|
(append
|
||||||
|
|
|
||||||
|
|
@ -471,8 +471,9 @@ the log starting from that revision."
|
||||||
|
|
||||||
(define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View"
|
(define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View"
|
||||||
(require 'add-log) ;; we need the add-log faces
|
(require 'add-log) ;; we need the add-log faces
|
||||||
(let ((shortp (memq vc-log-view-type
|
(let ((shortp (if (eq vc-log-view-type 'log-unintegrated)
|
||||||
'(short log-incoming log-outgoing log-unintegrated))))
|
vc--shortlog
|
||||||
|
(memq vc-log-view-type '(short log-incoming log-outgoing)))))
|
||||||
(setq-local log-view-file-re regexp-unmatchable)
|
(setq-local log-view-file-re regexp-unmatchable)
|
||||||
(setq-local log-view-per-file-logs nil)
|
(setq-local log-view-per-file-logs nil)
|
||||||
(setq-local log-view-message-re
|
(setq-local log-view-message-re
|
||||||
|
|
|
||||||
|
|
@ -4309,6 +4309,13 @@ button for. Same for CURRENT-REVISION. LIMIT means the usual."
|
||||||
"Show the log for the file name(s) %s the rename"
|
"Show the log for the file name(s) %s the rename"
|
||||||
before-after))))
|
before-after))))
|
||||||
|
|
||||||
|
(defvar-local vc--shortlog nil
|
||||||
|
"Whether this is a shortlog.
|
||||||
|
This is a hack to fix bug#81215 which came up after the Emacs 31 freeze.
|
||||||
|
For Emacs 32 that bug is fixed by replacing `vc-log-view-type' with
|
||||||
|
`vc-log-view-types'.")
|
||||||
|
(put 'vc--shortlog 'permanent-local t)
|
||||||
|
|
||||||
(defun vc-print-log-internal (backend files working-revision
|
(defun vc-print-log-internal (backend files working-revision
|
||||||
&optional is-start-revision limit type)
|
&optional is-start-revision limit type)
|
||||||
"For specified BACKEND and FILES, show the VC log.
|
"For specified BACKEND and FILES, show the VC log.
|
||||||
|
|
@ -4328,6 +4335,7 @@ LIMIT can also be a string, which means the revision before which to stop."
|
||||||
(vc-log-internal-common
|
(vc-log-internal-common
|
||||||
backend buffer-name files type
|
backend buffer-name files type
|
||||||
(lambda (bk buf _type-arg files-arg)
|
(lambda (bk buf _type-arg files-arg)
|
||||||
|
(with-current-buffer buf (setq-local vc--shortlog shortlog))
|
||||||
(vc-call-backend bk 'print-log files-arg buf shortlog
|
(vc-call-backend bk 'print-log files-arg buf shortlog
|
||||||
(when is-start-revision working-revision) limit)
|
(when is-start-revision working-revision) limit)
|
||||||
(when log-view-vc-prev-fileset
|
(when log-view-vc-prev-fileset
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue