all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: Gemini Lasswell <gazally@runbox.com>,
	Katsumi Yamaoka <yamaoka@jpl.org>,
	Benaiah Mischenko <benaiah@mischenko.com>,
	David Bremner <david@tethera.net>,
	16184@debbugs.gnu.org
Subject: bug#16184: 24.3.50; edebug and eval-when-compiler don't work together
Date: Sun, 1 Jan 2017 01:30:44 +0100	[thread overview]
Message-ID: <CABr8ebaWEKZW=wdc8Ny7suQeBDOHJ75Muv8phnxtVg7Y50K5QA@mail.gmail.com> (raw)
In-Reply-To: <20161231162254.GB4072@acm.fritz.box>

[-- Attachment #1: Type: text/plain, Size: 3086 bytes --]

Hi Alan!

This time it seems to be working properly with both `eval-when-compile' and
`eval-and-compile'!

Happy new year to you too!

    -- Anders

On Sat, Dec 31, 2016 at 5:22 PM, Alan Mackenzie <acm@muc.de> wrote:

> Hello again, Anders.
>
> On Fri, Dec 30, 2016 at 09:02:31PM +0100, Anders Lindgren wrote:
> > Hi!
>
> > I just got around to test this. Now, `eval-when-comple' seems to be
> > working. Unfortunately, `eval-and-comple' is still broken.
>
> > If I do C-u M-C-x eval the following with `debug-on-error' set to t, I
> get
> > the backtrace below:
>
> > (defun test (limit)
> >   (eval-and-compile
> >     (boundp 'parse-sexp-lookup-properties)))
>
> [ snip backtrace ]
>
> I got a tip from Gemini Lasswell last night.  What is broken is not
> edebug.el itself, but the edebug specs applied to various macros.  For
> macros like eval-\(when\|and\)-compile, there needs to be an
> edebug-enter form compile around the macro.  Most edebug specs don't
> compile this - only (I think) def-form and def-body do.  This is not
> clearly documented.
>
> Anyhow, I've changed the edebug spec of eval-and-compile to what it
> should be (\(cc-\)?eval-when-compile already had it), and I think these
> problems are all solved.
>
> Would you please try out the following patch, and let me know sometime
> that it's OK, then I can commit it.
>
> Happy New Year again!
>
>
>
> diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
> index 9d2a048..e680ebb 100644
> --- a/lisp/emacs-lisp/byte-run.el
> +++ b/lisp/emacs-lisp/byte-run.el
> @@ -474,7 +474,7 @@ eval-and-compile
>  `progn', except that the value of the expression may be (but is
>  not necessarily) computed at load time if eager macro expansion
>  is enabled."
> -  (declare (debug t) (indent 0))
> +  (declare (debug (&rest def-form)) (indent 0))
>    ;; When the byte-compiler expands code, this macro is not used, so we're
>    ;; either about to run `body' (plain interpretation) or we're doing
> eager
>    ;; macroexpansion.
> diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
> index 15b1389..fd3e48d 100644
> --- a/lisp/emacs-lisp/edebug.el
> +++ b/lisp/emacs-lisp/edebug.el
> @@ -2052,15 +2052,10 @@ edebug-stack
>  (defvar edebug-stack-depth -1)
>  ;; Index of last edebug-stack item.
>
> -(defvar edebug-offset-indices (list 0))
> +(defvar edebug-offset-indices nil)
>  ;; Stack of offset indices of visited edebug sexps.
>  ;; Each function adds one cons.  Top is modified with setcar.
> -;; Should be nil at the top level.  No longer!  There are occasions
> -;; when this variable is modified by setcar before a cons has been
> -;; pushed by `edebug-enter', e.g. when instrumenting
> -;; `c-font-lock-declarations' in .../lisp/progmodes/cc-fonts.el.  So
> -;; this variable must be initialized to a cons.
> -
> +;; Should be nil at the top level.
>  (defvar edebug-entered nil
>    ;; Non-nil if edebug has already been entered at this recursive edit
> level.
>    ;; This should stay nil at the top level.
>
> >     -- Anders
>
> --
> Alan Mackenzie (Nuremberg, Germany).
>

[-- Attachment #2: Type: text/html, Size: 3999 bytes --]

  reply	other threads:[~2017-01-01  0:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 10:58 bug#16184: 24.3.50; edebug and eval-when-compiler don't work together Anders Lindgren
2013-12-20  0:01 ` Katsumi Yamaoka
2013-12-20  6:59   ` Anders Lindgren
2013-12-20  8:28     ` Katsumi Yamaoka
2013-12-20  9:26       ` Anders Lindgren
2013-12-20  9:53         ` Katsumi Yamaoka
2013-12-20 10:30           ` Anders Lindgren
2013-12-20 12:44             ` Katsumi Yamaoka
2013-12-20 13:38               ` Anders Lindgren
2013-12-24  0:23                 ` Katsumi Yamaoka
2013-12-25 22:37                   ` Katsumi Yamaoka
2016-10-19  0:06 ` bug#16184: incorrect Edebug spec for eval-and-compile Gemini Lasswell
2016-11-16  1:47 ` bug#16184: confirmed in 25.1 David Bremner
2016-11-16  2:07 ` bug#16184: confirmed on 25.1.1 Benaiah Mischenko
2016-11-18 22:47 ` bug#16184: 24.3.50; edebug and eval-when-compiler don't work together Alan Mackenzie
2016-12-29  9:29   ` Alan Mackenzie
2016-12-30 20:02     ` Anders Lindgren
2016-12-31 16:22       ` Alan Mackenzie
2017-01-01  0:30         ` Anders Lindgren [this message]
2017-01-01  8:37           ` Alan Mackenzie
2016-12-30 23:27   ` Gemini Lasswell
2016-12-31 11:18     ` Alan Mackenzie

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

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

  git send-email \
    --in-reply-to='CABr8ebaWEKZW=wdc8Ny7suQeBDOHJ75Muv8phnxtVg7Y50K5QA@mail.gmail.com' \
    --to=andlind@gmail.com \
    --cc=16184@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=benaiah@mischenko.com \
    --cc=david@tethera.net \
    --cc=gazally@runbox.com \
    --cc=yamaoka@jpl.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.