all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Esben Stien <b0ef@esben-stien.name>
Subject: wrong-type-argument when ~/.emacs is byte compiled
Date: Thu, 12 May 2005 02:56:26 +0200	[thread overview]
Message-ID: <87psvxl0sl.fsf@quasar.esben-stien.name> (raw)

I have this code in my ~/.emacs to automatically byte compile when I
save the file.

(defun autocompile nil
  "compile itself if ~/.emacs"
  (interactive)
  (require 'bytecomp)
  (if (string= (buffer-file-name) (expand-file-name (concat default-directory ".emacs")))
(byte-compile-file (buffer-file-name))))
  (add-hook 'after-save-hook 'autocompile)
(defconst animate-n-steps 3)

Now, when I try to start my function irc, defined: 

(defmacro de-erc-connect (command server port nick)
  "Create interactive command `command', for connecting to an IRC server. The command uses interactive mode if passed an argument."
  (fset command
	`(lambda (arg)
	   (interactive "p")
	   (if (not (= 1 arg))
	       (erc-select ,server ,port ,nick)
	     (erc ,server ,port ,nick ,erc-user-full-name t)))))

(autoload 'erc "erc" "" t)
(autoload 'erc-select "erc" "" t)
(de-erc-connect erc-fn "irc.gnu.org" 6667 "b0ef")

(defun erc-autojoin-channels (server nick)
  (dolist (l erc-autojoin-channels-alist)
    (when (string-match (car l) server)
      (dolist (chan (cdr l))
        (erc-send-command (concat "join " chan))))))
(add-hook 'erc-after-connect 'erc-autojoin-channels)

 (defun irc ()
   "Start to waste time on IRC with ERC."
   (interactive)
   (call-interactively 'erc-fn))

I get, when trying to M-x irc:

Debugger entered--Lisp error: (wrong-type-argument commandp erc-fn)
  call-interactively(erc-fn)
  irc()
  call-interactively(irc)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)

Now, everything works if I just take out the auto compile function or
rm the ~/.emacs.elc file.

Anyone have any pointers on what to look at?

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
          [sip|iax]:   e     e 
           jid:b0ef@    n     n

             reply	other threads:[~2005-05-12  0:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-12  0:56 Esben Stien [this message]
2005-05-12 15:24 ` wrong-type-argument when ~/.emacs is byte compiled Kevin Rodgers
     [not found] <mailman.4745.1115860035.2819.help-gnu-emacs@gnu.org>
2005-05-12  4:03 ` Stefan Monnier
2005-05-12 13:15   ` Esben Stien
2005-05-12 10:13 ` Thien-Thi Nguyen
2005-05-12 14:40 ` Johan Bockgård

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=87psvxl0sl.fsf@quasar.esben-stien.name \
    --to=b0ef@esben-stien.name \
    /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.