aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2024-01-11 01:21:14 +0200
committerDmitry Gutov2024-01-11 01:21:41 +0200
commit1ecb53ad2fc9888ce0d0073c8fc3f36d63394dcd (patch)
treee139f90374e63f103a675fe45d01ffed2cc4586e
parent6a645cd53289853bc2239657d2b0bb6384875903 (diff)
downloademacs-1ecb53ad2fc9888ce0d0073c8fc3f36d63394dcd.tar.gz
emacs-1ecb53ad2fc9888ce0d0073c8fc3f36d63394dcd.zip
vc-log-mergebase: Fix the printing of buttons at the bottom
* lisp/vc/vc.el (vc-print-log-setup-buttons): Fix when LIMIT is a string (bug#68364). (vc-print-log-internal): Update docstring.
-rw-r--r--lisp/vc/vc.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index b8cc44fc3dc..94bc3f0911a 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2703,20 +2703,22 @@ Not all VC backends support short logs!")
2703(defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return) 2703(defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return)
2704 "Insert at the end of the current buffer buttons to show more log entries. 2704 "Insert at the end of the current buffer buttons to show more log entries.
2705In the new log, leave point at WORKING-REVISION (if non-nil). 2705In the new log, leave point at WORKING-REVISION (if non-nil).
2706LIMIT is the current maximum number of entries shown. Does 2706LIMIT is the current maximum number of entries shown, or the
2707nothing if IS-START-REVISION is non-nil and LIMIT is 1, or if 2707revision (string) before which to stop. Does nothing if
2708LIMIT is nil, or if PL-RETURN is `limit-unsupported'." 2708IS-START-REVISION is non-nil and LIMIT is 1, or if LIMIT is nil,
2709or if PL-RETURN is `limit-unsupported'."
2709 ;; LIMIT=1 is set by vc-annotate-show-log-revision-at-line 2710 ;; LIMIT=1 is set by vc-annotate-show-log-revision-at-line
2710 ;; or by vc-print-root-log with current-prefix-arg=1. 2711 ;; or by vc-print-root-log with current-prefix-arg=1.
2711 ;; In either case only one revision is wanted, no buttons. 2712 ;; In either case only one revision is wanted, no buttons.
2712 (when (and limit (not (eq 'limit-unsupported pl-return)) 2713 (when (and limit (not (eq 'limit-unsupported pl-return))
2713 (not (and is-start-revision 2714 (not (and is-start-revision
2714 (= limit 1)))) 2715 (eql limit 1))))
2715 (let ((entries 0)) 2716 (let ((entries 0))
2716 (goto-char (point-min)) 2717 (goto-char (point-min))
2717 (while (re-search-forward log-view-message-re nil t) 2718 (while (re-search-forward log-view-message-re nil t)
2718 (cl-incf entries)) 2719 (cl-incf entries))
2719 (if (< entries limit) 2720 (if (or (stringp limit)
2721 (< entries limit))
2720 ;; The log has been printed in full. Perhaps it started 2722 ;; The log has been printed in full. Perhaps it started
2721 ;; with a copy or rename? 2723 ;; with a copy or rename?
2722 ;; FIXME: We'd probably still want this button even when 2724 ;; FIXME: We'd probably still want this button even when
@@ -2811,7 +2813,8 @@ button for. Same for CURRENT-REVISION. LIMIT means the usual."
2811Leave point at WORKING-REVISION, if it is non-nil. 2813Leave point at WORKING-REVISION, if it is non-nil.
2812If IS-START-REVISION is non-nil, start the log from WORKING-REVISION 2814If IS-START-REVISION is non-nil, start the log from WORKING-REVISION
2813\(not all backends support this); i.e., show only WORKING-REVISION and 2815\(not all backends support this); i.e., show only WORKING-REVISION and
2814earlier revisions. Show up to LIMIT entries (non-nil means unlimited)." 2816earlier revisions. Show up to LIMIT entries (non-nil means unlimited).
2817LIMIT can also be a string, which means the revision before which to stop."
2815 ;; Don't switch to the output buffer before running the command, 2818 ;; Don't switch to the output buffer before running the command,
2816 ;; so that any buffer-local settings in the vc-controlled 2819 ;; so that any buffer-local settings in the vc-controlled
2817 ;; buffer can be accessed by the command. 2820 ;; buffer can be accessed by the command.