From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Lisp files that load cl-lib in problematical ways Date: Thu, 19 Oct 2023 15:55:34 +0300 Message-ID: <83lebyu5yx.fsf@gnu.org> References: <87il8betof.fsf@dataswamp.org> <83fs3dgxv8.fsf@gnu.org> <835y38qvlg.fsf@gnu.org> <87bkcx6eci.fsf@dataswamp.org> <83ttqnm4ti.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39116"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, incal@dataswamp.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 19 14:56:35 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtSZm-0009tb-Lf for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Oct 2023 14:56:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtSZ5-0004UG-Gp; Thu, 19 Oct 2023 08:55:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtSZ3-0004Ty-Df for emacs-devel@gnu.org; Thu, 19 Oct 2023 08:55:49 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtSZ1-0000qO-Q0; Thu, 19 Oct 2023 08:55:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=I3aEnUZk7nJ1BshEYbbKscRzKh4bh+nUem3PvyPl55Q=; b=rWZIiOR5fg1R kw/FfFnYnBoS9fX3NP5F1P726DeQMITALGnpkWWksB3aoU8ERtZu87F2ZQvPNIaXg1NaF55Tz4tK9 dWpol4hiJclXrkVB52SBRLTT9HXaOxcs9DBH7SHlkcwEbrltbCfz7JOhdpqa+eh4CVpeMWtgA1+k5 SP6sr0VtjTAM35N1CPV13v09uKrfAm8btb5l9SMN3Z2irE4HWHkrlb3KXtVf8kSvKJKmHiFSUPWkj 5HJfOi8H6r+bsE/zbrd9cbEzoQIQ2j7C11cYsfaaeu63BQt5mpg0nwy6JHSdGyiGR9KF9vPV4r2hK Edkbd1uVnZrCWcHCNfWSNw==; In-Reply-To: (message from Alan Mackenzie on Thu, 19 Oct 2023 12:34:42 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311592 Archived-At: > Date: Thu, 19 Oct 2023 12:34:42 +0000 > Cc: rms@gnu.org, incal@dataswamp.org, emacs-devel@gnu.org > From: Alan Mackenzie > > 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.