emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp files that load cl-lib in problematical ways


From: Eli Zaretskii
Subject: Re: Lisp files that load cl-lib in problematical ways
Date: Wed, 25 Oct 2023 15:23:43 +0300

> From: Richard Stallman <rms@gnu.org>
> Cc: acm@muc.de, emacs-devel@gnu.org
> Date: Tue, 24 Oct 2023 22:47:23 -0400
> 
>   > It would not have helped to define cl-pushnew on cl-macs, because
>   > cl-pushnew calls cl-adjoin, which is a function defined on cl-lib.  So
>   > basically cl-pushnew is a (rather thin) wrapper around cl-adjoin, and
>   > thus it is correctly defined on the same file where cl-adjoin is
>   > defined.
> 
> That is a good point -- for that particular solution I proposed.
> 
> But if we let ourselves be a little more flexible, how about this
> solution: install this
> 
>         (while (string-match "\\W" abbrev pos)
>           (or (memq (aref abbrev (match-beginning 0)) badchars)
>               (push (aref abbrev (match-beginning 0)) badchars))
>           (setq pos (1+ pos)))
> 
> instead of the current code:
> 
>         (while (string-match "\\W" abbrev pos)
>           (cl-pushnew (aref abbrev (match-beginning 0)) badchars)
>           (setq pos (1+ pos)))

If someone wants to work on such rewrites, I'm not sure I will object,
provided that the result is clean, tested, and is not horribly
complicated.  But personally, I see no need for investing any effort
in such rewrites, since there's nothing wrong with this code and
nothing wrong with loading cl-lib when its facilities are put to a
good use.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]