[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I make an Emacs-Lisp function available via M-x ?
From: |
Le TeXnicien de Surface |
Subject: |
Re: How do I make an Emacs-Lisp function available via M-x ? |
Date: |
Wed, 29 Nov 2006 13:21:11 +0100 |
User-agent: |
KNode/0.10.1 |
leonel.gayard@gmail.com écrivait :
> Hi all,
>
> I've recently started to add some Lisp functions to my .emacs file. For
> instance, these two functions change the colors in Emacs, with white
> fonts over black background or vice-versa:
>
> ;;;###autoload
> (defun black-on-white()
> (and
> (set-foreground-color "black")
> (set-background-color "white")))
>
> ;;;###autoload
> (defun white-on-black()
> (and
> (set-foreground-color "white")
> (set-background-color "black")))
>
> Now, I would like to call these functions by typing M-x white-on-black,
> but they simply are not available there. The apropos command (M-x
> apropos) acknowledges that they exist, but when I type M-x
> black-on-white, all I get is "no match".
>
> Any ideas ?
Just use
(interactive)
like this
(defun white-on-black()
(interactive)
(and
(set-foreground-color "white")
(set-background-color "black")))
/et/ /voilà/!
Hih.
--
Le TeXnicien de Surface