all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: 17123@debbugs.gnu.org
Subject: bug#17123: 24.3.50; C-x C-c -> Invalid function: with-current-buffer-window
Date: Thu, 27 Mar 2014 18:42:19 +0100	[thread overview]
Message-ID: <87mwgb35dw.fsf@web.de> (raw)


Hello,

this kind of issue has been seen and was discussed (without a solution)
already some time ago.  Now I see an incarnation of it using the
emacs-24 branch.

I did the following (using my setup, but that probably doesn't matter):
I had a living process started from Emacs, and I hit C-x C-c.  I get his
error:

Debugger entered--Lisp error: (invalid-function with-current-buffer-window)
  with-current-buffer-window(#<buffer *Process List*> nil [lotsa byte code] nil)
  save-buffers-kill-emacs(nil)
  save-buffers-kill-terminal(nil)
  call-interactively(save-buffers-kill-terminal nil nil)
  command-execute(save-buffers-kill-terminal)

(I have removed the actual byte code).

`with-current-buffer-window' is a macro - which was defined in this
moment, of course.  When I load the source file of
save-buffers-kill-emacs, files.el, the problem is immediately fixed.
When I load the compiled files.elc again, it is there again.

What other users already had experienced was something similar: they got
an error like

    Invalid function: some-macro

where `some-macro' was a defined and well working macro.

I have an idea of what causes this: when you compile some file using a
certain macro that is not (yet) defined, and you load the resulting byte
code, and define the macro just after that, you get the same error
message.  For example, load the byte compiled code of this test file:

--8<---------------cut here---------------start------------->8---
(defun test (x)
  (unknown-macro (+ x 1)))

'(defmacro unknown-macro (&rest body) `(progn ,@body))
--8<---------------cut here---------------end--------------->8---

Now evaluate the defmacro form, and try M-: (test 1).  You get

    test: Invalid function: unknown-macro

If you eval the defun (uncompiled), the error doesn't happen.

(disassemble 'save-buffers-kill-emacs) looks here like this:

...
65	constant  with-current-buffer-window
66	constant  get-buffer-create
67	constant  "*Process List*"
68	call	  1
...

so `with-current-buffer-window' at least was not expanded while byte
compiling the source file while building.

So I think there are two problems here:

1.  While building, the compilation of file.el has to cope with an
undefined macro, which is not good (i.e., a dependency problem).

2.  Compiled code using not yet defined macros doesn't behave "as
expected".


Thanks,

Michael




In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7)
 of 2014-03-25 on drachen
Windowing system distributor `The X.Org Foundation', version 11.0.11500000
System Description:	Debian GNU/Linux testing (jessie)

Important settings:
  value of $LC_ALL: de_DE.utf8
  value of $LC_COLLATE: C
  value of $LC_TIME: C
  value of $LANG: de_DE.utf8
  locale-coding-system: utf-8-unix






             reply	other threads:[~2014-03-27 17:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 17:42 Michael Heerdegen [this message]
2014-03-27 21:22 ` bug#17123: 24.3.50; C-x C-c -> Invalid function: with-current-buffer-window Stefan Monnier
2014-03-27 22:59   ` Michael Heerdegen
2014-03-27 21:35 ` Glenn Morris
2014-03-27 22:47   ` Stefan Monnier
2014-03-27 23:07     ` Glenn Morris
2014-03-27 23:10     ` Michael Heerdegen

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=87mwgb35dw.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=17123@debbugs.gnu.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.