unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 69749@debbugs.gnu.org, Eric Marsden <eric.marsden@risk-engineering.org>
Subject: bug#69749: (bindat-type sint 32 t) -> unbound variable bitlen
Date: Wed, 13 Mar 2024 08:54:53 -0400	[thread overview]
Message-ID: <jwvy1ammh01.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86cyrytkk7.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 13 Mar 2024 13:53:12 +0200")

>> -- file bd.el
>> (require 'bindat)
>> (bindat-pack (bindat-type sint 32 t) 42)
>> -- 

When you open this file in Emacs≥28, the modeline will have an orange
"/d" which is meant to warn you that something's amiss.
Click on it, and your problem will be solved :-)

>> Symbol’s value as variable is void: bitlen
>>
>> This bug is difficult to understand. Run from an IELM buffer, this code 
>> works as expected. The macroexpansion of the bindat-type declaration 
>> includes a binding for bitlen.

Your code ends up (via the `sint` of `bindat-type`) relying on the
`lexical-binding` dialect of ELisp, which is enabled by default in
`ielm` but not in your file.


        Stefan






  reply	other threads:[~2024-03-13 12:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 15:18 bug#69749: (bindat-type sint 32 t) -> unbound variable bitlen Eric Marsden
2024-03-13 11:53 ` Eli Zaretskii
2024-03-13 12:54   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
     [not found]     ` <4a7ccaf7-02dc-4cca-b6e7-520ffb45dcac@risk-engineering.org>
2024-03-15 16:51       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-16 11:16         ` Eli Zaretskii
     [not found]           ` <000d8acf-bad4-432a-a775-0c03225674fe@risk-engineering.org>
2024-03-17 19:13             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvy1ammh01.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69749@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=eric.marsden@risk-engineering.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).