From unknown Wed Jun 18 00:27:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#46534 <46534@debbugs.gnu.org> To: bug#46534 <46534@debbugs.gnu.org> Subject: Status: Lexical change in bindat breaks weechat.el Reply-To: bug#46534 <46534@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:27:07 +0000 retitle 46534 Lexical change in bindat breaks weechat.el reassign 46534 emacs submitter 46534 Tony Olagbaiye severity 46534 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 15 10:06:23 2021 Received: (at submit) by debbugs.gnu.org; 15 Feb 2021 15:06:23 +0000 Received: from localhost ([127.0.0.1]:38474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBfS9-0002nl-1Z for submit@debbugs.gnu.org; Mon, 15 Feb 2021 10:06:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:46518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBesM-0001hN-1b for submit@debbugs.gnu.org; Mon, 15 Feb 2021 09:29:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBesL-0003Cf-NU for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 09:29:21 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:21311) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBesJ-0002qo-2M for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 09:29:21 -0500 Date: Mon, 15 Feb 2021 14:29:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fron.io; s=protonmail; t=1613399353; bh=mnmFGwcJ7T+egE5dAmujyRHQLsDByo5DWC9/q+2gBQ0=; h=Date:To:From:Cc:Reply-To:Subject:From; b=GkNIG3HRezkWjq4Q8ncxY+Fwx3UYLImovIREQ1SlnAVD5jFqmcM5rqluy1F/e9TYv xFgtDIrXx6NGDnl6JkvegYAiaW9046MIZ1cMcVjxYwlqZY77zEQUrmmNo1RvM3Gd87 n9Rf8TVBL5XRpo/nHgv0p2pyqPuUGKbI8/zBLa5g= To: bug-gnu-emacs@gnu.org From: Tony Olagbaiye Subject: Lexical change in bindat breaks weechat.el Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------fe329ce51dbe69fee80e210e59425de6"; charset=utf-8 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Received-SPF: pass client-ip=185.70.40.131; envelope-from=me@fron.io; helo=mail-40131.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 15 Feb 2021 10:06:17 -0500 Cc: 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: , Reply-To: Tony Olagbaiye Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) -----------------------fe329ce51dbe69fee80e210e59425de6 Content-Type: multipart/mixed; boundary="---------------------56c0e701a4870ddd30882c27a176ffdb" -----------------------56c0e701a4870ddd30882c27a176ffdb Content-Type: multipart/alternative; boundary="---------------------96dc1829faa00680d29212a6b99bccda" -----------------------96dc1829faa00680d29212a6b99bccda Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, As of commit c8c4d65d6510724acd40527a9af67e21e3cf4d5e (as bisected in my st= ead by wasamasa on \#emacs) it seems bindat changes have broken weechat.el,= or specifically the weechat-relay module. Attached a minimal reproducible script which fails on master but succeeds p= rior to the mentioned commit: weechat-bindat.bug.el.txt Backtrace: Debugger entered--Lisp error: (void-variable struct) (bindat-get-field stru= ct 'len) (weechat--relay-bindat-unsigned-to-signed (bindat-get-field struct= 'len) 4) (let ((len (weechat--relay-bindat-unsigned-to-signed (bindat-get-= field struct 'len) 4))) (if (<=3D len 0) 0 len)) bindat--unpack-group(((len= u32) (val str (eval (let ((len (weechat--relay-bindat-unsigned-to-signed .= .. 4))) (if (<=3D len 0) 0 len)))))) bindat--unpack-group(((length u32) (co= mpression u8) (id struct weechat--relay-str-spec) (data vec (eval (let ((l = (- ... 4 1 ...))) l))))) bindat-unpack(((length u32) (compression u8) (id s= truct weechat--relay-str-spec) (data vec (eval (let ((l (- ... 4 1 ...))) l= )))) "\\0\\0\\0$\\0\\0\\0\\0\\4G255inf\\0\\0\\0\\7version\\0\\0\\0\\0053.0.= 1") weechat-unpack-message("\\0\\0\\0$\\0\\0\\0\\0\\4G255inf\\0\\0\\0\\7ver= sion\\0\\0\\0\\0053.0.1") weechat--relay-parse-new-message() weechat--relay= -process-filter(\# "\\0\\0\\0$\\0\\0\\0\\0\\4G25= 5inf\\0\\0\\0\\7version\\0\\0\\0\\0053.0.1") Best, bqv -----------------------96dc1829faa00680d29212a6b99bccda Content-Type: multipart/related; boundary="---------------------46cff00ab9e2901043ecbc4f29853bf2" -----------------------46cff00ab9e2901043ecbc4f29853bf2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 SGksPGJyPjxicj5BcyBvZiBjb21taXQgYzhjNGQ2NWQ2NTEwNzI0YWNkNDA1MjdhOWFmNjdlMjFl M2NmNGQ1ZSAoYXMgYmlzZWN0ZWQgaW4gbXkgc3RlYWQgYnkgd2FzYW1hc2Egb24gI2VtYWNzKSBp dCBzZWVtcyBiaW5kYXQgY2hhbmdlcyBoYXZlIGJyb2tlbiB3ZWVjaGF0LmVsLCBvciBzcGVjaWZp Y2FsbHkgdGhlIHdlZWNoYXQtcmVsYXkgbW9kdWxlLjxicj48YnI+QXR0YWNoZWQgYSBtaW5pbWFs IHJlcHJvZHVjaWJsZSBzY3JpcHQgd2hpY2ggZmFpbHMgb24gbWFzdGVyIGJ1dCBzdWNjZWVkcyBw cmlvciB0byB0aGUgbWVudGlvbmVkIGNvbW1pdDogd2VlY2hhdC1iaW5kYXQuYnVnLmVsLnR4dDxi cj48YnI+QmFja3RyYWNlOjxicj48YnI+RGVidWdnZXIgZW50ZXJlZC0tTGlzcCBlcnJvcjogKHZv aWQtdmFyaWFibGUgc3RydWN0KSAoYmluZGF0LWdldC1maWVsZCBzdHJ1Y3QgJ2xlbikgKHdlZWNo YXQtLXJlbGF5LWJpbmRhdC11bnNpZ25lZC10by1zaWduZWQgKGJpbmRhdC1nZXQtZmllbGQgc3Ry dWN0ICdsZW4pIDQpIChsZXQgKChsZW4gKHdlZWNoYXQtLXJlbGF5LWJpbmRhdC11bnNpZ25lZC10 by1zaWduZWQgKGJpbmRhdC1nZXQtZmllbGQgc3RydWN0ICdsZW4pIDQpKSkgKGlmICgmbHQ7PSBs ZW4gMCkgMCBsZW4pKSBiaW5kYXQtLXVucGFjay1ncm91cCgoKGxlbiB1MzIpICh2YWwgc3RyIChl dmFsIChsZXQgKChsZW4gKHdlZWNoYXQtLXJlbGF5LWJpbmRhdC11bnNpZ25lZC10by1zaWduZWQg Li4uIDQpKSkgKGlmICgmbHQ7PSBsZW4gMCkgMCBsZW4pKSkpKSkgYmluZGF0LS11bnBhY2stZ3Jv dXAoKChsZW5ndGggdTMyKSAoY29tcHJlc3Npb24gdTgpIChpZCBzdHJ1Y3Qgd2VlY2hhdC0tcmVs YXktc3RyLXNwZWMpIChkYXRhIHZlYyAoZXZhbCAobGV0ICgobCAoLSAuLi4gNCAxIC4uLikpKSBs KSkpKSkgYmluZGF0LXVucGFjaygoKGxlbmd0aCB1MzIpIChjb21wcmVzc2lvbiB1OCkgKGlkIHN0 cnVjdCB3ZWVjaGF0LS1yZWxheS1zdHItc3BlYykgKGRhdGEgdmVjIChldmFsIChsZXQgKChsICgt IC4uLiA0IDEgLi4uKSkpIGwpKSkpICJcMFwwXDAkXDBcMFwwXDBcNEcyNTVpbmZcMFwwXDBcN3Zl cnNpb25cMFwwXDBcMDA1My4wLjEiKSB3ZWVjaGF0LXVucGFjay1tZXNzYWdlKCJcMFwwXDAkXDBc MFwwXDBcNEcyNTVpbmZcMFwwXDBcN3ZlcnNpb25cMFwwXDBcMDA1My4wLjEiKSB3ZWVjaGF0LS1y ZWxheS1wYXJzZS1uZXctbWVzc2FnZSgpIHdlZWNoYXQtLXJlbGF5LXByb2Nlc3MtZmlsdGVyKCMm bHQ7cHJvY2VzcyB3ZWVjaGF0LXJlbGF5LXRscyZndDsgIlwwXDBcMCRcMFwwXDBcMFw0RzI1NWlu ZlwwXDBcMFw3dmVyc2lvblwwXDBcMFwwMDUzLjAuMSIpPGJyPjxicj5CZXN0LDxicj5icXY= -----------------------46cff00ab9e2901043ecbc4f29853bf2-- -----------------------96dc1829faa00680d29212a6b99bccda-- -----------------------56c0e701a4870ddd30882c27a176ffdb Content-Type: text/plain; name="weechat-bindat.bug.el.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; fil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9uKSkKICAgIChlcnJvciAiQ29tcHJlc3Npb24gbm90IHN1cHBvcnRlZCIp KQogICh3aGlsZSAoPCBvZmZzZXQgKGxlbmd0aCBkYXRhKSkKCSAoY2wtbXVsdGlwbGUtdmFsdWUt YmluZCAob2JqIG9mZnNldCopIChtaW5yZXByby0tdW5wYWNrLW1lc3NhZ2UtY29udGVudHMKCQkJ CQkJIChzdWJzdHJpbmcgZGF0YSBvZmZzZXQpKQoJCQkJIChzZXRxIG9mZnNldCAoKyBvZmZzZXQg b2Zmc2V0KikpCgkJCQkgKHNldHEgYWNjIChjb25zIG9iaiBhY2MpKSkpCiAgKGNsLXZhbHVlcyAo Y29ucyBtc2ctaWQgKHJldmVyc2UgYWNjKSkKCSAgICAgKGJpbmRhdC1nZXQtZmllbGQgbXNnICds ZW5ndGgpKSkK -----------------------56c0e701a4870ddd30882c27a176ffdb Content-Type: application/pgp-keys; name="publickey - EmailAddress(s=me@fron.io) - 0x3026807C.asc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="publickey - EmailAddress(s=me@fron.io) - 0x3026807C.asc" LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCkNvbW1lbnQ6IGh0dHBzOi8vZ29w ZW5wZ3Aub3JnClZlcnNpb246IEdvcGVuUEdQIDIuMC4xCgp4ak1FWGM4dFpoWUpLd1lCQkFIYVJ3 OEJBUWRBanBKdUs5bUQyYTN3aEVHdncrY2RyMzhKNkFUM2NKRG9NNjVHCng0YnRmbS9ORjIxbFFH WnliMjR1YVc4Z1BHMWxRR1p5YjI0dWFXOCt3bmNFRUJZS0FCOEZBbDNQTFdZR0N3a0gKQ0FNQ0JC VUlDZ0lERmdJQkFoa0JBaHNEQWg0QkFBb0pFTGN0V010U2Eyd3hCdGdBLzI1aFVNZXZTMnRmQURj OApFaUxadWhOMWwwTGwrOUluelpWYk44KytmSHBaQVBzRmh1dzJYNFJHVWkwT21DcW1hajhDVGdi NXB6dEFJaWlMCnhJWmYvM0ZHRE00NEJGM1BMV1lTQ2lzR0FRUUJsMVVCQlFFQkIwQlFCck50MDNw ZG56UjBpZ3EycXB5NXZZbTEKYjVlYk9wNGcxYThGZGJQM1F3TUJDQWZDWVFRWUZnZ0FDUVVDWGM4 dFpnSWJEQUFLQ1JDM0xWakxVbXRzTVhGRwpBUUNieGJaZ2ZyRlBBc3Z0QlVWTitxWUNqMCtPRGFk azV2UC9Tajg0VnZZN29BRC9SeXliTExmYnNEeEpHbStmCnYrYzBubkttUGx5V2tYUFc4emg2Qlg4 b0pRaz0KPTNWZ2UKLS0tLS1FTkQgUEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQ== -----------------------56c0e701a4870ddd30882c27a176ffdb-- -----------------------fe329ce51dbe69fee80e210e59425de6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wmgEARYIABAFAmAqhTEJELctWMtSa2wxAAoJELctWMtSa2wxKf4A/2ScnbMw 46t2xKuoXT62Zv4XAHNhPGhFY+Sp+JqgkL6IAQD/ZtjQaFB33TOGv3VxI0G6 hXYBijdYyebfvPfuICAmCg== =lLSA -----END PGP SIGNATURE----- -----------------------fe329ce51dbe69fee80e210e59425de6-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 15 10:50:43 2021 Received: (at 46534) by debbugs.gnu.org; 15 Feb 2021 15:50:43 +0000 Received: from localhost ([127.0.0.1]:38551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBg94-0003ws-Vq for submit@debbugs.gnu.org; Mon, 15 Feb 2021 10:50:43 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBg91-0003wa-R0 for 46534@debbugs.gnu.org; Mon, 15 Feb 2021 10:50:41 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7342B10022E; Mon, 15 Feb 2021 10:50:33 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E5706100091; Mon, 15 Feb 2021 10:50:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1613404231; bh=WFhtbkB9KaBabvpr9YVVzkG04CNWsxyiGLVUtWVgJPA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=RUPMS1OWKWbpq2rfP4Y3Zjm/fTIxWyd3dCM/ETLzeJtIP2gX3K4mZv7sBBwn8sfV7 Oianda7WxeDScDQIFcBDsndr+LqdiWd8cOSFFgyb7rnRquS6Rv4Liu0mVs+bSjQ9lY uGE9ONbXVE5KKhI6AC51wD8YXijvWh9Np3ldY3MxeJTnZlZdpaKs1MmG0mPjxpbNH+ Wgp4cGKaeHoHdL/cjWCWeet12NpVQXI+WC0lQBV2OtD9aTR6U0Wje53SUSCQtLw+Py urjnnF2Wxq1o4DgsfuXQUTOOmkEueiQaSTi3x0KlyNoWUIdxStLoKJgW+hjwasVzTm mPPsnfV8f3QUg== Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B4D8C1203B6; Mon, 15 Feb 2021 10:50:31 -0500 (EST) From: Stefan Monnier To: Tony Olagbaiye Subject: bug#46534: Lexical change in bindat breaks weechat.el Message-ID: References: Date: Mon, 15 Feb 2021 10:50:30 -0500 In-Reply-To: (Tony Olagbaiye's message of "Mon, 15 Feb 2021 14:29:06 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) 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 AWL -0.090 Adjusted score from AWL reputation of From: address 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 X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46534 Cc: 46534@debbugs.gnu.org, "Kim F. Storm" 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 Kim, long time no see. I'd appreciate your opinion on this issue with bindat.el. ] > (defconst minrepro--str-spec > '((len u32) > (val str (eval (let ((len (minrepro--bindat-unsigned-to-signed > (bindat-get-field struct 'len) > 4))) > ;; Hack for signed/unsigned problems > (if (<= len 0) 0 len)))))) Hmm... the doc of bindat.el does not include `struct` among the vars you can use in `eval`. OTOH, a variable which you can use is `last` and it indeed contains exactly the info you need from `struct`, so you can rewrite the above to: (defconst minrepro--str-spec '((len u32) (val str (eval (let ((len (minrepro--bindat-unsigned-to-signed last 4))) ;; Hack for signed/unsigned problems (if (<= len 0) 0 len)))))) > (defconst minrepro--message-spec > '((length u32) > (compression u8) > (id struct minrepro--str-spec) > (data vec (eval (let ((l (- (bindat-get-field struct 'length) > 4 ;length > 1 ;compression > (+ 4 (length (bindat-get-field struct 'id 'val)))))) > l))))) This one OTOH can't just use `last` since that only gives us the `id` field but not the `length` field :-( I can't see any way to do what you want given the documentation found in the `Commentary:` of `bindat.el`, so I guess we do need to extend the documented functionality. I installed the patch below, for now. It fixes the problem in your test case and hopefully in other cases as well. Please confirm. Stefan diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index 0d9ba57d66..bf01347ae0 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -26,7 +26,7 @@ ;; Packing and unpacking of (binary) data structures. ;; ;; The data formats used in binary files and network protocols are -;; often structed data which can be described by a C-style structure +;; often structured data which can be described by a C-style structure ;; such as the one shown below. Using the bindat package, decoding ;; and encoding binary data formats like these is made simple using a ;; structure specification which closely resembles the C style @@ -135,7 +135,8 @@ ;; | ( [FIELD] repeat COUNT ITEM... ) ;; -- In (eval EXPR), the value of the last field is available in -;; the dynamically bound variable `last'. +;; the dynamically bound variable `last' and all the previous +;; ones in the variable `struct'. ;; TYPE ::= ( eval EXPR ) -- interpret result as TYPE ;; | u8 | byte -- length 1 @@ -191,7 +192,7 @@ ;;; Code: ;; Helper functions for structure unpacking. -;; Relies on dynamic binding of BINDAT-RAW and BINDAT-IDX +;; Relies on dynamic binding of `bindat-raw' and `bindat-idx'. (defvar bindat-raw) (defvar bindat-idx) @@ -276,8 +277,8 @@ bindat--unpack-item (t nil))) (defun bindat--unpack-group (spec) - (with-suppressed-warnings ((lexical last)) - (defvar last)) + (with-suppressed-warnings ((lexical struct last)) + (defvar struct) (defvar last)) (let (struct last) (while spec (let* ((item (car spec)) @@ -378,9 +379,9 @@ bindat--fixed-length-alist (ip . 4))) (defun bindat--length-group (struct spec) - (with-suppressed-warnings ((lexical last)) - (defvar last)) - (let (last) + (with-suppressed-warnings ((lexical struct last)) + (defvar struct) (defvar last)) + (let ((struct struct) last) (while spec (let* ((item (car spec)) (field (car item)) @@ -544,9 +545,9 @@ bindat--pack-item (setq bindat-idx (+ bindat-idx len))))) (defun bindat--pack-group (struct spec) - (with-suppressed-warnings ((lexical last)) - (defvar last)) - (let (last) + (with-suppressed-warnings ((lexical struct last)) + (defvar struct) (defvar last)) + (let ((struct struct) last) (while spec (let* ((item (car spec)) (field (car item)) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 15 14:20:12 2021 Received: (at 46534) by debbugs.gnu.org; 15 Feb 2021 19:20:12 +0000 Received: from localhost ([127.0.0.1]:38725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBjPn-0000dH-Sb for submit@debbugs.gnu.org; Mon, 15 Feb 2021 14:20:12 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:34619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBjPl-0000cn-83 for 46534@debbugs.gnu.org; Mon, 15 Feb 2021 14:20:11 -0500 Date: Mon, 15 Feb 2021 19:19:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fron.io; s=protonmail; t=1613416802; bh=1nYvR+e2uvIYKWNWFDVDe45HY2TtLjREo7Zhr4OysTs=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=gDkj2V7bFoLBbaQi8gkzVrwpHbdOlCY/M2Azkfw4NSzxuw48dFPeZkdjtWKXtkRFO LjRL9b/kL9qXF+pyO09+NwvsxdXCYe7TG/LFNxadl0J3wHHa/c3L2jBc8UOy0MP0k6 aO0pu8ITK/ldQeF89Pc9itOCx/52rKicoedvhG9w= To: monnier@iro.umontreal.ca From: Tony Olagbaiye Subject: Re: bug#46534: Lexical change in bindat breaks weechat.el Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------b537be18bd8e08931448240e78ae305c"; charset=utf-8 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46534 Cc: 46534@debbugs.gnu.org, storm@cua.dk 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: , Reply-To: Tony Olagbaiye Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) -----------------------b537be18bd8e08931448240e78ae305c Content-Type: multipart/mixed; boundary="---------------------5caa3414225e814cc515c07fe2fb7f9e" -----------------------5caa3414225e814cc515c07fe2fb7f9e Content-Type: multipart/alternative; boundary="---------------------1f1ca185d9c3b27c506ecc9f2e88d20a" -----------------------1f1ca185d9c3b27c506ecc9f2e88d20a Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Indeed, I can confirm this fixes the test file as well as weechat.el proper= , thanks! Sent from ProtonMail mobile \-------- Original Message -------- On 15 Feb 2021, 15:50, Stefan Monnier < monnier@iro.umontreal.ca> wrote: > > > > \[ Hi Kim, long time no see. > I'd appreciate your opinion on this issue with bindat.el. \] > > > (defconst minrepro--str-spec > > '((len u32) > > (val str (eval (let ((len (minrepro--bindat-unsigned-to-signed > > (bindat-get-field struct 'len) > > 4))) > > ;; Hack for signed/unsigned problems > > (if (<=3D len 0) 0 len)))))) > > Hmm... the doc of bindat.el does not include \`struct\` among the vars yo= u > can use in \`eval\`. > > OTOH, a variable which you can use is \`last\` and it indeed contains > exactly the info you need from \`struct\`, so you can rewrite the above t= o: > > (defconst minrepro--str-spec > '((len u32) > (val str (eval (let ((len (minrepro--bindat-unsigned-to-signed > last 4))) > ;; Hack for signed/unsigned problems > (if (<=3D len 0) 0 len)))))) > > > (defconst minrepro--message-spec > > '((length u32) > > (compression u8) > > (id struct minrepro--str-spec) > > (data vec (eval (let ((l (- (bindat-get-field struct 'length) > > 4 ;length > > 1 ;compression > > (+ 4 (length (bindat-get-field struct 'id 'val)))))) > > l))))) > > This one OTOH can't just use \`last\` since that only gives us the \`id\` > field but not the \`length\` field :-( > > I can't see any way to do what you want given the documentation found in > the \`Commentary:\` of \`bindat.el\`, so I guess we do need to extend the > documented functionality. > > I installed the patch below, for now. It fixes the problem in your test > case and hopefully in other cases as well. Please confirm. > > > Stefan > > > diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el > index 0d9ba57d66..bf01347ae0 100644 > \--- a/lisp/emacs-lisp/bindat.el > \+++ b/lisp/emacs-lisp/bindat.el > @@ -26,7 +26,7 @@ > ;; Packing and unpacking of (binary) data structures. > ;; > ;; The data formats used in binary files and network protocols are > \-;; often structed data which can be described by a C-style structure > \+;; often structured data which can be described by a C-style structure > ;; such as the one shown below. Using the bindat package, decoding > ;; and encoding binary data formats like these is made simple using a > ;; structure specification which closely resembles the C style > @@ -135,7 +135,8 @@ > ;; \| ( \[FIELD\] repeat COUNT ITEM... ) > > ;; -- In (eval EXPR), the value of the last field is available in > \-;; the dynamically bound variable \`last'. > \+;; the dynamically bound variable \`last' and all the previous > \+;; ones in the variable \`struct'. > > ;; TYPE ::=3D ( eval EXPR ) -- interpret result as TYPE > ;; \| u8 \| byte -- length 1 > @@ -191,7 +192,7 @@ > ;;; Code: > > ;; Helper functions for structure unpacking. > \-;; Relies on dynamic binding of BINDAT-RAW and BINDAT-IDX > \+;; Relies on dynamic binding of \`bindat-raw' and \`bindat-idx'. > > (defvar bindat-raw) > (defvar bindat-idx) > @@ -276,8 +277,8 @@ bindat--unpack-item > (t nil))) > > (defun bindat--unpack-group (spec) > \- (with-suppressed-warnings ((lexical last)) > \- (defvar last)) > \+ (with-suppressed-warnings ((lexical struct last)) > \+ (defvar struct) (defvar last)) > (let (struct last) > (while spec > (let\* ((item (car spec)) > @@ -378,9 +379,9 @@ bindat--fixed-length-alist > (ip . 4))) > > (defun bindat--length-group (struct spec) > \- (with-suppressed-warnings ((lexical last)) > \- (defvar last)) > \- (let (last) > \+ (with-suppressed-warnings ((lexical struct last)) > \+ (defvar struct) (defvar last)) > \+ (let ((struct struct) last) > (while spec > (let\* ((item (car spec)) > (field (car item)) > @@ -544,9 +545,9 @@ bindat--pack-item > (setq bindat-idx (+ bindat-idx len))))) > > (defun bindat--pack-group (struct spec) > \- (with-suppressed-warnings ((lexical last)) > \- (defvar last)) > \- (let (last) > \+ (with-suppressed-warnings ((lexical struct last)) > \+ (defvar struct) (defvar last)) > \+ (let ((struct struct) last) > (while spec > (let\* ((item (car spec)) > (field (car item)) -----------------------1f1ca185d9c3b27c506ecc9f2e88d20a Content-Type: multipart/related; boundary="---------------------076ecf528f6aa7bc5a42e6899947c24f" -----------------------076ecf528f6aa7bc5a42e6899947c24f Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 SW5kZWVkLCBJIGNhbiBjb25maXJtIHRoaXMgZml4ZXMgdGhlIHRlc3QgZmlsZSBhcyB3ZWxsIGFz IHdlZWNoYXQuZWwgcHJvcGVyLCB0aGFua3MhPGJyPjxicj48YnI+U2VudCBmcm9tIFByb3Rvbk1h aWwgbW9iaWxlPGJyPjxicj48YnI+PGJyPi0tLS0tLS0tIE9yaWdpbmFsIE1lc3NhZ2UgLS0tLS0t LS08YnI+T24gMTUgRmViIDIwMjEsIDE1OjUwLCBTdGVmYW4gTW9ubmllciA8IG1vbm5pZXJAaXJv LnVtb250cmVhbC5jYT4gd3JvdGU6PGJsb2NrcXVvdGUgY2xhc3M9InByb3Rvbm1haWxfcXVvdGUi Pjxicj48cCBkaXI9Imx0ciI+WyBIaSBLaW0sIGxvbmcgdGltZSBubyBzZWUuPGJyPg0KSSdkIGFw cHJlY2lhdGUgeW91ciBvcGluaW9uIG9uIHRoaXMgaXNzdWUgd2l0aCBiaW5kYXQuZWwuIF08L3A+ DQo8cCBkaXI9Imx0ciI+Jmd0OyAoZGVmY29uc3QgbWlucmVwcm8tLXN0ci1zcGVjPGJyPg0KJmd0 OyAnKChsZW4gdTMyKTxicj4NCiZndDsgKHZhbCBzdHIgKGV2YWwgKGxldCAoKGxlbiAobWlucmVw cm8tLWJpbmRhdC11bnNpZ25lZC10by1zaWduZWQ8YnI+DQomZ3Q7ICYjOTsmIzk7JiM5OyAoYmlu ZGF0LWdldC1maWVsZCBzdHJ1Y3QgJ2xl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C0tcGFjay1ncm91cCAoc3RydWN0IHNwZWMpPGJyPg0KLSAod2l0aC1zdXBwcmVzc2VkLXdhcm5p bmdzICgobGV4aWNhbCBsYXN0KSk8YnI+DQotIChkZWZ2YXIgbGFzdCkpPGJyPg0KLSAobGV0IChs YXN0KTxicj4NCisgKHdpdGgtc3VwcHJlc3NlZC13YXJuaW5ncyAoKGxleGljYWwgc3RydWN0IGxh c3QpKTxicj4NCisgKGRlZnZhciBzdHJ1Y3QpIChkZWZ2YXIgbGFzdCkpPGJyPg0KKyAobGV0ICgo c3RydWN0IHN0cnVjdCkgbGFzdCk8YnI+DQood2hpbGUgc3BlYzxicj4NCihsZXQqICgoaXRlbSAo Y2FyIHNwZWMpKTxicj4NCiYjOTsgKGZpZWxkIChjYXIgaXRlbSkpPC9wPg0KPC9kaXY+ -----------------------076ecf528f6aa7bc5a42e6899947c24f-- -----------------------1f1ca185d9c3b27c506ecc9f2e88d20a-- -----------------------5caa3414225e814cc515c07fe2fb7f9e Content-Type: application/pgp-keys; name="publickey - EmailAddress(s=me@fron.io) - 0x3026807C.asc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="publickey - EmailAddress(s=me@fron.io) - 0x3026807C.asc" LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tClZlcnNpb246IEdvcGVuUEdQIDIu MC4xCkNvbW1lbnQ6IGh0dHBzOi8vZ29wZW5wZ3Aub3JnCgp4ak1FWGM4dFpoWUpLd1lCQkFIYVJ3 OEJBUWRBanBKdUs5bUQyYTN3aEVHdncrY2RyMzhKNkFUM2NKRG9NNjVHCng0YnRmbS9ORjIxbFFH WnliMjR1YVc4Z1BHMWxRR1p5YjI0dWFXOCt3bmNFRUJZS0FCOEZBbDNQTFdZR0N3a0gKQ0FNQ0JC VUlDZ0lERmdJQkFoa0JBaHNEQWg0QkFBb0pFTGN0V010U2Eyd3hCdGdBLzI1aFVNZXZTMnRmQURj OApFaUxadWhOMWwwTGwrOUluelpWYk44KytmSHBaQVBzRmh1dzJYNFJHVWkwT21DcW1hajhDVGdi NXB6dEFJaWlMCnhJWmYvM0ZHRE00NEJGM1BMV1lTQ2lzR0FRUUJsMVVCQlFFQkIwQlFCck50MDNw ZG56UjBpZ3EycXB5NXZZbTEKYjVlYk9wNGcxYThGZGJQM1F3TUJDQWZDWVFRWUZnZ0FDUVVDWGM4 dFpnSWJEQUFLQ1JDM0xWakxVbXRzTVhGRwpBUUNieGJaZ2ZyRlBBc3Z0QlVWTitxWUNqMCtPRGFk azV2UC9Tajg0VnZZN29BRC9SeXliTExmYnNEeEpHbStmCnYrYzBubkttUGx5V2tYUFc4emg2Qlg4 b0pRaz0KPTNWZ2UKLS0tLS1FTkQgUEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQ== -----------------------5caa3414225e814cc515c07fe2fb7f9e-- -----------------------b537be18bd8e08931448240e78ae305c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wmgEARYIABAFAmAqyaoJELctWMtSa2wxAAoJELctWMtSa2wxIWYA+gMF9FqY Sx+Kl2iYsXrc5TyppX+Y/owEQNvlzqoL35/eAQCBgwtolj2RhOEVeswIK4aB r7W5204HGDFoOe1fZrkTCQ== =+YTk -----END PGP SIGNATURE----- -----------------------b537be18bd8e08931448240e78ae305c-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 15 14:51:45 2021 Received: (at 46534-done) by debbugs.gnu.org; 15 Feb 2021 19:51:45 +0000 Received: from localhost ([127.0.0.1]:38753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBjuL-0003YH-3L for submit@debbugs.gnu.org; Mon, 15 Feb 2021 14:51:45 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBjuJ-0003Xq-7A for 46534-done@debbugs.gnu.org; Mon, 15 Feb 2021 14:51:43 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 91CE410022E; Mon, 15 Feb 2021 14:51:37 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DA3B5100091; Mon, 15 Feb 2021 14:51:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1613418695; bh=jjdfHBsibNYuyidMu8qivMb0kxW+RWIpN8WlM3MFAoU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ihysq/StdC3nZONqwevZTcFdzJpc2xAFDAcL4Acb5uadbwnwHxJRZRwtfrhPOT7nF WROdKP8+ZWZ9/XGSgcepqTS0YvbZP3FbKLtw/VHEVM/7PI9Ke6UU/D/1RB9jruLkFw rYbPfnr9SzdQ/1VYb0l/cNyYbCQbsouL5LReDvtM9CAOsQpIpwHREPbyW9I3iL90v6 GElsHLCd1jY817N7K1jTugYLWvaN52hlO5ALmUlMnLn/+OwE6UXzm93IXJ7XussWjD kGHr8QyieoPZdodXxxt10EXhobjbBLssn7WsbESZdLs/nOgZDLx0FKEXGtN3YJriE5 TsJFhuNYaRFTQ== Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CA0EF1203F4; Mon, 15 Feb 2021 14:51:35 -0500 (EST) From: Stefan Monnier To: Tony Olagbaiye Subject: Re: bug#46534: Lexical change in bindat breaks weechat.el Message-ID: References: Date: Mon, 15 Feb 2021 14:51:29 -0500 In-Reply-To: (Tony Olagbaiye's message of "Mon, 15 Feb 2021 19:19:54 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) 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 AWL 0.062 Adjusted score from AWL reputation of From: address 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 X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46534-done Cc: storm@cua.dk, 46534-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 (---) > Indeed, I can confirm this fixes the test file as well as weechat.el proper, thanks! Thanks, closing for now, tho I'd love to see a better fix (e.g. changing the system so it doesn't rely on `eval` and dynamic scoping so much). Stefan > Sent from ProtonMail mobile > > -------- Original Message -------- > On 15 Feb 2021, 15:50, Stefan Monnier < monnier@iro.umontreal.ca> wrote: > > [ Hi Kim, long time no see. > I'd appreciate your opinion on this issue with bindat.el. ] > > > (defconst minrepro--str-spec > > '((len u32) > > (val str (eval (let ((len (minrepro--bindat-unsigned-to-signed > > (bindat-get-field struct 'len) > > 4))) > > ;; Hack for signed/unsigned problems > > (if (<= len 0) 0 len)))))) > > Hmm... the doc of bindat.el does not include `struct` among the vars you > can use in `eval`. > > OTOH, a variable which you can use is `last` and it indeed contains > exactly the info you need from `struct`, so you can rewrite the above to: > > (defconst minrepro--str-spec > '((len u32) > (val str (eval (let ((len (minrepro--bindat-unsigned-to-signed > last 4))) > ;; Hack for signed/unsigned problems > (if (<= len 0) 0 len)))))) > > > (defconst minrepro--message-spec > > '((length u32) > > (compression u8) > > (id struct minrepro--str-spec) > > (data vec (eval (let ((l (- (bindat-get-field struct 'length) > > 4 ;length > > 1 ;compression > > (+ 4 (length (bindat-get-field struct 'id 'val)))))) > > l))))) > > This one OTOH can't just use `last` since that only gives us the `id` > field but not the `length` field :-( > > I can't see any way to do what you want given the documentation found in > the `Commentary:` of `bindat.el`, so I guess we do need to extend the > documented functionality. > > I installed the patch below, for now. It fixes the problem in your test > case and hopefully in other cases as well. Please confirm. > > Stefan > > diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el > index 0d9ba57d66..bf01347ae0 100644 > --- a/lisp/emacs-lisp/bindat.el > +++ b/lisp/emacs-lisp/bindat.el > @@ -26,7 +26,7 @@ > ;; Packing and unpacking of (binary) data structures. > ;; > ;; The data formats used in binary files and network protocols are > -;; often structed data which can be described by a C-style structure > +;; often structured data which can be described by a C-style structure > ;; such as the one shown below. Using the bindat package, decoding > ;; and encoding binary data formats like these is made simple using a > ;; structure specification which closely resembles the C style > @@ -135,7 +135,8 @@ > ;; | ( [FIELD] repeat COUNT ITEM... ) > > ;; -- In (eval EXPR), the value of the last field is available in > -;; the dynamically bound variable `last'. > +;; the dynamically bound variable `last' and all the previous > +;; ones in the variable `struct'. > > ;; TYPE ::= ( eval EXPR ) -- interpret result as TYPE > ;; | u8 | byte -- length 1 > @@ -191,7 +192,7 @@ > ;;; Code: > > ;; Helper functions for structure unpacking. > -;; Relies on dynamic binding of BINDAT-RAW and BINDAT-IDX > +;; Relies on dynamic binding of `bindat-raw' and `bindat-idx'. > > (defvar bindat-raw) > (defvar bindat-idx) > @@ -276,8 +277,8 @@ bindat--unpack-item > (t nil))) > > (defun bindat--unpack-group (spec) > - (with-suppressed-warnings ((lexical last)) > - (defvar last)) > + (with-suppressed-warnings ((lexical struct last)) > + (defvar struct) (defvar last)) > (let (struct last) > (while spec > (let* ((item (car spec)) > @@ -378,9 +379,9 @@ bindat--fixed-length-alist > (ip . 4))) > > (defun bindat--length-group (struct spec) > - (with-suppressed-warnings ((lexical last)) > - (defvar last)) > - (let (last) > + (with-suppressed-warnings ((lexical struct last)) > + (defvar struct) (defvar last)) > + (let ((struct struct) last) > (while spec > (let* ((item (car spec)) > (field (car item)) > @@ -544,9 +545,9 @@ bindat--pack-item > (setq bindat-idx (+ bindat-idx len))))) > > (defun bindat--pack-group (struct spec) > - (with-suppressed-warnings ((lexical last)) > - (defvar last)) > - (let (last) > + (with-suppressed-warnings ((lexical struct last)) > + (defvar struct) (defvar last)) > + (let ((struct struct) last) > (while spec > (let* ((item (car spec)) > (field (car item)) From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 17 17:47:34 2021 Received: (at 46534) by debbugs.gnu.org; 17 Feb 2021 22:47:34 +0000 Received: from localhost ([127.0.0.1]:45335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lCVbZ-0000yA-VD for submit@debbugs.gnu.org; Wed, 17 Feb 2021 17:47:34 -0500 Received: from crocodile.elm.relay.mailchannels.net ([23.83.212.45]:49867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lCVbW-0000y0-I3 for 46534@debbugs.gnu.org; Wed, 17 Feb 2021 17:47:32 -0500 X-Sender-Id: chosting|x-authsender|storm@cua.dk Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 4F3967032A1; Wed, 17 Feb 2021 22:47:28 +0000 (UTC) Received: from ispc3.dotserv.com (100-96-15-11.trex.outbound.svc.cluster.local [100.96.15.11]) (Authenticated sender: chosting) by relay.mailchannels.net (Postfix) with ESMTPA id 7AA95702C16; Wed, 17 Feb 2021 22:47:26 +0000 (UTC) X-Sender-Id: chosting|x-authsender|storm@cua.dk Received: from ispc3.dotserv.com (ssl3.dotserv.com [178.20.217.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.15.11 (trex/6.1.1); Wed, 17 Feb 2021 22:47:28 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: chosting|x-authsender|storm@cua.dk X-MailChannels-Auth-Id: chosting X-Tasty-Tasty: 559f71e2129fdf51_1613602047975_1843241658 X-MC-Loop-Signature: 1613602047975:3864246929 X-MC-Ingress-Time: 1613602047975 Received: from localhost (localhost [127.0.0.1]) by ispc3.dotserv.com (Postfix) with ESMTP id 783971096E5D; Wed, 17 Feb 2021 23:47:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cua.dk; h= content-language:content-transfer-encoding:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject; s=dotserv; t= 1613602041; x=1615416442; bh=50d2v3UMqC5RPTKrQYVWmE+5y0DWvjI/JrF CgLxMYIs=; b=PBLgrrdSTgAHFdR+qSUsiH/tqmxkUxwMcvD1OoRZD/1kZW7tZ5S vtbaxC2EPTSBqfartHvpET1lKFDiA0vLThfolak7xy7gpGv1JtNrebiisGwlnwDE 4cW2A+h6o7RtQh0yEqW0BDBth3Z/pUcoi5zMtlhp4tW27xZK/fXFeY6I= X-Virus-Scanned: Debian amavisd-new at ispc3.dotserv.com Received: from ispc3.dotserv.com ([127.0.0.1]) by localhost (ispc3.dotserv.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id OCWRYfhk2Hne; Wed, 17 Feb 2021 23:47:21 +0100 (CET) Received: from [10.1.82.9] (80-197-127-197-cable.dk.customer.tdc.net [80.197.127.197]) (Authenticated sender: storm@cua.dk) by ispc3.dotserv.com (Postfix) with ESMTPSA id C1BEB1088A10; Wed, 17 Feb 2021 23:47:21 +0100 (CET) Subject: Re: bug#46534: Lexical change in bindat breaks weechat.el To: Stefan Monnier , Tony Olagbaiye References: From: Kim Storm Message-ID: <8eca00ad-b36a-6b3a-31f8-115d01bf8fb3@cua.dk> Date: Wed, 17 Feb 2021 23:47:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 46534 Cc: 46534@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: -1.0 (-) On 15/02/2021 16.50, Stefan Monnier wrote: > [ Hi Kim, long time no see. > I'd appreciate your opinion on this issue with bindat.el. ] Hi Stefan Indeed, it's been a while since I wrote that code :-) Your change seems to be the simplest way to solve the "not last field" issue with "eval". BTW, the following line seems wrong: ;;    (length       u16r)  ;; little endian order Since the C struct specifies "unsigned long", it should be u32r rather than u16r. Also the C code samples should use uint8_t uint16_t and uint32_t for clarity. Kim From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 18 11:10:04 2021 Received: (at 46534) by debbugs.gnu.org; 18 Feb 2021 16:10:04 +0000 Received: from localhost ([127.0.0.1]:47794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lClsR-0002Ng-Sx for submit@debbugs.gnu.org; Thu, 18 Feb 2021 11:10:04 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lClsP-0002N6-Tb for 46534@debbugs.gnu.org; Thu, 18 Feb 2021 11:10:02 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E463B4404D9; Thu, 18 Feb 2021 11:09:55 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7DF10440398; Thu, 18 Feb 2021 11:09:54 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1613664594; bh=ap03+WWoWl+Kvac6yPE9uquIWIMva3ZMzvxhRc4qHgE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=di8rcbuPQwfW3uzI2bA8MgAA7H8VvrBK2Ufzjp/CDiORuVbcG9TjzF34MGRJ3vty3 lYyrv09n9GAqcRu0dW0xwFJ6d2bMIG5r9dsYCINoVUlcKQpVpYA1OCKwFig8NWT2xf X40y4GaqyfrfKlUXQYQkniwOpQPwxg0uP95pMljX4i5holX+ZiE9qfwIi6xG7gLJpl hsHCIl3g9agA/vsAccrAb4hQUlRWbfPhAQ2PhA6k6hG9UIZu3aInCl0zXqv1B6aQ8F 7+wzlYXKW+wu7yi7C0mdYn1ZPNtjUiknSvoJSDhKBx3oQaSh2xgkdScGOvbUoS+PrZ brPdNKZ9JR7og== Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A8D3712017E; Thu, 18 Feb 2021 11:09:54 -0500 (EST) From: Stefan Monnier To: Kim Storm Subject: Re: bug#46534: Lexical change in bindat breaks weechat.el Message-ID: References: <8eca00ad-b36a-6b3a-31f8-115d01bf8fb3@cua.dk> Date: Thu, 18 Feb 2021 11:09:53 -0500 In-Reply-To: <8eca00ad-b36a-6b3a-31f8-115d01bf8fb3@cua.dk> (Kim Storm's message of "Wed, 17 Feb 2021 23:47:21 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.100 Adjusted score from AWL reputation of From: address 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 X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46534 Cc: 46534@debbugs.gnu.org, Tony Olagbaiye 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 Kim, long time no see. >> I'd appreciate your opinion on this issue with bindat.el. ] > Indeed, it's been a while since I wrote that code :-) As you can see, it's still alive and kicking. > Your change seems to be the simplest way to solve the "not last field" > issue with "eval". Thanks for confirming. > BTW, the following line seems wrong: > > ;;=A0=A0=A0 (length=A0=A0=A0 =A0=A0 u16r)=A0 ;; little endian order > > Since the C struct specifies "unsigned long", it should be u32r rather > than u16r. Good catch. > Also the C code samples should use uint8_t uint16_t and uint32_t > for clarity. Oh, yes, thanks, Stefan From unknown Wed Jun 18 00:27:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 19 Mar 2021 11:24:07 +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