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: Thu, 19 Oct 2023 15:55:34 +0300

> Date: Thu, 19 Oct 2023 12:34:42 +0000
> Cc: rms@gnu.org, incal@dataswamp.org, emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> So, I counted all the occurrences of "cl-" not inside an
> eval-when-compile, by piping all the dumped .el files through the
> following script:
> 
> find-run-time-cl.el:
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (defun run-time-cl ()
>   (save-excursion
>     (goto-char (point-min))
>     (let ((count 0))
>       (while (and (< (point) (point-max))
>                 (re-search-forward "^[^;]*(\\(eval-when-compile\\|cl-\\)"
>                                    nil 'stop))
>       (if (string= (match-string-no-properties 1) "cl-")
>           (progn
>             (setq count (1+ count)))
>             ;; (message "%s:%s %s" (buffer-file-name) (line-number-at-pos)
>             ;;               (buffer-substring-no-properties 
> (line-beginning-position)
>             ;;                                               
> (line-end-position)))
>         (goto-char (1- (match-beginning 1)))
>         (forward-list)))
>       (prin1 (format "%s:%s\n" (buffer-file-name) count) t))))
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> 
> $ for f in `sed 's/^[^;]*(load "\(.*\)".*$/\1.el/; s/\.el\.el/.el/; t; d' \
>   loadup.el | sort`; \
>   do ../src/emacs -Q -batch -l ~/find-run-time-cl.el \
>   --eval "(progn (find-file \"$f\") (run-time-cl))"; \
>   done | sed '/:0$/d' | sed 's%^.*/lisp/%%'
> 
> and got the following results:
> 
> abbrev.el:2
> dnd.el:4
> emacs-lisp/byte-run.el:1
> emacs-lisp/cconv.el:13
> emacs-lisp/cl-generic.el:56
> emacs-lisp/cl-preloaded.el:16
> emacs-lisp/eldoc.el:6
> emacs-lisp/lisp-mode.el:6
> emacs-lisp/nadvice.el:2
> emacs-lisp/oclosure.el:8
> emacs-lisp/seq.el:25
> emacs-lisp/shorthands.el:1
> emacs-lisp/syntax.el:5
> emacs-lisp/tabulated-list.el:1
> emacs-lisp/timer.el:1
> font-lock.el:1
> frame.el:5
> international/mule-cmds.el:3
> international/ucs-normalize.el:1
> isearch.el:3
> ldefs-boot.el:3
> loaddefs.el:3
> minibuffer.el:12
> progmodes/elisp-mode.el:11
> progmodes/prog-mode.el:1
> register.el:3
> replace.el:1
> select.el:3
> simple.el:9
> startup.el:1
> subr.el:1
> tab-bar.el:4
> term/android-win.el:4
> term/haiku-win.el:3
> term/ns-win.el:2
> term/pc-win.el:6
> term/pgtk-win.el:3
> term/w32-win.el:4
> term/x-win.el:2
> uniquify.el:2
> vc/vc-hooks.el:1

If the above is correct, then how do you explain that in "emacs -Q" I
don't see the cl-lib feature present?

My conclusion is that your program has a bug.

> That may not be 541 occurrences, but it's still 239.  Incidentally, when
> I start emacs -Q, cl-lib isn't yet loaded for me, either.

Exactly.  How come, if all of the above-mentioned files load it?

> > We cannot possibly expect people to contribute code if we force them
> > not to use the macros they are used to.  If cl-lib is not loaded as
> > result, that is good enough for us, I think.
> 
> We "force" them to use Emacs Lisp, but they still contribute.  The
> problem is that use of cl- makes maintenance of other people's code much
> harder, at least for me.  I'm sure I'm not alone.

I'm sorry, but the above is how I feel we should treat our
contributors, if we want to keep the existing ones and attract new
ones.



reply via email to

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