From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 16:29:24 2024 Received: (at submit) by debbugs.gnu.org; 26 Jul 2024 20:29:25 +0000 Received: from localhost ([127.0.0.1]:40119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXRZ5-0005HH-VI for submit@debbugs.gnu.org; Fri, 26 Jul 2024 16:29:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:52540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXRZ3-0005H9-JB for submit@debbugs.gnu.org; Fri, 26 Jul 2024 16:29:22 -0400 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 1sXRYu-0001JX-69 for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 16:29:12 -0400 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 1sXRYt-0007OM-T7 for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 16:29:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=61YMHVUoNlndjERAh0v5dNbeeeruNKkG+ddcRGl+ero=; b=rs473gaOsyWNXk J6ziwR3QyTZoIbCJyo8naDHv6L+3qmv4PZnSsw18aVB1l7EMeuvuP3lkvmMhqEy9bDM0/krFe8TqO NB7O+QaGyE565LGVRiPMHL1fKadDTOpATqAGj0HH6sIBbINOqg7O2uulYKsGRCdfT0MaeMONOMgQT i4BMh4qCwoZzKArvkafSKQaARRKfLJ4z/M84YIIdbFm60mgFLv7fuuqYxgseNAq0SYckwBqYJaOd5 LA3OoIkjMMUl+lVDTABRNG3CJrewIj6ALNl0uCKS2UMst94nglTwDdteOQEcm6ZkHqG0OkusI8prg bygQ4g2uXA30wXNdTtfg==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrieehgdduheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtgfesthhqredttd dtjeenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhg qeenucggtffrrghtthgvrhhnpeehudfggeegteeuffdtkedvveeigeehheeviedtgfetve fgtdduhfefvdeugedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqd ekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhm rghilhdrfhhmpdhnsggprhgtphhtthhopedt X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: bug-gnu-emacs@gnu.org Subject: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew X-Debbugs-Cc: Date: Fri, 26 Jul 2024 22:29:08 +0200 Message-ID: <874j8bx5gr.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) The following non-sensical code is a MWE triggering the warning test.el: Warning: the function =E2=80=98cl-member=E2=80=99 might not be d= efined at runtime. when byte-compiling it with emacs -Q --batch -f batch-byte-compile test.el --8<---------------cut here---------------start------------->8--- ;; -*- lexical-binding: t; -*- (eval-when-compile (require 'cl-lib)) (defun foo () (let ((s (list 'a 'b))) (cl-pushnew (list 1 2 3) s :test (lambda (_a _b) nil)))) --8<---------------cut here---------------end--------------->8--- Code with that shape of cl-pushnew usage can be found in AUCTeX's tex-info.el where it produces the same warning which sounds very strange given that the complete file doesn't use cl-member. I've checked the cl-lib code and could see that cl-pushnew expands to something with cl-adjoin which in turn has a compiler macro cl-compiler-macro-adjoin which could expand to something with cl-member (but doesn't in this case, I think?)... My assumption is that (eval-when-compile (require 'cl-lib)) should be fine when using only macros from cl-lib which in turn should expand to cl-free code, i.e., the byte code doesn't require cl-lib at runtime. If, however, cl-pushnew can expand to something using cl-member (a function), that wouldn't be true. In GNU Emacs 31.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.0) of 2024-07-26 built on thinkpad-t440p Repository revision: c22b4198b2e5a9d63109c5ceeb386fbb1904f5dc Repository branch: master System Description: Arch Linux Configured using: 'configure --with-tree-sitter --with-pgtk --with-modules' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LC_MONETARY: de_DE.utf8 value of $LC_NUMERIC: de_DE.utf8 value of $LC_TIME: de_DE.utf8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: mu4e:main Minor modes in effect: TeX-PDF-mode: t breadcrumb-mode: t editorconfig-mode: t global-aggressive-indent-mode: t pdf-occur-global-minor-mode: t diredfl-global-mode: t mu4e-search-minor-mode: t mu4e-update-minor-mode: t mu4e-context-minor-mode: t mu4e-modeline-mode: t which-key-mode: t highlight-parentheses-mode: t global-git-commit-mode: t magit-auto-revert-mode: t server-mode: t corfu-popupinfo-mode: t corfu-history-mode: t global-corfu-mode: t corfu-mode: t vertico-mode: t marginalia-mode: t minibuffer-depth-indicate-mode: t switchy-window-minor-mode: t electric-pair-mode: t recentf-mode: t override-global-mode: t repeat-mode: t global-so-long-mode: t save-place-mode: t savehist-mode: t puni-global-mode: t puni-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t buffer-read-only: t column-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t overwrite-mode: overwrite-mode-binary Load-path shadows: ~/Repos/el/mu/mu4e/mu4e hides ~/Repos/el/mu/build/mu4e/mu4e ~/Repos/el/mu/mu4e/mu4e-modeline hides ~/Repos/el/mu/build/mu4e/mu4e-modeli= ne ~/Repos/el/mu/mu4e/mu4e-context hides ~/Repos/el/mu/build/mu4e/mu4e-context ~/Repos/el/mu/mu4e/mu4e-main hides ~/Repos/el/mu/build/mu4e/mu4e-main ~/Repos/el/mu/mu4e/mu4e-vars hides ~/Repos/el/mu/build/mu4e/mu4e-vars ~/Repos/el/mu/mu4e/mu4e-window hides ~/Repos/el/mu/build/mu4e/mu4e-window ~/Repos/el/mu/mu4e/mu4e-speedbar hides ~/Repos/el/mu/build/mu4e/mu4e-speedb= ar ~/Repos/el/mu/mu4e/mu4e-view hides ~/Repos/el/mu/build/mu4e/mu4e-view ~/Repos/el/mu/mu4e/mu4e-thread hides ~/Repos/el/mu/build/mu4e/mu4e-thread ~/Repos/el/mu/mu4e/mu4e-bookmarks hides ~/Repos/el/mu/build/mu4e/mu4e-bookm= arks ~/Repos/el/mu/mu4e/mu4e-org hides ~/Repos/el/mu/build/mu4e/mu4e-org ~/Repos/el/mu/mu4e/mu4e-lists hides ~/Repos/el/mu/build/mu4e/mu4e-lists ~/Repos/el/mu/mu4e/mu4e-actions hides ~/Repos/el/mu/build/mu4e/mu4e-actions ~/Repos/el/mu/mu4e/mu4e-helpers hides ~/Repos/el/mu/build/mu4e/mu4e-helpers ~/Repos/el/mu/mu4e/mu4e-search hides ~/Repos/el/mu/build/mu4e/mu4e-search ~/Repos/el/mu/mu4e/mu4e-server hides ~/Repos/el/mu/build/mu4e/mu4e-server ~/Repos/el/mu/mu4e/mu4e-obsolete hides ~/Repos/el/mu/build/mu4e/mu4e-obsole= te ~/Repos/el/mu/mu4e/mu4e-update hides ~/Repos/el/mu/build/mu4e/mu4e-update ~/Repos/el/mu/mu4e/mu4e-draft hides ~/Repos/el/mu/build/mu4e/mu4e-draft ~/Repos/el/mu/mu4e/mu4e-message hides ~/Repos/el/mu/build/mu4e/mu4e-message ~/Repos/el/mu/mu4e/mu4e-compose hides ~/Repos/el/mu/build/mu4e/mu4e-compose ~/Repos/el/mu/mu4e/mu4e-headers hides ~/Repos/el/mu/build/mu4e/mu4e-headers ~/Repos/el/mu/mu4e/mu4e-query-items hides ~/Repos/el/mu/build/mu4e/mu4e-que= ry-items ~/Repos/el/mu/mu4e/mu4e-notification hides ~/Repos/el/mu/build/mu4e/mu4e-no= tification ~/Repos/el/mu/mu4e/mu4e-contacts hides ~/Repos/el/mu/build/mu4e/mu4e-contac= ts ~/Repos/el/mu/mu4e/mu4e-icalendar hides ~/Repos/el/mu/build/mu4e/mu4e-icale= ndar ~/Repos/el/mu/mu4e/mu4e-mark hides ~/Repos/el/mu/build/mu4e/mu4e-mark ~/Repos/el/mu/mu4e/mu4e-contrib hides ~/Repos/el/mu/build/mu4e/mu4e-contrib ~/Repos/el/mu/mu4e/mu4e-folders hides ~/Repos/el/mu/build/mu4e/mu4e-folders ~/Repos/el/mu/mu4e/mu4e-mime-parts hides ~/Repos/el/mu/build/mu4e/mu4e-mime= -parts /home/horn/.emacs.d/elpa/ef-themes-1.7.0/theme-loaddefs hides /home/horn/Re= pos/el/emacs/lisp/theme-loaddefs /home/horn/.emacs.d/elpa/transient-20240713.2102/transient hides /home/horn= /Repos/el/emacs/lisp/transient Features: (shadow emacsbug network-stream mailalias dired-aux rdictcc vc-annotate dabbrev cape-keyword cape expreg cap-words superword subword face-remap sort gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check qp cus-start view cl-print symbol-overlay shortdoc help-fns radix-tree misearch multi-isearch texinfo texinfo-loaddefs tex texmathp tramp-cmds puni display-fill-column-indicator display-line-numbers ef-frost-theme generic yaml-mode fish-mode cargo xref cargo-process rust-utils rust-mode-treesitter rust-ts-mode rust-mode rust-playpen rust-compile rust-cargo rust-common rust-rustfmt web-mode disp-table auctex-autoloads tex-site breadcrumb pulse project editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch elfeed-show elfeed-search vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view debbugs-browse elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db elfeed-lib avl-tree url-queue xml-query hl-todo aggressive-indent rainbow-mode pdf-occur tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet pdf-isearch pdf-misc pdf-tools pdf-view jka-compr pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif vc-git vc-dir ewoc epa-file trashed diredfl dired-x eshell esh-cmd generator esh-ext esh-proc esh-opt esh-io esh-arg esh-module esh-module-loaddefs esh-util mu4e-icalendar gnus-icalendar icalendar diary-lib diary-loaddefs mu4e mu4e-org mu4e-notification notifications mu4e-main smtpmail mu4e-view mu4e-mime-parts mu4e-headers mu4e-thread mu4e-actions org-capture org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie executable ob-comint org-pcomplete org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs cal-menu calendar cal-loaddefs org-compat org-version org-macs mu4e-compose mu4e-draft gnus-msg mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message flow-fill mule-util mu4e-contacts mu4e-update mu4e-folders mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars mu4e-helpers mu4e-config mu4e-window magit-bookmark bookmark ido mu4e-obsolete hippie-exp auto-dictionary flyspell ispell tramp-smb which-key highlight-parentheses restclient forge-repos forge-tablist hl-line forge-topics forge-commands forge-semi forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy gsexp ghub let-alist forge-notify forge-revnote forge-pullreq forge-issue forge-topic yaml eieio-custom forge-post markdown-mode noutline outline forge-repo forge forge-core forge-db closql emacsql-sqlite-common emacsql emacsql-compiler eieio-base magit-submodule magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff diff-mode track-changes git-commit log-edit pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor comp comp-cstr comp-run comp-common server magit-mode benchmark magit-git magit-base magit-section cursor-sensor crm dash visual-filename-abbrev rg vc vc-dispatcher rg-info-hack advice rg-menu transient rg-ibuffer rg-result wgrep-rg wgrep rg-history rg-header ibuf-ext ibuffer ibuffer-loaddefs grep compile debbugs soap-client url-http url-auth url-gw nsm warnings rng-xsd rng-dt rng-util xsd-regexp bug-reference thingatpt kind-icon svg-lib color corfu-popupinfo corfu-history corfu vertico marginalia icomplete mb-depth use-package-diminish switchy-window compat elec-pair tramp-cache time-stamp recentf tree-widget edmacro kmacro use-package-bind-key bind-key diminish repeat toml-ts-mode json-ts-mode c++-ts-mode c-ts-mode java-ts-mode c-ts-common find-func treesit so-long saveplace tramp-sh tramp rx trampver tramp-integration files-x tramp-message tramp-compat xdg shell pcomplete comint ansi-osc ring format-spec ansi-color tramp-loaddefs savehist smiley gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util text-property-search time-date mm-util mail-prsvr mail-utils range ef-themes cl-extra help-mode use-package-ensure use-package-core finder-inf cus-edit pp cus-load wid-edit aggressive-indent-autoloads auto-dictionary-autoloads breadcrumb-autoloads cape-autoloads cargo-autoloads clojure-mode-autoloads corfu-autoloads csv-mode-autoloads debbugs-autoloads diminish-autoloads diredfl-autoloads eat-autoloads ef-themes-autoloads elfeed-autoloads ement-autoloads expreg-autoloads fish-mode-autoloads forge-autoloads closql-autoloads emacsql-autoloads ghub-autoloads highlight-parentheses-autoloads hl-todo-autoloads kind-icon-autoloads magit-autoloads pcase git-commit-autoloads marginalia-autoloads markdown-mode-autoloads mastodon-autoloads pdf-tools-autoloads persist-autoloads plz-autoloads puni-autoloads easy-mmode rainbow-mode-autoloads rcirc-color-autoloads request-autoloads restclient-autoloads rg-autoloads rust-mode-autoloads svg-lib-autoloads symbol-overlay-autoloads tablist-autoloads taxy-magit-section-autoloads taxy-autoloads magit-section-autoloads dash-autoloads totp-autoloads transient-autoloads trashed-autoloads treepy-autoloads vertico-autoloads visual-filename-abbrev-autoloads web-mode-autoloads wgrep-autoloads info with-editor-autoloads yaml-autoloads yaml-mode-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 1173451 235616) (symbols 48 56499 6) (strings 32 291077 14149) (string-bytes 1 9219043) (vectors 16 125102) (vector-slots 8 1918753 30030= 2) (floats 8 897 5338) (intervals 56 22117 7997) (buffers 992 40)) From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 26 17:21:19 2024 Received: (at 72313) by debbugs.gnu.org; 26 Jul 2024 21:21:19 +0000 Received: from localhost ([127.0.0.1]:40129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXSNK-0006c9-QJ for submit@debbugs.gnu.org; Fri, 26 Jul 2024 17:21:19 -0400 Received: from out-185.mta0.migadu.com ([91.218.175.185]:58396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXSNI-0006be-2K for 72313@debbugs.gnu.org; Fri, 26 Jul 2024 17:21:17 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeremybryant.net; s=key1; t=1722028859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RyABsTYeYozmGMp7YAb4kGaP2/Ess/sLAW+SzxHYiQs=; b=YTr5SLzh1qhfTBqFsRzMNE/7oh+Fyl/SHxnrI2Qnzxp4nmdFlwrL8tppJdK8/rRqp673wt ELJejR59mSOnakRj32m0MNl+wH3oSvI4mMnthih8UQ85Ma2WdgiNEVTLH0eqsw5+kvsGkx LTZKb0SnqqUyYJ2a9gU4MRWcHX9Oy+qQ0lv+3XSlsfjKBcK3k0XF2OMbwO1eTQQzo3optb MpRkzLKQWD7K4me4nndm8IYDaO9GstusOKsYZTQvfohXwPaK5nfq6QReDZe0SAsx0tiflW cZNaPJA97YOz3dRV6i320wSp3i+46l8pUgYs16RCNm0FeH27D3DyesOzxWnOGg== From: Jeremy Bryant To: Tassilo Horn Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: <874j8bx5gr.fsf@gnu.org> (Tassilo Horn's message of "Fri, 26 Jul 2024 22:29:08 +0200") References: <874j8bx5gr.fsf@gnu.org> Date: Fri, 26 Jul 2024 22:20:57 +0100 Message-ID: <87ttgbalza.fsf@jeremybryant.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Tassilo Horn writes: > The following non-sensical code is a MWE triggering the warning > > test.el: Warning: the function ‘cl-member’ might not be defined > at runtime. > > when byte-compiling it with > > emacs -Q --b [...] Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: jeremybryant.net] X-Debbugs-Envelope-To: 72313 Cc: 72313@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Tassilo Horn writes: > The following non-sensical code is a MWE triggering the warning > > test.el: Warning: the function =E2=80=98cl-member=E2=80=99 might not be= defined > at runtime. > > when byte-compiling it with > > emacs -Q --batch -f batch-byte-compile test.el > > --8<---------------cut here---------------start------------->8--- > ;; -*- lexical-binding: t; -*- > (eval-when-compile > (require 'cl-lib)) > > (defun foo () > (let ((s (list 'a 'b))) > (cl-pushnew (list 1 2 3) > s > :test (lambda (_a _b) nil)))) > --8<---------------cut here---------------end--------------->8--- > > Code with that shape of cl-pushnew usage can be found in AUCTeX's > tex-info.el where it produces the same warning which sounds very strange > given that the complete file doesn't use cl-member. > > I've checked the cl-lib code and could see that cl-pushnew expands to > something with cl-adjoin which in turn has a compiler macro > cl-compiler-macro-adjoin which could expand to something with cl-member > (but doesn't in this case, I think?)... > > My assumption is that (eval-when-compile (require 'cl-lib)) should be > fine when using only macros from cl-lib which in turn should expand to > cl-free code, i.e., the byte code doesn't require cl-lib at runtime. > If, however, cl-pushnew can expand to something using cl-member (a > function), that wouldn't be true. Adding Stefan M. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 03:01:58 2024 Received: (at 72313) by debbugs.gnu.org; 27 Jul 2024 07:01:58 +0000 Received: from localhost ([127.0.0.1]:40411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXbRF-00022v-Q7 for submit@debbugs.gnu.org; Sat, 27 Jul 2024 03:01:58 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXbRC-000223-P9 for 72313@debbugs.gnu.org; Sat, 27 Jul 2024 03:01:56 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6D76C440775; Sat, 27 Jul 2024 03:01:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1722063696; bh=5OqhF1NhtTwBJtKYDzYxF0/SgRXumw8y9Fg/3HBkJT4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Q9dBBTmwB8cdkedM5cg5VFSjut4LoO1Qd7cQx5XVODLwyc1hTDuqusuPhGpNf0kN3 q3ruO8sV6Kxc6rDQ9SxcxM76SiVMISBlh3wBJJvLec74+Bb04egKGlncBzLFfncttP x6U70kTx4JUVdoYj0utUOfsEBELQf7OG5GYMRhbjwJKAyPIh1C6CUvk08tfRMx6EeZ m40d3KNgNB59vaSZq/ODtBYsyJx7juPHKjkU6Ark9r1o5fcdAOfiJ4WHLG/twuWNnd 5rtwQB9NaBoIgQruOyy7XKtF5aHJAQiTSJy7bsYstJkpRiuV1DuWwFhVT9lwj9/cI1 luR6N2kR+y/iw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A542B440439; Sat, 27 Jul 2024 03:01:36 -0400 (EDT) Received: from asado (dyn.144-85-159-142.dsl.vtx.ch [144.85.159.142]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 99AC8120213; Sat, 27 Jul 2024 03:01:35 -0400 (EDT) From: Stefan Monnier To: Tassilo Horn Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: <874j8bx5gr.fsf@gnu.org> (Tassilo Horn's message of "Fri, 26 Jul 2024 22:29:08 +0200") Message-ID: References: <874j8bx5gr.fsf@gnu.org> Date: Sat, 27 Jul 2024 03:01:32 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72313 Cc: 72313@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > --8<---------------cut here---------------start------------->8--- > ;; -*- lexical-binding: t; -*- > (eval-when-compile > (require 'cl-lib)) > > (defun foo () > (let ((s (list 'a 'b))) > (cl-pushnew (list 1 2 3) > s > :test (lambda (_a _b) nil)))) > --8<---------------cut here---------------end--------------->8--- (macroexpand-all '(cl-pushnew (list 1 2 3) s :test (lambda (_a _b) nil))) => (setq s (let* ((va (list 1 2 3))) (if (cl-member va s :test #'(lambda (_a _b) nil)) s (cons va s)))) > My assumption is that (eval-when-compile (require 'cl-lib)) should be > fine when using only macros from cl-lib which in turn should expand to > cl-free code, That's not the case here (and a few other places). In the past, I've moved some of this kind of code to `cl-preloaded`, so as to make things easier for programmers (to avoid them having to know which CL macros emit code which calls CL functions (and when)), but there are still cases like above, yes. In practice most complex macros are often best served by emitting code which itself calls helper functions (e.g. `cl-defstruct` used to not call a function but I changed it to call `cl-struct-define`). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 03:14:18 2024 Received: (at 72313) by debbugs.gnu.org; 27 Jul 2024 07:14:18 +0000 Received: from localhost ([127.0.0.1]:40431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXbdC-0002cV-Cw for submit@debbugs.gnu.org; Sat, 27 Jul 2024 03:14:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXbd5-0002a6-UU for 72313@debbugs.gnu.org; Sat, 27 Jul 2024 03:14:12 -0400 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 1sXbcq-0000G5-Ug; Sat, 27 Jul 2024 03:13:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Srgifa/YkgNmcmuRea4g7tDvaZk2iBLP5Fgd2f+sYIs=; b=ETzCXIg+2RQdeR2V3NoQ wLbm51ajdu7v6hmZZyEwS5J+Fw8O832jC1vz2mO+5zSLrhbtuneUsHlmAVZq7Qd6LaNE28qhbxhhK +ZVPLctvvcO/4Th4QphhyHjtet0/5uG58rsMaSiir70098/qY4N0N6KFMAHlxudk1aLyIifAGD5j/ 1neUw2zc6Kis8QJpPyMH+gnp6FzwdbAEJ5MYz0MslKlAogwHy3KC4a1wSbi2bF/VA+knuRWr0/cty R3AmGKMZ9Z5YuirxT5vMYkKSlc1zGQ77/8SONG3v/ys4HdXarP+GgwkeQDhZ0F1NIRX6GdzVZns3h gZAPfQbF4QfksA==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrieeigdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepte eltdegheffhfetkeekveekkeevgfegkeetueffleeiheekhffgffeuueegieffnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpth htoheptd X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Stefan Monnier Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: (Stefan Monnier's message of "Sat, 27 Jul 2024 03:01:32 -0400") References: <874j8bx5gr.fsf@gnu.org> Date: Sat, 27 Jul 2024 09:13:50 +0200 Message-ID: <875xsrjoi9.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72313 Cc: 72313@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: Hi Stefan, > (macroexpand-all '(cl-pushnew (list 1 2 3) s :test (lambda (_a _b) nil))) > => > (setq s > (let* ((va (list 1 2 3))) > (if (cl-member va s :test #'(lambda (_a _b) nil)) s (cons va s)))) > >> My assumption is that (eval-when-compile (require 'cl-lib)) should be >> fine when using only macros from cl-lib which in turn should expand >> to cl-free code, > > That's not the case here (and a few other places). In the past, I've > moved some of this kind of code to `cl-preloaded`, so as to make > things easier for programmers (to avoid them having to know which CL > macros emit code which calls CL functions (and when)), but there are > still cases like above, yes. So the conclusion is to simply (require 'cl-lib) instead of (eval-when-compile (require 'cl-lib))? But how can the byte-compiler conclude that cl-member might not be defined at runtime given that it's an autoloaded function? Addon question: should a package list cl-lib in Package-Requires if it already requires an Emacs version where a good-enough cl-lib is included anyway? Thanks, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 03:50:24 2024 Received: (at 72313) by debbugs.gnu.org; 27 Jul 2024 07:50:24 +0000 Received: from localhost ([127.0.0.1]:40486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXcC8-00057d-Hi for submit@debbugs.gnu.org; Sat, 27 Jul 2024 03:50:24 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXcC5-000543-QT for 72313@debbugs.gnu.org; Sat, 27 Jul 2024 03:50:23 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7CA57100043; Sat, 27 Jul 2024 03:50:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1722066600; bh=HyHxgaEJQFVUuqxe4lKwyPxfCmbrDknrTQJJvYmcKOs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=oSO1rtgHMY/AoK9K3myYzE99GmbISWyEDJdsHo+RzqKyf7XBoEDkdOP6DKO+SJNO5 UueiV+ZWYuopoj7Hbgj36gw4KyYcKT5wD9iexPkWdt7Ix/XK0Yyejp5vI5cxjVUdl4 2f6axH9tbRFUJzjnMPmzbLrqR+XSU8WlMi815CnQfjc1CvUB9bUzs8KVlhyxYvTwKV z3bTrU6es0QkrmSUHjCVFNlL3VfJHZ3x3xhZzW9YUDm86qoa6dWn9vIzjV5vzx0gfb VZLct/dG5i+lv1b7813bM2nFykju1y1FVA/f7+e3YRL3k4zBYZWSz1YQ3cAevhB3b5 vG7o+VL0hFCcA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 45B8910002E; Sat, 27 Jul 2024 03:50:00 -0400 (EDT) Received: from asado (dyn.144-85-159-142.dsl.vtx.ch [144.85.159.142]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8A34E1201A6; Sat, 27 Jul 2024 03:49:59 -0400 (EDT) From: Stefan Monnier To: Tassilo Horn Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: <875xsrjoi9.fsf@gnu.org> (Tassilo Horn's message of "Sat, 27 Jul 2024 09:13:50 +0200") Message-ID: References: <874j8bx5gr.fsf@gnu.org> <875xsrjoi9.fsf@gnu.org> Date: Sat, 27 Jul 2024 03:49:57 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72313 Cc: 72313@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > So the conclusion is to simply (require 'cl-lib) instead of > (eval-when-compile (require 'cl-lib))? But how can the byte-compiler > conclude that cl-member might not be defined at runtime given that it's > an autoloaded function? It's autoloaded from `cl-seq` when `cl-lib` is loaded. It's not autoloaded at startup. > Addon question: should a package list cl-lib in Package-Requires if it > already requires an Emacs version where a good-enough cl-lib is included > anyway? I can't see any reason to do that, no. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 11:30:01 2024 Received: (at submit) by debbugs.gnu.org; 27 Jul 2024 15:30:01 +0000 Received: from localhost ([127.0.0.1]:42133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXjMv-0002hX-Cz for submit@debbugs.gnu.org; Sat, 27 Jul 2024 11:30:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:33476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXjMt-0002gw-OV for submit@debbugs.gnu.org; Sat, 27 Jul 2024 11:30:00 -0400 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 1sXjMi-0005kw-GZ for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 11:29:48 -0400 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 1sXjMi-0005GO-5F; Sat, 27 Jul 2024 11:29:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Ki4t4hpX16YD1VFO8XzATmzDqU+FpRv/fJ8o1ngp/Y8=; b=TXROWNR9ygtGYJNnqS0D zBVvTk8f8dCyzXPEfu9ZuPEylbfeOGGjJidIFe15xh7KslonWYX2kRrdUWdwzOh5wFJ3a/LWyxsJA 3H0+EjHRrAwa7X1ow1RmVY0/4UyJ4oTPzkBP3q8QBx2MYawHffowYQyQnw3ljo2CPgPqyv/kqasWA tTTL4hNVgHnxhaPIzQ4QiMoOR8pMF5LJS88N/xIZPhT/pIgzi4KsZa2Kd5No2RWoIkHANEqhT6Acl WpiQXRryhv+Tnl9EKQtqikxTOh+ZgCnf5NRvocawTwhyLFDJZSug6ONN2eey85BLyFh/9PY4F0Gxr w9kaWbntzDB5YQ==; From: Arash Esbati To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: (Stefan Monnier via's message of "Sat, 27 Jul 2024 03:49:57 -0400") References: <874j8bx5gr.fsf@gnu.org> <875xsrjoi9.fsf@gnu.org> Date: Sat, 27 Jul 2024 17:29:43 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: 72313@debbugs.gnu.org, Stefan Monnier , Tassilo Horn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: >> So the conclusion is to simply (require 'cl-lib) instead of >> (eval-when-compile (require 'cl-lib))? But how can the byte-compiler >> conclude that cl-member might not be defined at runtime given that it's >> an autoloaded function? > > It's autoloaded from `cl-seq` when `cl-lib` is loaded. > It's not autoloaded at startup. How about this approach then? --8<---------------cut here---------------start------------->8--- diff --git a/tex-info.el b/tex-info.el index dc69762e..0f77e057 100644 --- a/tex-info.el +++ b/tex-info.el @@ -25,7 +25,8 @@ ;;; Code: (eval-when-compile - (require 'cl-lib)) + (require 'cl-lib) + (declare-function cl-member "cl-seq")) (require 'tex) --8<---------------cut here---------------end--------------->8--- Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 16:50:54 2024 Received: (at submit) by debbugs.gnu.org; 27 Jul 2024 20:50:54 +0000 Received: from localhost ([127.0.0.1]:42476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXoNR-0007R0-T9 for submit@debbugs.gnu.org; Sat, 27 Jul 2024 16:50:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:56572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXoNP-0007Qr-Bg for submit@debbugs.gnu.org; Sat, 27 Jul 2024 16:50:52 -0400 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 1sXoNE-0001oT-G6 for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 16:50:40 -0400 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 1sXoND-0005Cq-HR; Sat, 27 Jul 2024 16:50:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=R5EhN0VFXW+5xSFUx42UI3f6tHr0OoEz93IJqUi/+AE=; b=PY4wuSfge3+CSsrCeFWm ZzFg+GkaxQN2aQ7Me+k1XQPiBmZD8RWJJ+gdNVQc4OmD6+7IjbVV6E5RLZFlAlxqilCIDvXTfGJQV qUlmPPCJ8wAygnvPT3AVlawWTflP0bDsurUzTJcf9sshoA2NVGg0YFIFbOjvXXLLdAd2u9uWZmVLX 4ULD2DAigIgYipPEC/UijWDVREoGeTB5uDB4KTWoP1PybuA0k/y4z7Jg7myVcN2fk0yhxzSaqb9vK wBXTMa8LbbB7mUkYBkE8H9YoPCxa4fdK3cN0CRljn+B9L+nqRP+xY2Cp8R2g8xEr9oUtve7AvzY0C yeBpLFv4XXFmUA==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrieejgdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepte eltdegheffhfetkeekveekkeevgfegkeetueffleeiheekhffgffeuueegieffnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpth htoheptd X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Arash Esbati Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: (Arash Esbati's message of "Sat, 27 Jul 2024 17:29:43 +0200") References: <874j8bx5gr.fsf@gnu.org> <875xsrjoi9.fsf@gnu.org> Date: Sat, 27 Jul 2024 22:50:35 +0200 Message-ID: <87v80qftk4.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Stefan Monnier , 72313@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Arash Esbati writes: > Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" writes: > >>> So the conclusion is to simply (require 'cl-lib) instead of >>> (eval-when-compile (require 'cl-lib))? But how can the >>> byte-compiler conclude that cl-member might not be defined at >>> runtime given that it's an autoloaded function? >> >> It's autoloaded from `cl-seq` when `cl-lib` is loaded. >> It's not autoloaded at startup. What's that magic? emacs -Q (featurep 'cl-lib) ;=> nil (describe-function 'cl-member) ; prints the help string to *Messages* (featurep 'cl-lib) ;=> t Do the help facilities load stuff on demand? > How about this approach then? > > --8<---------------cut here---------------start------------->8--- > diff --git a/tex-info.el b/tex-info.el > index dc69762e..0f77e057 100644 > --- a/tex-info.el > +++ b/tex-info.el > @@ -25,7 +25,8 @@ > ;;; Code: > > (eval-when-compile > - (require 'cl-lib)) > + (require 'cl-lib) > + (declare-function cl-member "cl-seq")) > > (require 'tex) > --8<---------------cut here---------------end--------------->8--- Let's just require cl-lib. declare-function only silences the byte-compiler and the usage of cl-member at runtime is a fact; no cheating allowed. It's also an implementation detail we should not bother with. Tomorrow, Stefan might have optimized it to use some cl-memql-1-wazzup for the specific case we have here. :-) Bye, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 27 17:25:32 2024 Received: (at submit) by debbugs.gnu.org; 27 Jul 2024 21:25:32 +0000 Received: from localhost ([127.0.0.1]:42499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXouy-0008Sg-Aa for submit@debbugs.gnu.org; Sat, 27 Jul 2024 17:25:32 -0400 Received: from lists.gnu.org ([209.51.188.17]:34194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXouw-0008SY-7l for submit@debbugs.gnu.org; Sat, 27 Jul 2024 17:25:30 -0400 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 1sXoul-0007Ph-C5 for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 17:25:19 -0400 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 1sXoul-0005fo-2Y; Sat, 27 Jul 2024 17:25:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=HUHLKhJk4+KsJ4Eu+QDh4DiyHt7eO/qGjqH3A7z55Kg=; b=Qs44kZoStc3g81SV/Jvh H6dcjxBWjtGSLDjzhu53jz2ewlfWtt1JFf5CHGeA9Ds7kpOBObb4hgz2StTrsk+0s1LYMxN2R00mh sJIDC77gjjf6DJmM/09ITlQuzRoT3INjW9p/T+2t+rzHKsNUguD67OfYAnG51zLLAhgb6SwslRJ3i 46IiCjMRNns5XVYsKu63ZweUXnNSAbazY3MgenrlS35jX8isVntr4mKAZuocXjrwaySParzoFBl1P rLUUcvPv063fo2rPZiP5fBUkiwZ7TFyuZ0W6QXaNXKCLdX+wxUabCW4d3z+UspGKue2OfVjUgczq3 KgmNPKTqtMBm0g==; From: Arash Esbati To: Tassilo Horn Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: <87v80qftk4.fsf@gnu.org> (Tassilo Horn's message of "Sat, 27 Jul 2024 22:50:35 +0200") References: <874j8bx5gr.fsf@gnu.org> <875xsrjoi9.fsf@gnu.org> <87v80qftk4.fsf@gnu.org> Date: Sat, 27 Jul 2024 23:25:14 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Stefan Monnier , 72313@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Tassilo Horn writes: > Let's just require cl-lib. declare-function only silences the > byte-compiler and the usage of cl-member at runtime is a fact; no > cheating allowed. It's also an implementation detail we should not > bother with. I'm not sure if this is cheating, but I'm easy, and if we want to require cl-lib, I'd do it in tex.el which is loaded by all .el files; so basically: --8<---------------cut here---------------start------------->8--- diff --git a/tex-info.el b/tex-info.el index dc69762e..4ae14401 100644 --- a/tex-info.el +++ b/tex-info.el @@ -24,9 +24,6 @@ ;;; Code: -(eval-when-compile - (require 'cl-lib)) - (require 'tex) (require 'texinfo) diff --git a/tex.el b/tex.el index e67d2059..729e4db2 100644 --- a/tex.el +++ b/tex.el @@ -33,8 +33,8 @@ (require 'custom) (require 'tex-site) +(require 'cl-lib) (eval-when-compile - (require 'cl-lib) (require 'subr-x)) (require 'texmathp) ;; seq.el is preloaded in Emacs 29, so the next form can be removed --8<---------------cut here---------------end--------------->8--- (plus some more changes to come). > Tomorrow, Stefan might have optimized it to use some cl-memql-1-wazzup > for the specific case we have here. :-) I will not put my money on another bet :) Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 28 00:59:30 2024 Received: (at 72313) by debbugs.gnu.org; 28 Jul 2024 04:59:30 +0000 Received: from localhost ([127.0.0.1]:42606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXw0I-0004Eu-3t for submit@debbugs.gnu.org; Sun, 28 Jul 2024 00:59:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXw01-0004ES-Dy for 72313@debbugs.gnu.org; Sun, 28 Jul 2024 00:59:28 -0400 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 1sXvzk-0006GS-Vo; Sun, 28 Jul 2024 00:58:56 -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=NdGrYBYF0F156hKUTj+VFtn6SzkTNQgAgplSnC4nUEo=; b=Tmacyv+3WXQZ ZBuu/ReOEm4HXRXxqCtV7zGKL5NzBqId+JTIT8b3xtnwm/8nRROKXrDcLPZFP211XMLirCSVdJ126 SVFrk5vtMpiRp+9ZueZutDXiENUxh5bbmfAYFO8FaqhRQ0d/2UHd0SASRaVoNgEtgMvlo4vd5y9QV UxdympCSh9rurVeBVf7KFw6hts74fVoupfiYuymtf41QhfOlS2mTQIMs2VIQfK6bMUzsHbTAwyfzG xCeU8OfY4XyjQBZ4uLVuocqqynp0QL92Me4iozgr82Th7gQyRx9B73EKAenHLjulwgmyDd6BYkjGJ MRuOeL7U0FkEPQ1T+6jzYQ==; Date: Sun, 28 Jul 2024 07:58:51 +0300 Message-Id: <86a5i2159w.fsf@gnu.org> From: Eli Zaretskii To: Tassilo Horn In-Reply-To: <87v80qftk4.fsf@gnu.org> (message from Tassilo Horn on Sat, 27 Jul 2024 22:50:35 +0200) Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew References: <874j8bx5gr.fsf@gnu.org> <875xsrjoi9.fsf@gnu.org> <87v80qftk4.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72313 Cc: arash@gnu.org, 72313@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 72313@debbugs.gnu.org, monnier@iro.umontreal.ca > From: Tassilo Horn > Date: Sat, 27 Jul 2024 22:50:35 +0200 > > Arash Esbati writes: > > > Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of > > text editors" writes: > > > >>> So the conclusion is to simply (require 'cl-lib) instead of > >>> (eval-when-compile (require 'cl-lib))? But how can the > >>> byte-compiler conclude that cl-member might not be defined at > >>> runtime given that it's an autoloaded function? > >> > >> It's autoloaded from `cl-seq` when `cl-lib` is loaded. > >> It's not autoloaded at startup. > > What's that magic? > > emacs -Q > (featurep 'cl-lib) ;=> nil > (describe-function 'cl-member) ; prints the help string to *Messages* > (featurep 'cl-lib) ;=> t > > Do the help facilities load stuff on demand? Yes, of course. As the rest of Emacs, actually. In fact, only help.el is preloaded, the rest of Help facilities (help-mode, help-fns, apropos, etc.) are loaded on demand only. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 31 13:45:04 2024 Received: (at submit) by debbugs.gnu.org; 31 Jul 2024 17:45:04 +0000 Received: from localhost ([127.0.0.1]:50265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZDNn-00076I-Pz for submit@debbugs.gnu.org; Wed, 31 Jul 2024 13:45:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:41532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZDNl-00075h-HQ for submit@debbugs.gnu.org; Wed, 31 Jul 2024 13:45:01 -0400 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 1sZDNT-0006sJ-JI for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2024 13:44:44 -0400 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 1sZDNT-0006H2-9T; Wed, 31 Jul 2024 13:44:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ixMx1XQ5+RhZkXM+pBePLJROw9pFJy3fjVQpx3AORbI=; b=aQwCqFl2VlPAYT0zu9bD OcQCPu4Joxqgq4n+iUBtAvMoObfhJ5EGYl2KVao+ObWiI+32WUVTQyo/+D4DDc5AWyFCdEiFtErbs LcJlRZIlcUhsRe2Zi11PPLsxbl6m1XIYI8tQv0s7Cjna/6iw25/de+t/Tg6G96GIRhKAtRlvCUYPa hTNcIu/5PeQJ7CT3v6DFblDn4gSjFjdsZdLaqI9R+IA9aFA/DWz866gt9SFD3rvN2+J4urfztjPT1 fatCKa0r3pNhZ4Yy1LNhQnCcR+ZpkIKdEqMZ/zlN982UuuETAtH4K50xHBkdcZTiz1g4y7Wv2G2CR Wgyc2mOlxVRdfw==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrjeeigdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepte eltdegheffhfetkeekveekkeevgfegkeetueffleeiheekhffgffeuueegieffnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpth htoheptd X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Arash Esbati Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: (Arash Esbati's message of "Sat, 27 Jul 2024 23:25:14 +0200") References: <874j8bx5gr.fsf@gnu.org> <875xsrjoi9.fsf@gnu.org> <87v80qftk4.fsf@gnu.org> Date: Wed, 31 Jul 2024 19:44:26 +0200 Message-ID: <87h6c5ihhh.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Stefan Monnier , 72313-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Arash Esbati writes: Hi Arash, >> Let's just require cl-lib. declare-function only silences the >> byte-compiler and the usage of cl-member at runtime is a fact; no >> cheating allowed. It's also an implementation detail we should not >> bother with. > > I'm not sure if this is cheating, but I'm easy, and if we want to > require cl-lib, I'd do it in tex.el which is loaded by all > .el files; so basically: Yes, I've done something along those lines (and also required the very small subr-x). AUCTeX is traditionally very conservative with dependencies but we should not limit ourselves by not using basic emacs functions in the common libs like cl-lib, seq, or subr-x. I'm closing this report. Thanks for the explanations, Stefan & Eli. Bye, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 31 15:55:47 2024 Received: (at submit) by debbugs.gnu.org; 31 Jul 2024 19:55:47 +0000 Received: from localhost ([127.0.0.1]:50326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZFQJ-00021q-0g for submit@debbugs.gnu.org; Wed, 31 Jul 2024 15:55:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:54658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZFQH-00021i-46 for submit@debbugs.gnu.org; Wed, 31 Jul 2024 15:55:46 -0400 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 1sZFQ0-00012u-Rq for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2024 15:55:28 -0400 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 1sZFPz-0006rH-MQ; Wed, 31 Jul 2024 15:55:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=rlYUcgeIEERBSO3/d35Z1M6/V1ClVmnhn9XBr6CUo8s=; b=seiCXPGAO1w47WNEYHLJ YSGQczF7PoDYigY7uTTbSNL/F+M+7TzJKE+DCS6UOi9SrFUcZ3TlvQC+FfqWA2s06WJZju0jrqnUL TaEA/Sblh7/iO00b8xiIbSP2bFigSY1gfrJOsMKAJ4VweW6an7VnOB4k8mr7knM5GetXhg4ts2wwX MV31KWZYjoqENuW3bwyIhuqmEc/Puz7rObS+PRPzq3bT4aoOz7oJ1/TKeMGtOiM21GxKmOb7mg3RH DdO+izHoTZ2fQSPzNPWVwlIkq8fOkNKbhne8ZxVmm1sA0Cqc34bfv/UP+EEJ/sIXcVgXQmG4/N+xt JMYNd8o8injBsA==; From: Arash Esbati To: Tassilo Horn Subject: Re: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew In-Reply-To: <87h6c5ihhh.fsf@gnu.org> (Tassilo Horn's message of "Wed, 31 Jul 2024 19:44:26 +0200") References: <874j8bx5gr.fsf@gnu.org> <875xsrjoi9.fsf@gnu.org> <87v80qftk4.fsf@gnu.org> <87h6c5ihhh.fsf@gnu.org> Date: Wed, 31 Jul 2024 21:55:24 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Stefan Monnier , 72313-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Tassilo, Tassilo Horn writes: > Yes, I've done something along those lines (and also required the very > small subr-x). AUCTeX is traditionally very conservative with > dependencies but we should not limit ourselves by not using basic > emacs functions in the common libs like cl-lib, seq, or subr-x. Thanks, I think this change was sowewhat overdue. Best, Arash From unknown Fri Aug 15 03:57:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 29 Aug 2024 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator