From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#62889: 29.0.60; (setopt ...) does not give "assignment to free variable" warning Date: Tue, 18 Apr 2023 06:18:55 +0000 Message-ID: <87pm813e7k.fsf@posteo.net> References: <2678912.mvXUDI8C0e@192.168.1.69> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25811"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62889@debbugs.gnu.org To: ar0x2ff@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 18 08:19:28 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1poega-0006U0-Dn for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Apr 2023 08:19:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poegG-0008TE-Am; Tue, 18 Apr 2023 02:19:08 -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 1poegB-0008QH-0r for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2023 02:19:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poegA-0007Bs-NH for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2023 02:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1poegA-0006bg-9O for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2023 02:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Apr 2023 06:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62889 X-GNU-PR-Package: emacs Original-Received: via spool by 62889-submit@debbugs.gnu.org id=B62889.168179871325357 (code B ref 62889); Tue, 18 Apr 2023 06:19:02 +0000 Original-Received: (at 62889) by debbugs.gnu.org; 18 Apr 2023 06:18:33 +0000 Original-Received: from localhost ([127.0.0.1]:57535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poefh-0006av-8p for submit@debbugs.gnu.org; Tue, 18 Apr 2023 02:18:33 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:46793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poeff-0006ag-Ic for 62889@debbugs.gnu.org; Tue, 18 Apr 2023 02:18:32 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 4EB9D24020A for <62889@debbugs.gnu.org>; Tue, 18 Apr 2023 08:18:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681798705; bh=EzGpywYGg2T4rQ7M7tNtSrAHBF0eSJRUN6F/luMmcYo=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=fl1JwLwoGLm4kmG5hZ+sLx3P81J2me5y59RZMIX8ioP7LwRBHaw6C1z0jdBQJr9qp OVw4qEvFUt+nGil8NW2QWrHsXhHtvcfVQ7raA6zcNYX531zcr7IFghDgBJzq/YtbyQ NKPJeMpkfMnI2RJt272CZ9Yt+cvWPqC9gz7fBonK7YLphuK7ELm6a7JiJfhCs1QX6V JeEcoZ2Vs43LhP3l4N7PvMt+kjizc1GsSMA04ef/rWOABzuplvrI9xhSbgl29ecOvv w+B7hl5c9wfZwyUxuBLGg3mO9XTdDZHFHpvgwiQl6RTEVHucLrZVOXGiUAIsqOBVoF Cs8dBPfdXDxWA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q0tym6ClLz6tmv; Tue, 18 Apr 2023 08:18:24 +0200 (CEST) In-Reply-To: <2678912.mvXUDI8C0e@192.168.1.69> (ar0x2ff@gmail.com's message of "Sun, 16 Apr 2023 17:59:37 +0200") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260206 Archived-At: ar0x2ff@gmail.com writes: > If I open emacs -q and write the following code in a Emacs Lisp buffer: > > ;;; init.el --- summary > > ;;; Commentary: > > ;;; Code: > > (setq var1 2) > (customize-set-variable var2 2) > (setopt var3 2) > > (provide 'init) > ;;; init.el ends here > > I'll get the following errors, if i enable FlyMake: > > 7 6 warning e-f-b-c assignment to free variable =E2=80=98var1=E2=80=99 > 8 24 warning e-f-b-c reference to free variable =E2=80=98var2=E2=80=99 > > Why setopt is not underlined here? I know it's a new macro introduced in = Emacs=20 > 29 but I wonder if it is intended to be like this or the linter is just=20 > misbehaving here. var2 should also not be highlighted, since the first argument to the function `customize-set-variable' is a symbol, and the byte compiler correctly states that it doesn't know that any variable "var2" will be defined. If you macroexpand setopt, you will see that it generates (setopt--set 'var3 2) which is all fine, since no functions are being invoked with undefined variables. The reason this makes sense is that not all user options have to be loaded when they are set. A number of them are even auto-loaded and will load the library for the necessary user-option setters if necessary. > In GNU Emacs 29.0.60 (build 1, x86_64-redhat-linux-gnu, GTK+ Version > 3.24.37, cairo version 1.17.6) of 2023-03-14 built on > 2cafab91c998469c95c4917f66b01a98 > System Description: Fedora Linux 37 (Thirty Seven) > > Configured using: > 'configure --build=3Dx86_64-redhat-linux-gnu > --host=3Dx86_64-redhat-linux-gnu --program-prefix=3D > --disable-dependency-tracking --prefix=3D/usr --exec-prefix=3D/usr > --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=3D/etc > --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64 > --libexecdir=3D/usr/libexec --localstatedir=3D/var > --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man > --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-png > --with-rsvg --with-tiff --with-xft --with-xpm --with-gpm=3Dno > --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json > --with-pgtk --with-native-compilation --enable-link-time-optimization > build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-g= nu > CC=3Dgcc 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -flto=3Dauto -ffat-lto-objects > -fexceptions -g -grecord-gcc-switches -pipe -Wall > -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2 > -Wp,-D_GLIBCXX_ASSERTIONS > -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong > -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric > -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' > LDFLAGS=3D-Wl,-z,relro > PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig CXX=3Dg++ > 'CXXFLAGS=3D-O2 -flto=3Dauto -ffat-lto-objects -fexceptions -g > -grecord-gcc-switches -pipe -Wall -Werror=3Dformat-security > -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS > -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong > -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric > -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'' > > Configured features: > ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON > LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY > INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF > TOOLKIT_SCROLL_BARS XIM XWIDGETS GTK3 ZLIB > > Important settings: > value of $LANG: it_IT.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: ELisp/d > > Minor modes in effect: > flymake-mode: t > tooltip-mode: t > global-eldoc-mode: t > eldoc-mode: t > show-paren-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > line-number-mode: t > indent-tabs-mode: t > transient-mark-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > > Load-path shadows: > /usr/share/emacs/site-lisp/lilypond-init hides /usr/share/emacs/site-lisp/ > site-start.d/lilypond-init > > Features: > (shadow sort mail-extr emacsbug message mailcap yank-media puny dired > dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 > epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 > mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums > mm-util mail-prsvr mail-utils noutline outline checkdoc lisp-mnt > flymake-proc flymake project byte-opt compile text-property-search > comint ansi-osc ansi-color ring thingatpt time-date cl-loaddefs comp > comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode > bytecomp byte-compile 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 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 xwidget-internal dbusbind > inotify dynamic-setting system-font-setting font-render-setting cairo > gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) > > Memory information: > ((conses 16 101023 9352) > (symbols 48 8599 0) > (strings 32 25108 1552) > (string-bytes 1 788606) > (vectors 16 18679) > (vector-slots 8 373173 11952) > (floats 8 37 38) > (intervals 56 517 0) > (buffers 976 16))