help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wrong-type-argument when ~/.emacs is byte compiled


From: Esben Stien
Subject: wrong-type-argument when ~/.emacs is byte compiled
Date: Thu, 12 May 2005 02:56:26 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]