* How do I make an Emacs-Lisp function available via M-x ?
@ 2006-11-29 11:58 leonel.gayard
2006-11-29 12:21 ` Le TeXnicien de Surface
2006-11-29 14:18 ` Perry Smith
0 siblings, 2 replies; 3+ messages in thread
From: leonel.gayard @ 2006-11-29 11:58 UTC (permalink / raw)
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 ?
[]'s
Leonel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How do I make an Emacs-Lisp function available via M-x ?
2006-11-29 11:58 How do I make an Emacs-Lisp function available via M-x ? leonel.gayard
@ 2006-11-29 12:21 ` Le TeXnicien de Surface
2006-11-29 14:18 ` Perry Smith
1 sibling, 0 replies; 3+ messages in thread
From: Le TeXnicien de Surface @ 2006-11-29 12:21 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How do I make an Emacs-Lisp function available via M-x ?
2006-11-29 11:58 How do I make an Emacs-Lisp function available via M-x ? leonel.gayard
2006-11-29 12:21 ` Le TeXnicien de Surface
@ 2006-11-29 14:18 ` Perry Smith
1 sibling, 0 replies; 3+ messages in thread
From: Perry Smith @ 2006-11-29 14:18 UTC (permalink / raw)
Cc: help-gnu-emacs
[-- Attachment #1.1: Type: text/plain, Size: 1085 bytes --]
On Nov 29, 2006, at 5:58 AM, leonel.gayard@gmail.com wrote:
> 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 ?
Look at the function: interactive
Probably you just need (interactive) but there is a lot to it.
Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )
Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems
[-- Attachment #1.2: Type: text/html, Size: 7484 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-29 14:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29 11:58 How do I make an Emacs-Lisp function available via M-x ? leonel.gayard
2006-11-29 12:21 ` Le TeXnicien de Surface
2006-11-29 14:18 ` Perry Smith
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.