Subject: bug#79402: [PATCH] Fix focusing the first line of calc trail

From: Wojciech Siewierski <[email-masked]>
Date: Sun, 07 Sep 2025 16:21:03 +0200

Tags: patch

As of GNU Emacs 30.2 calc-trail-first focuses the second calc-trail
line, not the first one.  It's caused by the no longer correct
assumption that the first line contains a header (now handled with
header-line-format since Emacs 28.1).  This is closely related to
bug#77816 (already merged).

I'm attaching a patch.

>From 7e1e0dcfe885d823e0d9e0b0796dfebc2105dfc5 Mon Sep 17 00:00:00 2001
From: Wojciech Siewierski <[email-masked]>
Date: Sun, 7 Sep 2025 16:02:20 +0200
Subject: [PATCH] Fix focusing the first line of calc trail

* lisp/calc/calc-trail.el (calc-trail-first): Fix an off by one error
introduced when the in-buffer header line got replaced with
header-line-format.  Closely related to Bug#77816
---
 lisp/calc/calc-trail.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calc/calc-trail.el b/lisp/calc/calc-trail.el
index 433d3983b12..7bbf5e508b8 100644
--- a/lisp/calc/calc-trail.el
+++ b/lisp/calc/calc-trail.el
@@ -61,7 +61,7 @@
   (interactive "p")
   (calc-with-trail-buffer
    (goto-char (point-min))
-   (forward-line n)
+   (forward-line (1- n))
    (calc-trail-here)))
 
 (defun calc-trail-last (n)
-- 
2.51.0