all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Olson <mwolson@gnu.org>
To: Emacs Development Discussions <emacs-devel@gnu.org>
Subject: Eager macroexpansion failure in Emacs 24.3
Date: Mon, 1 Apr 2013 11:40:38 +0100	[thread overview]
Message-ID: <CAN4ruPhihJ4p2+gBtrbyBFXD_hyJ_pMtnRPT7osVAiEMu_XEhA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 596 bytes --]

emacs --no-init-file --load ~/test-case.el

In *Messages* buffer:

Eager macro-expansion failure: (error "(erc-response\\.contents parsed) is
not a valid place expression")

I can work around this by putting (require 'erc) and the function
definition in different 'when' blocks, but it's not ideal.

The erc-response struct is defined in erc-backend.el, which is loaded by
erc.el.

Putting (require 'erc) inside of a 'when' statement along with code that
relies on functions provided by a struct defined by a file it loads seems
to trigger the problem.

-- 
Michael Olson  |  http://mwolson.org/

[-- Attachment #1.2: Type: text/html, Size: 899 bytes --]

[-- Attachment #2: test-case.el --]
[-- Type: application/octet-stream, Size: 545 bytes --]


(when t
  (require 'erc)
  (defun my-erc-remove-trailing-whitespace (proc parsed)
    "Remove trailing whitespace from the current message.
Some IM clients use an OTR plug-in that sends some annoying
trailing space to the screen, so we want to clean that up."
    (let ((msg (erc-response.contents parsed)))
      (when (stringp msg)
        (setf (erc-response.contents parsed)
              (erc-replace-regexp-in-string "[[:space:]]+\\'" "" msg))
        nil)))
  (add-hook 'erc-server-PRIVMSG-functions 'my-erc-remove-trailing-whitespace))

             reply	other threads:[~2013-04-01 10:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01 10:40 Michael Olson [this message]
2013-04-02  8:18 ` bug#14121: Fwd: Eager macroexpansion failure in Emacs 24.3 Michael Olson
2013-04-03 18:41   ` Stefan Monnier
2013-04-03 18:47     ` Eli Zaretskii
2013-04-03 23:41       ` Michael Olson
2013-04-04  0:51         ` Stefan Monnier
2013-04-04  3:22           ` Michael Olson
2013-04-04 12:33             ` Stefan Monnier

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=CAN4ruPhihJ4p2+gBtrbyBFXD_hyJ_pMtnRPT7osVAiEMu_XEhA@mail.gmail.com \
    --to=mwolson@gnu.org \
    --cc=emacs-devel@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.