all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Eager macroexpansion failure in Emacs 24.3
@ 2013-04-01 10:40 Michael Olson
  2013-04-02  8:18 ` bug#14121: Fwd: " Michael Olson
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Olson @ 2013-04-01 10:40 UTC (permalink / raw)
  To: Emacs Development Discussions


[-- 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))

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-04 12:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-01 10:40 Eager macroexpansion failure in Emacs 24.3 Michael Olson
2013-04-02  8:18 ` bug#14121: Fwd: " 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

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.