[plug] writing an emacs lisp function.

David & Lisa Buddrige buddrige at wasp.net.au
Thu Jan 15 19:47:41 WST 2004


thanks for that, I'll give it a go tomorrow at work. 8-)

David.
-----Original Message-----
From: Russell Steicke <r.steicke at bom.gov.au>
To: plug at plug.linux.org.au <plug at plug.linux.org.au>
Date: Thursday, 15 January 2004 6:03
Subject: Re: [plug] writing an emacs lisp function.


>On Thu, Jan 15, 2004 at 04:23:41PM +0800, David Buddrige wrote:
>> Hi all, 
>> 
>> I like to have a black background with green text when I am working in 
>> emacs. 
>> 
>> To this end, I have placed the following code in my .emacs: 
>> 
>> (defun setcolour (nil)
>> "This sets the colors up"
>> '(set-foreground-color green)
>> '(set-background-color black)
>> )
>> (global-set-key (quote [f11]) (quote setcolour)) 
>
>- commandp checks to see if the function "makes provisions for
>  interactive calling".  To do that you need to call (interactive) first
>  in the function.  
>- An empty argument list is (), not (nil).  
>- Don't quote your function calls.
>- The colour names should be strings.
>
>Try this:
>
>(defun setcolour ()
>  (interactive)
>  "This sets the colors up"
>  (set-foreground-color "green")
>  (set-background-color "black"))
>(global-set-key (quote [f11]) (quote setcolour))
>
>
>
>
>-- 
>Russell Steicke
>
>-- Fortune says:
>consultant, n.:
> Someone who knowns 101 ways to make love, but can't get a date.
>_______________________________________________
>plug mailing list
>plug at plug.linux.org.au
>http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug



More information about the plug mailing list