GNU bug report logs - #46387
28.0.50; Compiled code making a variable dynamic stopped working

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Mon, 8 Feb 2021 17:31:02 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#46387: closed (28.0.50; Compiled code making a variable
 dynamic stopped working)
Date: Thu, 11 Feb 2021 08:50:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 11 Feb 2021 09:49:29 +0100
with message-id <B3F9BB67-3F23-4072-889D-AD3FCC4ED3C6 <at> acm.org>
and subject line Re: 28.0.50; Compiled code making a variable dynamic stopped working
has caused the debbugs.gnu.org bug report #46387,
regarding 28.0.50; Compiled code making a variable dynamic stopped working
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
46387: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=46387
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Cc: Mattias Engdegård <mattiase <at> acm.org>
Subject: 28.0.50; Compiled code making a variable dynamic stopped working
Date: Mon, 08 Feb 2021 18:29:56 +0100
Hello,

the latest changes in byte-opt.el seem to have broken some of my code.
It worked since yesterday, and it still works when interpreted, but the
compiled code raises this error today:

#+begin_src emacs-lisp
Debugger entered--Lisp error: (void-variable number)
  bbdb-anniv-diary-entries()
  alarm-clock-diary-list-entries-hook-fun-to-alarm-clock(bbdb-anniv-diary-entries #f(compiled-function (dt) #<bytecode 0x10302b42caa2d23>) #f(compiled-function (&rest args2) #<bytecode -0x159ba228e7b687fb>))
  #f(compiled-function () #<bytecode -0xe7267f5f0b223bb>)()
  [...]
#+end_src

`alarm-clock-diary-list-entries-hook-fun-to-alarm-clock' has this
definition:

#+begin_src emacs-lisp
(defun alarm-clock-diary-list-entries-hook-fun-to-alarm-clock (fun &optional date-fun filter-return)
  ;; For functions to put in `diary-list-entries-hook',
  ;; e.g. `bbdb-anniv-diary-entries'
  (require 'calendar)
  (require 'diary-lib)
  (with-suppressed-warnings ((lexical date original-date number))
    (defvar date)
    (defvar original-date)
    (defvar number))
  (defvar diary-entries-list)
  (let* ((date (funcall (or date-fun #'identity) (calendar-current-date)))
         (original-date date)
         (diary-entries-list '())
         (number 1))
    (funcall fun)
    (dolist (to-add (funcall (or filter-return #'identity)
                             (mapcar #'substring-no-properties (mapcar #'cadr diary-entries-list))))
      (alarm-clock-add-automatically-maybe
       to-add (list (alarm-clock-last-midnight))
       nil '((origin . diary-list-entries-hook-fun))))))
#+end_src

FUN is bound to `bbdb-anniv-diary-entries'.  `number' should be bound
dynamically when that function is `funcall'ed.

TIA,

Michael.


In GNU Emacs 28.0.50 (build 34, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-02-08 built on drachen
Repository revision: f0afbebe7c423ec8b1003f88af11122dfec28dd1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid



[Message part 3 (message/rfc822, inline)]
From: Mattias Engdegård <mattiase <at> acm.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 46387-done <at> debbugs.gnu.org
Subject: Re: 28.0.50; Compiled code making a variable dynamic stopped working
Date: Thu, 11 Feb 2021 09:49:29 +0100
10 feb. 2021 kl. 23.44 skrev Michael Heerdegen <michael_heerdegen <at> web.de>:

> Yes, works as expected now, thanks.

Excellent, closing then.

>  And also thanks for working on that
> optimization stuff.

Low and uncertain payoff, high risk of becoming immensely unpopular by breaking everything in mysterious ways -- the dream job!



This bug report was last modified 4 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.