unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Implementation of (self-insert-command ) ??
@ 2003-09-15  8:08 Joakim Hove
  2003-09-15  9:49 ` Reiner Steib
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Joakim Hove @ 2003-09-15  8:08 UTC (permalink / raw)



Hello,

I am writing some simple functionality to insert the portabel variety
of Norwegian characters in LaTeX, so that:

Keyboard press     Inserted in buffer
-------------------------------------
æ                  {\ae}
ø                  {\o}
å                  {\aa}
...
-------------------------------------

I have implemented this with something like:

(define-key LaTeX-mode-map keycode 'latex-insert-encoded)

Where the function (latex-insert-encoded) does the actual
insertion. What I wondered was how to pass the keycode invoking
(latex-insert-encoded) to the function (latex-insert-encoded)?



Best Regards

Joakim Hove

-- 
  /--------------------------------------------------------------------\
 / Joakim Hove  / hove@bccs.no  /  (55 5) 84076       |                 \
 | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
 | CMU                                                | 5231 Paradis    |
 \ Thormøhlensgt.55, 5020 Bergen.                     | 55 91 28 18     /
  \--------------------------------------------------------------------/

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

* Re: Implementation of (self-insert-command ) ??
  2003-09-15  8:08 Implementation of (self-insert-command ) ?? Joakim Hove
@ 2003-09-15  9:49 ` Reiner Steib
  2003-09-15 11:48   ` Implementation of (self-insert-command ) ?? [Solved] Joakim Hove
  2003-09-15 15:32 ` Implementation of (self-insert-command ) ?? Stefan Monnier
  2003-09-17  0:57 ` Jim Janney
  2 siblings, 1 reply; 7+ messages in thread
From: Reiner Steib @ 2003-09-15  9:49 UTC (permalink / raw)


On Mon, Sep 15 2003, Joakim Hove wrote:

> I am writing some simple functionality to insert the portabel variety
> of Norwegian characters in LaTeX, so that:
>
> Keyboard press     Inserted in buffer
> -------------------------------------
> æ                  {\ae}
> ø                  {\o}
> å                  {\aa}
> ...

What's wrong with "\usepackage[latin1]{inputenc}"?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/

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

* Re: Implementation of (self-insert-command ) ?? [Solved]
  2003-09-15  9:49 ` Reiner Steib
@ 2003-09-15 11:48   ` Joakim Hove
  0 siblings, 0 replies; 7+ messages in thread
From: Joakim Hove @ 2003-09-15 11:48 UTC (permalink / raw)



Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:


>
> What's wrong with "\usepackage[latin1]{inputenc}"?
>

Nothing wrong with that - in most cases that is probably the best
solution, but specially when mailing LaTeX code out of the country I
prefer a 100% portable format.

Thanks anyway :-)

Joakim

PS - The problem is solved with the help of the variable:
'last-command-event


-- 
  /--------------------------------------------------------------------\
 / Joakim Hove  / hove@bccs.no  /  (55 5) 84076       |                 \
 | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
 | CMU                                                | 5231 Paradis    |
 \ Thormøhlensgt.55, 5020 Bergen.                     | 55 91 28 18     /
  \--------------------------------------------------------------------/

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

* Re: Implementation of (self-insert-command ) ??
  2003-09-15  8:08 Implementation of (self-insert-command ) ?? Joakim Hove
  2003-09-15  9:49 ` Reiner Steib
@ 2003-09-15 15:32 ` Stefan Monnier
  2003-09-16 14:48   ` Piet van Oostrum
  2003-09-17  0:57 ` Jim Janney
  2 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2003-09-15 15:32 UTC (permalink / raw)


> Keyboard press     Inserted in buffer
> -------------------------------------
> æ                  {\ae}
> ø                  {\o}
> å                  {\aa}
> ...
> -------------------------------------

If you really don't like LaTeX's `inputenc', you can also try to use
`iso-cvt' (bundled with Emacs) to convert upon load/save.
Or also X-Symbol, which does the same and more in a much more
sophisticated way.


        Stefan

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

* Re: Implementation of (self-insert-command ) ??
  2003-09-15 15:32 ` Implementation of (self-insert-command ) ?? Stefan Monnier
@ 2003-09-16 14:48   ` Piet van Oostrum
  2003-09-16 14:58     ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Piet van Oostrum @ 2003-09-16 14:48 UTC (permalink / raw)


>>>>> "Stefan Monnier" <monnier@iro.umontreal.ca> (SM) wrote:

>> Keyboard press     Inserted in buffer
>> -------------------------------------
>> æ                  {\ae}
>> ø                  {\o}
>> å                  {\aa}
>> ...
>> -------------------------------------

SM> If you really don't like LaTeX's `inputenc', you can also try to use
SM> `iso-cvt' (bundled with Emacs) to convert upon load/save.
SM> Or also X-Symbol, which does the same and more in a much more
SM> sophisticated way.

The bundled iso-cvt is quite buggy, in that it generates LaTeX code that
gives different results than the use of the non-ASCII characters with
inputenc. I personally use a mended version, but it also isn't 100% right.
-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum@hccnet.nl

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

* Re: Implementation of (self-insert-command ) ??
  2003-09-16 14:48   ` Piet van Oostrum
@ 2003-09-16 14:58     ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2003-09-16 14:58 UTC (permalink / raw)


SM> If you really don't like LaTeX's `inputenc', you can also try to use
SM> `iso-cvt' (bundled with Emacs) to convert upon load/save.
SM> Or also X-Symbol, which does the same and more in a much more
SM> sophisticated way.

> The bundled iso-cvt is quite buggy, in that it generates LaTeX code that
> gives different results than the use of the non-ASCII characters with
> inputenc.

Indeed, it's difficult to do it right.
X-Symbol goes through some significant trouble to try and do it
well, but I don't know if it covers 100% of the cases (after all, it's
difficult to fix it in a `verbatim' environment, for example).

> I personally use a mended version, but it also isn't 100% right.

Patches welcome,


        Stefan

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

* Re: Implementation of (self-insert-command ) ??
  2003-09-15  8:08 Implementation of (self-insert-command ) ?? Joakim Hove
  2003-09-15  9:49 ` Reiner Steib
  2003-09-15 15:32 ` Implementation of (self-insert-command ) ?? Stefan Monnier
@ 2003-09-17  0:57 ` Jim Janney
  2 siblings, 0 replies; 7+ messages in thread
From: Jim Janney @ 2003-09-17  0:57 UTC (permalink / raw)


Joakim Hove <hove@bccs.no> wrote:

> Hello,
> 
> I am writing some simple functionality to insert the portabel variety
> of Norwegian characters in LaTeX, so that:
> 
> Keyboard press     Inserted in buffer
> -------------------------------------
> æ                  {\ae}
> ø                  {\o}
> å                  {\aa}
> ...
> -------------------------------------
> 
> I have implemented this with something like:
> 
> (define-key LaTeX-mode-map keycode 'latex-insert-encoded)
> 
> Where the function (latex-insert-encoded) does the actual
> insertion. What I wondered was how to pass the keycode invoking
> (latex-insert-encoded) to the function (latex-insert-encoded)?
> 

I think self-insert-command looks at the variable last-command-event.
You can also get the prefix argument with (interactive "P")

-- 
Jim Janney

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

end of thread, other threads:[~2003-09-17  0:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-15  8:08 Implementation of (self-insert-command ) ?? Joakim Hove
2003-09-15  9:49 ` Reiner Steib
2003-09-15 11:48   ` Implementation of (self-insert-command ) ?? [Solved] Joakim Hove
2003-09-15 15:32 ` Implementation of (self-insert-command ) ?? Stefan Monnier
2003-09-16 14:48   ` Piet van Oostrum
2003-09-16 14:58     ` Stefan Monnier
2003-09-17  0:57 ` Jim Janney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).