* bug#75310: Eliminate obsolete alias warning
@ 2025-01-03 11:41 Peter Oliver
2025-01-03 12:02 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Peter Oliver @ 2025-01-03 11:41 UTC (permalink / raw)
To: 75310
[-- Attachment #1: Type: text/plain, Size: 80 bytes --]
A patch is attached to eliminate a warning in lisp/treesit.el.
--
Peter Oliver
[-- Attachment #2: Type: text/plain, Size: 945 bytes --]
From 2a57f0e8b84ea8c99627b2e576cf71386f7c8aa6 Mon Sep 17 00:00:00 2001
From: Peter Oliver <git@mavit.org.uk>
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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-03 11:41 bug#75310: Eliminate obsolete alias warning Peter Oliver
@ 2025-01-03 12:02 ` Eli Zaretskii
2025-01-03 14:11 ` Peter Oliver
0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2025-01-03 12:02 UTC (permalink / raw)
To: Peter Oliver; +Cc: 75310
> Date: Fri, 3 Jan 2025 11:41:46 +0000 (GMT)
> From: Peter Oliver <p.d.oliver@mavit.org.uk>
>
> A patch is attached to eliminate a warning in lisp/treesit.el.
>
> From 2a57f0e8b84ea8c99627b2e576cf71386f7c8aa6 Mon Sep 17 00:00:00 2001
> From: Peter Oliver <git@mavit.org.uk>
> 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
I don't get any warning, and this 'loop' is not an obsolete alias:
(and (treesit-available-p)
(named-let loop ((res nil) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
(buffers (buffer-list)))
(if (null buffers)
(mapc (lambda (b)
(with-current-buffer b
(setq-local treesit-font-lock-level val)
(treesit-font-lock-recompute-features)
(treesit-font-lock-fontify-region (point-min)
(point-max))))
res)
(let ((buffer (car buffers)))
(with-current-buffer buffer
(if treesit-font-lock-settings
(loop (append res (list buffer)) (cdr buffers))
(loop res (cdr buffers)))))))))
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-03 12:02 ` Eli Zaretskii
@ 2025-01-03 14:11 ` Peter Oliver
2025-01-03 14:17 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Peter Oliver @ 2025-01-03 14:11 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 75310
On Fri, 3 Jan 2025, Eli Zaretskii wrote:
>> Date: Fri, 3 Jan 2025 11:41:46 +0000 (GMT)
>> From: Peter Oliver <p.d.oliver@mavit.org.uk>
>>
>> A patch is attached to eliminate a warning in lisp/treesit.el.
>>
>> From 2a57f0e8b84ea8c99627b2e576cf71386f7c8aa6 Mon Sep 17 00:00:00 2001
>> From: Peter Oliver <git@mavit.org.uk>
>> 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
>
> I don't get any warning, and this 'loop' is not an obsolete alias:
I see the warning with emacs -Q if I (require 'cl).
Apologies for the bad fix.
--
Peter Oliver
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-03 14:11 ` Peter Oliver
@ 2025-01-03 14:17 ` Eli Zaretskii
2025-01-03 14:47 ` Peter Oliver
0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2025-01-03 14:17 UTC (permalink / raw)
To: Peter Oliver; +Cc: 75310
> Date: Fri, 3 Jan 2025 14:11:00 +0000 (GMT)
> From: Peter Oliver <p.d.oliver@mavit.org.uk>
> cc: 75310@debbugs.gnu.org
>
> On Fri, 3 Jan 2025, Eli Zaretskii wrote:
>
> >> Date: Fri, 3 Jan 2025 11:41:46 +0000 (GMT)
> >> From: Peter Oliver <p.d.oliver@mavit.org.uk>
> >>
> >> A patch is attached to eliminate a warning in lisp/treesit.el.
> >>
> >> From 2a57f0e8b84ea8c99627b2e576cf71386f7c8aa6 Mon Sep 17 00:00:00 2001
> >> From: Peter Oliver <git@mavit.org.uk>
> >> 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
> >
> > I don't get any warning, and this 'loop' is not an obsolete alias:
>
> I see the warning with emacs -Q if I (require 'cl).
You get the warning when you load cl, or when you load treesit after
cl? Or something else?
IOW, can you show a minimal recipe for reproducing the problem,
starting from "emacs -Q"?
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-03 14:17 ` Eli Zaretskii
@ 2025-01-03 14:47 ` Peter Oliver
2025-01-03 15:27 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Peter Oliver @ 2025-01-03 14:47 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 75310
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
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.
--
Peter Oliver
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-03 14:47 ` Peter Oliver
@ 2025-01-03 15:27 ` Eli Zaretskii
2025-01-04 7:33 ` Yuan Fu
0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2025-01-03 15:27 UTC (permalink / raw)
To: Peter Oliver, Yuan Fu; +Cc: 75310
> Date: Fri, 3 Jan 2025 14:47:53 +0000 (GMT)
> From: Peter Oliver <p.d.oliver@mavit.org.uk>
> cc: 75310@debbugs.gnu.org
>
> 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?
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-03 15:27 ` Eli Zaretskii
@ 2025-01-04 7:33 ` Yuan Fu
2025-01-04 8:29 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Yuan Fu @ 2025-01-04 7:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Peter Oliver, 75310
> On Jan 3, 2025, at 7:27 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> Date: Fri, 3 Jan 2025 14:47:53 +0000 (GMT)
>> From: Peter Oliver <p.d.oliver@mavit.org.uk>
>> cc: 75310@debbugs.gnu.org
>>
>> 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 ;-)
Once I rewrite it, there shouldn't be any occurrence of loop in treesit.el.
treesit-transpose-sexps looks like this:
(defun treesit-transpose-sexps (&optional arg)
"Tree-sitter `transpose-sexps' function.
ARG is the same as in `transpose-sexps'.
Locate the node closest to POINT, and transpose that node with
its sibling node ARG nodes away.
Return a pair of positions as described by
`transpose-sexps-function' for use in `transpose-subr' and
friends."
;; First arrive at the right level at where the node at point is
;; considered a sexp. If sexp isn't defined, or we can't find any
;; node that's a sexp, use the node at point.
(let* ((node (or (treesit-thing-at-point 'sexp 'nested)
(treesit-node-at (point))))
(parent (treesit-node-parent node))
(child (treesit-node-child parent 0 t)))
(named-let loop ((prev child)
(next (treesit-node-next-sibling child t)))
(when (and prev next)
(if (< (point) (treesit-node-end next))
(if (= arg -1)
(cons (treesit-node-start prev)
(treesit-node-end prev))
(when-let* ((n (treesit-node-child
parent (+ arg (treesit-node-index prev t)) t)))
(cons (treesit-node-end n)
(treesit-node-start n))))
(loop (treesit-node-next-sibling prev t)
(treesit-node-next-sibling next t)))))))
Yuan
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-04 7:33 ` Yuan Fu
@ 2025-01-04 8:29 ` Eli Zaretskii
2025-01-04 19:26 ` Yuan Fu
0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2025-01-04 8:29 UTC (permalink / raw)
To: Yuan Fu; +Cc: p.d.oliver, 75310
> From: Yuan Fu <casouri@gmail.com>
> Date: Fri, 3 Jan 2025 23:33:25 -0800
> Cc: Peter Oliver <p.d.oliver@mavit.org.uk>,
> 75310@debbugs.gnu.org
>
> > On Jan 3, 2025, at 7:27 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> >> Date: Fri, 3 Jan 2025 14:47:53 +0000 (GMT)
> >> From: Peter Oliver <p.d.oliver@mavit.org.uk>
> >> cc: 75310@debbugs.gnu.org
> >>
> >> 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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-04 8:29 ` Eli Zaretskii
@ 2025-01-04 19:26 ` Yuan Fu
2025-01-04 19:27 ` Yuan Fu
2025-01-04 20:03 ` Eli Zaretskii
0 siblings, 2 replies; 12+ messages in thread
From: Yuan Fu @ 2025-01-04 19:26 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Peter Oliver, 75310
> On Jan 4, 2025, at 12:29 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Fri, 3 Jan 2025 23:33:25 -0800
>> Cc: Peter Oliver <p.d.oliver@mavit.org.uk>,
>> 75310@debbugs.gnu.org
>>
>>> On Jan 3, 2025, at 7:27 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>>
>>>> Date: Fri, 3 Jan 2025 14:47:53 +0000 (GMT)
>>>> From: Peter Oliver <p.d.oliver@mavit.org.uk>
>>>> cc: 75310@debbugs.gnu.org
>>>>
>>>> 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?
Yuan
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-04 19:26 ` Yuan Fu
@ 2025-01-04 19:27 ` Yuan Fu
2025-01-04 19:31 ` Yuan Fu
2025-01-04 20:03 ` Eli Zaretskii
1 sibling, 1 reply; 12+ messages in thread
From: Yuan Fu @ 2025-01-04 19:27 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Peter Oliver, 75310
> On Jan 4, 2025, at 11:26 AM, Yuan Fu <casouri@gmail.com> wrote:
>
>
>
>> On Jan 4, 2025, at 12:29 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>
>>> From: Yuan Fu <casouri@gmail.com>
>>> Date: Fri, 3 Jan 2025 23:33:25 -0800
>>> Cc: Peter Oliver <p.d.oliver@mavit.org.uk>,
>>> 75310@debbugs.gnu.org
>>>
>>>> On Jan 3, 2025, at 7:27 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>>>
>>>>> Date: Fri, 3 Jan 2025 14:47:53 +0000 (GMT)
>>>>> From: Peter Oliver <p.d.oliver@mavit.org.uk>
>>>>> cc: 75310@debbugs.gnu.org
>>>>>
>>>>> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-04 19:27 ` Yuan Fu
@ 2025-01-04 19:31 ` Yuan Fu
0 siblings, 0 replies; 12+ messages in thread
From: Yuan Fu @ 2025-01-04 19:31 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 75310-done, Peter Oliver
> On Jan 4, 2025, at 11:27 AM, Yuan Fu <casouri@gmail.com> wrote:
>
>
>
>> On Jan 4, 2025, at 11:26 AM, Yuan Fu <casouri@gmail.com> wrote:
>>
>>
>>
>>> On Jan 4, 2025, at 12:29 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>>
>>>> From: Yuan Fu <casouri@gmail.com>
>>>> Date: Fri, 3 Jan 2025 23:33:25 -0800
>>>> Cc: Peter Oliver <p.d.oliver@mavit.org.uk>,
>>>> 75310@debbugs.gnu.org
>>>>
>>>>> On Jan 3, 2025, at 7:27 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>>>>
>>>>>> Date: Fri, 3 Jan 2025 14:47:53 +0000 (GMT)
>>>>>> From: Peter Oliver <p.d.oliver@mavit.org.uk>
>>>>>> cc: 75310@debbugs.gnu.org
>>>>>>
>>>>>> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#75310: Eliminate obsolete alias warning
2025-01-04 19:26 ` Yuan Fu
2025-01-04 19:27 ` Yuan Fu
@ 2025-01-04 20:03 ` Eli Zaretskii
1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2025-01-04 20:03 UTC (permalink / raw)
To: Yuan Fu; +Cc: p.d.oliver, 75310
> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 4 Jan 2025 11:26:38 -0800
> Cc: Peter Oliver <p.d.oliver@mavit.org.uk>,
> 75310@debbugs.gnu.org
>
>
>
> > On Jan 4, 2025, at 12:29 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> >> From: Yuan Fu <casouri@gmail.com>
> >> Date: Fri, 3 Jan 2025 23:33:25 -0800
> >> Cc: Peter Oliver <p.d.oliver@mavit.org.uk>,
> >> 75310@debbugs.gnu.org
> >>
> >>> On Jan 3, 2025, at 7:27 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> >>>
> >>>> Date: Fri, 3 Jan 2025 14:47:53 +0000 (GMT)
> >>>> From: Peter Oliver <p.d.oliver@mavit.org.uk>
> >>>> cc: 75310@debbugs.gnu.org
> >>>>
> >>>> 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?
You get deprecation message in what scenario? If you see
Package cl is deprecated
when you load cl, that's expected, and cannot be shut up. The message
we want to avoid is this:
lisp/treesit.el: Warning: ‘loop’ is an obsolete alias (as of 27.1); use ‘cl-loop’ instead.
Are you still seeing it after the change?
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-01-04 20:03 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-03 11:41 bug#75310: Eliminate obsolete alias warning Peter Oliver
2025-01-03 12:02 ` Eli Zaretskii
2025-01-03 14:11 ` Peter Oliver
2025-01-03 14:17 ` Eli Zaretskii
2025-01-03 14:47 ` Peter Oliver
2025-01-03 15:27 ` Eli Zaretskii
2025-01-04 7:33 ` Yuan Fu
2025-01-04 8:29 ` Eli Zaretskii
2025-01-04 19:26 ` Yuan Fu
2025-01-04 19:27 ` Yuan Fu
2025-01-04 19:31 ` Yuan Fu
2025-01-04 20:03 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).