Subject: Re: bug#70765: 30.0.50; srecode-all-template-hash in lisp/cedet/srecode/find.el

From: Charalampos Mitrodimas <[email-masked]>
Date: Sat, 4 May 2024 20:11:53 +0000

Hi Pierre,

On 4/5/24 7:37 AM, Pierre L. Nageoire wrote:
> Hi,
>
> Last line of this function code is mhash)))) and should most probably be
> ))mhas)) otherwise the method always returns nil making the whole
> srecode system unusable.

You're correct, the function did not return the data it was supposed to 
due to the misplaced parenthesis, instead, it was always returning "nil".

Patch attached.

>
> Implementation was different in 29.0.50 and has been changed. I suspect
> it has been bugged as well ! Sory if I am wrong

I didn't go back in history to verify this, but you might be right.

         C. Mitrodimas

From a6023c8a8069178965e88d9dc9c0a81f811cbe46 Mon Sep 17 00:00:00 2001
From: Charalampos Mitrodimas <[email-masked]>
Date: Sat, 4 May 2024 22:45:15 +0300
Subject: [PATCH] Fix srecode-all-template-hash always returning nil

The issue was that the function always returned nil because the closing
parentheses were in the wrong position. This meant that the function
couldn't give back the data it was supposed to, making the whole srecode
system not work properly.

By moving the parentheses to the correct place, the function now returns
a hash table with all the templates it finds.

* lisp/cedet/srecode/find.el (srecode-all-template-hash): Adjusted the
position of closing parentheses so that the mhash variable is returned
correctly. (Bug#70765)
---
 lisp/cedet/srecode/find.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/cedet/srecode/find.el b/lisp/cedet/srecode/find.el
index 41030aa6944..db6b3988562 100644
--- a/lisp/cedet/srecode/find.el
+++ b/lisp/cedet/srecode/find.el
@@ -233,8 +233,8 @@ srecode-all-template-hash
 		     (when (or (not predicate)
 			       (funcall predicate temp))
 		       (puthash key temp mhash)))
-		   (oref tab namehash))))
-      mhash))))
+		   (oref tab namehash))))))
+      mhash))
 
 (defun srecode-calculate-default-template-string (hash)
   "Calculate the name of the template to use as a DEFAULT.
-- 
2.39.3 (Apple Git-146)