all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* wrong-type-argument when ~/.emacs is byte compiled
@ 2005-05-12  0:56 Esben Stien
  2005-05-12 15:24 ` Kevin Rodgers
  0 siblings, 1 reply; 6+ messages in thread
From: Esben Stien @ 2005-05-12  0:56 UTC (permalink / 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

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

end of thread, other threads:[~2005-05-12 15:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.4745.1115860035.2819.help-gnu-emacs@gnu.org>
2005-05-12  4:03 ` wrong-type-argument when ~/.emacs is byte compiled 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
2005-05-12  0:56 Esben Stien
2005-05-12 15:24 ` Kevin Rodgers

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.