[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e154c81c0bf 1/3: Show buttons below vc-log even when REVISION is
From: |
Dmitry Gutov |
Subject: |
master e154c81c0bf 1/3: Show buttons below vc-log even when REVISION is specified |
Date: |
Fri, 15 Dec 2023 19:34:55 -0500 (EST) |
branch: master
commit e154c81c0bfcd2159a3c86e53d7281dfd5797088
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
Show buttons below vc-log even when REVISION is specified
E.g. in the vc-print-branch-log which specifies start revision.
* lisp/vc/vc.el (vc-print-log-internal): Remove outdated comment.
(vc-print-log-setup-buttons): Only special-case non-nil
IS-START-REVISION when LIMIT=1. We often do need buttons for logs
that start with a particular revision, because those are still limited
by vc-log-show-limit.
---
lisp/vc/vc.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 3689dcb9b27..1234424a8d9 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2693,11 +2693,15 @@ Not all VC backends support short logs!")
(defun vc-print-log-setup-buttons (working-revision is-start-revision limit
pl-return)
"Insert at the end of the current buffer buttons to show more log entries.
In the new log, leave point at WORKING-REVISION (if non-nil).
-LIMIT is the number of entries currently shown.
-Does nothing if IS-START-REVISION is non-nil, or if LIMIT is nil,
-or if PL-RETURN is `limit-unsupported'."
+LIMIT is the current maximum number of entries shown. Does
+nothing if IS-START-REVISION is non-nil and LIMIT is 1, or if
+LIMIT is nil, or if PL-RETURN is `limit-unsupported'."
+ ;; LIMIT=1 is set by vc-annotate-show-log-revision-at-line
+ ;; or by vc-print-root-log with current-prefix-arg=1.
+ ;; In either case only one revision is wanted, no buttons.
(when (and limit (not (eq 'limit-unsupported pl-return))
- (not is-start-revision))
+ (not (and is-start-revision
+ (= limit 1))))
(let ((entries 0))
(goto-char (point-min))
(while (re-search-forward log-view-message-re nil t)
@@ -2770,9 +2774,6 @@ Leave point at WORKING-REVISION, if it is non-nil.
If IS-START-REVISION is non-nil, start the log from WORKING-REVISION
\(not all backends support this); i.e., show only WORKING-REVISION and
earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
- ;; As of 2013/04 the only thing that passes IS-START-REVISION non-nil
- ;; is vc-annotate-show-log-revision-at-line, which sets LIMIT = 1.
-
;; Don't switch to the output buffer before running the command,
;; so that any buffer-local settings in the vc-controlled
;; buffer can be accessed by the command.