Subject: bug#71533: closed (Re: bug#71533: 30.0.50; [PATCH] Calc: fix calc-trail-here on initial line of trail.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 15 Jun 2024 11:03:02 +0000

Your bug report

#71533: 30.0.50; [PATCH] Calc: fix calc-trail-here on initial line of trail.

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
71533: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71533
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#71533: 30.0.50; [PATCH] Calc: fix calc-trail-here on initial line of trail.
From: Eli Zaretskii <[email-masked]>
To: Ashwin Kafle <[email-masked]>
Cc: [email-masked]
Date: Sat, 15 Jun 2024 14:02:04 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Ashwin Kafle <[email-masked]>
> Date: Thu, 13 Jun 2024 10:33:20 +0000
> 
> On Calc-trail, you cannot access the first element of trail using ``t
> ['' or going to the first line and doing (calc-trail-here). This is
> because the check of empty buffer has small error.
> 
> Attached is a simple fix for that.

Thanks, installed on the master branch, and closing the bug.

Subject: 30.0.50; [PATCH] Calc: fix calc-trail-here on initial line of trail.
From: Ashwin Kafle <[email-masked]>
To: [email-masked]
Date: Thu, 13 Jun 2024 10:33:20 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

On Calc-trail, you cannot access the first element of trail using ``t
['' or going to the first line and doing (calc-trail-here). This is
because the check of empty buffer has small error.

Attached is a simple fix for that.
>From ea1822bf39aa5236368567f067064b1a2c2c6361 Mon Sep 17 00:00:00 2001
From: Ashwin Kafle <[email-masked]>
Date: Thu, 13 Jun 2024 16:06:38 +0545
Subject: [PATCH] Fix calc-trail-here for first line of trail.

* lisp/calc/calc.el(calc-trail-here): change 'or' to 'and'
since (bobp) return true even if the buffer is not empty.
---
 lisp/calc/calc.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index e6448625cee..f92e4958e33 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -2184,7 +2184,7 @@ calc-trail-here
 	(beginning-of-line)
 	(if (eobp)
             (forward-line -1))
-	(if (or (bobp) (eobp))
+	(if (and (bobp) (eobp))
 	    (setq overlay-arrow-position nil)   ; trail is empty
 	  (set-marker calc-trail-pointer (point) (current-buffer))
 	  (setq calc-trail-overlay (concat (buffer-substring (point)
-- 
2.45.1

Cheers!