aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-12-17 13:20:50 +0000
committerSean Whitton2025-12-17 13:20:50 +0000
commit6d7ff7478fcbc4af478d198babbb76ec49ee3780 (patch)
treedab3645bbd44929cb3d1b84bb1e4193fc7e16db1
parentb7601bfb70ee06e7ed97c5f80bfc8c8e0dd80d6c (diff)
downloademacs-6d7ff7478fcbc4af478d198babbb76ec49ee3780.tar.gz
emacs-6d7ff7478fcbc4af478d198babbb76ec49ee3780.zip
; Log View beg and end of defun functions: Style improvements.
-rw-r--r--lisp/vc/log-view.el38
1 files changed, 18 insertions, 20 deletions
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 504989a9dd6..752638b4fda 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -530,28 +530,27 @@ to the beginning of the ARGth following entry.
530This is Log View mode's default `beginning-of-defun-function'. 530This is Log View mode's default `beginning-of-defun-function'.
531It assumes that a log entry starts with a line matching 531It assumes that a log entry starts with a line matching
532`log-view-message-re'." 532`log-view-message-re'."
533 (when (null arg) (setf arg 1)) 533 (when (null arg) (setq arg 1))
534 (if (< arg 0) 534 (if (minusp arg)
535 ;; In log view, the end of one defun is the beginning of the 535 ;; In log view, the end of one defun is the beginning of the
536 ;; next, so punting to log-view-end-of-defun is safe in this 536 ;; next, so punting to log-view-end-of-defun is safe in this
537 ;; context. 537 ;; context.
538 (log-view-end-of-defun (- arg)) 538 (log-view-end-of-defun (- arg))
539 (let ((found t)) 539 (let ((found t))
540 (while (> arg 0) 540 (while (plusp arg)
541 (setf arg (1- arg)) 541 (decf arg)
542 (let ((cur-start (log-view-current-entry))) 542 (let ((cur-start (log-view-current-entry)))
543 (setf found 543 (setq found (cond ((null cur-start)
544 (cond ((null cur-start) 544 (goto-char (point-min))
545 (goto-char (point-min)) 545 nil)
546 nil) 546 ((>= (car cur-start) (point))
547 ((>= (car cur-start) (point)) 547 (unless (bobp)
548 (unless (bobp) 548 (forward-line -1)
549 (forward-line -1) 549 (incf arg))
550 (setf arg (1+ arg))) 550 nil)
551 nil) 551 (t
552 (t 552 (goto-char (car cur-start))
553 (goto-char (car cur-start)) 553 t)))))
554 t)))))
555 found))) 554 found)))
556 555
557(defun log-view-end-of-defun-1 () 556(defun log-view-end-of-defun-1 ()
@@ -578,12 +577,11 @@ It assumes that a log entry starts with a line matching
578(defun log-view-end-of-defun (&optional arg) 577(defun log-view-end-of-defun (&optional arg)
579 "Move forward to the next Log View entry. 578 "Move forward to the next Log View entry.
580Works like `end-of-defun'." 579Works like `end-of-defun'."
581 (when (null arg) (setf arg 1)) 580 (when (null arg) (setq arg 1))
582 (if (< arg 0) 581 (if (minusp arg)
583 (log-view-beginning-of-defun (- arg)) 582 (log-view-beginning-of-defun (- arg))
584 (dotimes (_n arg) 583 (dotimes (_n arg)
585 (log-view-end-of-defun-1) 584 (log-view-end-of-defun-1))))
586 t)))
587 585
588(defvar cvs-minor-current-files) 586(defvar cvs-minor-current-files)
589(defvar cvs-branch-prefix) 587(defvar cvs-branch-prefix)