Subject: bug#75310: closed (Re: bug#75310: Eliminate obsolete alias warning)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 04 Jan 2025 19:33:02 +0000

Your bug report

#75310: Eliminate obsolete alias warning

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].

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

Subject: Re: bug#75310: Eliminate obsolete alias warning
From: Yuan Fu <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], Peter Oliver <[email-masked]>
Date: Sat, 4 Jan 2025 11:31:44 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

> On Jan 4, 2025, at 11:27 AM, Yuan Fu <[email-masked]> wrote:
> 
> 
> 
>> On Jan 4, 2025, at 11:26 AM, Yuan Fu <[email-masked]> wrote:
>> 
>> 
>> 
>>> On Jan 4, 2025, at 12:29 AM, Eli Zaretskii <[email-masked]> wrote:
>>> 
>>>> From: Yuan Fu <[email-masked]>
>>>> Date: Fri, 3 Jan 2025 23:33:25 -0800
>>>> Cc: Peter Oliver <[email-masked]>,
>>>> [email-masked]
>>>> 
>>>>> On Jan 3, 2025, at 7:27 AM, Eli Zaretskii <[email-masked]> wrote:
>>>>> 
>>>>>> Date: Fri, 3 Jan 2025 14:47:53 +0000 (GMT)
>>>>>> From: Peter Oliver <[email-masked]>
>>>>>> cc: [email-masked]
>>>>>> 
>>>>>> On Fri, 3 Jan 2025, Eli Zaretskii wrote:
>>>>>> 
>>>>>>> IOW, can you show a minimal recipe for reproducing the problem,
>>>>>>> starting from "emacs -Q"?
>>>>>> 
>>>>>> $ src/emacs -Q --batch --eval "(progn (message emacs-version) (require 'cl) (require 'treesit))"
>>>>>> 31.0.50
>>>>>> Package cl is deprecated
>>>>>> lisp/treesit.el: Warning: ‘loop’ is an obsolete alias (as of 27.1); use ‘cl-loop’ instead.
>>>>> 
>>>>> Thanks.
>>>>> 
>>>>> Yuan, I think it would be good to rename 'loop' there to some other
>>>>> name, do you agree?
>>>> 
>>>> I would definitely agree. I’ve always used cl-loop (and now I try to not use it for new code). The only instance of “loop” I can find in treesit.el is in a named-let in treesit-transpose-sexps wriiten by Theo, and it’s not the CL loop but a local function defined by named-let. I wanted to rewrite it so it doesn’t use named-let because it’s not very readable, but tbh I haven’t find the time to understand that function well enough to rewrite it (because it’s not very readable :-)
>>>> 
>>>> It could be that only I can’t understand it, but code should be simple enough that even I can understand ;-)
>>> 
>>> Renaming the symbol is easy, and doesn't require you to understand the
>>> code completely.  We don't have to use cl-loop.
>> 
>> Ah right, duh :-) Though I renamed the symbol and still gets the deprecation message. There’s no other “loop” in treesit.el, only cl-loop. Could you maybe take a look?
> 
> Never mind, the deprecation message is from requiring cl. The obsolete alias error is fixed by renaming the symbol.
> 
> Yuan

Never mind × 2 :-) Juri just modified treesit-transpose-sexp so it doesn’t contain “loop” anymore.

Yuan

Subject: Eliminate obsolete alias warning
From: Peter Oliver <[email-masked]>
To: [email-masked]
Date: Fri, 3 Jan 2025 11:41:46 +0000 (GMT)
List-Id: <debbugs-submit.debbugs.gnu.org>

A patch is attached to eliminate a warning in lisp/treesit.el.

-- 
Peter Oliver

From 2a57f0e8b84ea8c99627b2e576cf71386f7c8aa6 Mon Sep 17 00:00:00 2001
From: Peter Oliver <[email-masked]>
Date: Fri, 3 Jan 2025 11:36:16 +0000
Subject: [PATCH] Eliminate obsolete alias warning

* lisp/treesit.el (treesit-transpose-sexps): Replace obsolete alias loop
  with cl-loop
---
 lisp/treesit.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index f3c553fdb8f..05ca6b93585 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2648,7 +2648,7 @@ treesit-transpose-sexps
                               parent (+ arg (treesit-node-index prev t)) t)))
                 (cons (treesit-node-end n)
                       (treesit-node-start n))))
-          (loop (treesit-node-next-sibling prev t)
+          (cl-loop (treesit-node-next-sibling prev t)
                 (treesit-node-next-sibling next t)))))))
 
 ;;; Navigation, defun, things
-- 
2.47.1