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

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

RE: [h-e-w] insert sterling character


From: Dr Francis J. Wright
Subject: RE: [h-e-w] insert sterling character
Date: Thu, 1 Jul 2004 16:52:46 +0100

> From: 
> address@hidden 
> [mailto:address@hidden
> rg] On Behalf Of Peter Kaiser
> Sent: Thursday, 1 July 2004 4:44 pm
> To: GNU emacs for Windows
> Subject: Re: [h-e-w] insert sterling character
> 
> Dr Francis J. Wright wrote:
> 
> > To write an interactive command (rather than just a Lisp function), 
> > you will need something like this:
> > (global-set-key [?\C-$] (lambda () (interactive "*") (insert 2211)))
> 
> Couldn't that "*" cause a bit of trouble?
> 
>      (global-set-key [?\C-$] (lambda () (interactive) (insert 163)))
> 
> works for me and is a bit simpler.
> 
> Pete

The "*" just means that Emacs complains a bit sooner if the buffer is
read-only.  It's not essential; I just feel that it's probably good form to
include it in any interactive function that will modify the buffer.

I guess 163 is the UK-ASCII code for £ and 2211 is the (current) internal
Emacs code.  If I enter £ into an Emacs buffer by pressing the £ key on my
keyboard and then do C-x =, Emacs tells me that the character code is 2211,
which is why I used that.

Francis





reply via email to

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