[Top][All Lists]

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

Re: announcing thaiword.el?

From: Stefan Monnier
Subject: Re: announcing thaiword.el?
Date: Sat, 26 Mar 2005 10:21:44 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

>> As a compromise I suggest that M-f and M-b are mapped to
>> thai-forward-word and thai-backward-word, respectively, as soon as we
>> enter the Thai environment.  This should be a two-liner or so for the
>> experienced Emacs Lisp hacker (which I'm not, unfortunately).

> We can do that by setup-function and exit-function of a
> language environment.

>   setup-function     value is a function to call to switch to this
>                       language environment.
>   exit-function      value is a function to call to leave this
>                       language environment.

> But, I'm not an expert of key-binding.

> Could someone tell me what is the right way to rebind all
> keys that are currently bound to forward-word to
> thai-forward-word, and bind them back to the orignal later?

Something like

  (defvar thaiword-mode-map
    (let ((map (make-sparse-keymap)))
      (define-key [remap forward-word] 'thai-forward-word)
      (define-key [remap backward-word] 'thai-backward-word)
  (define-minor-mode thaiword-mode
    "Minor mode to make word-movement aware of thai words."
    :global t)

Then add (lambda () (thaiword-mode 1)) to setup-function
and (lambda () (thaiword-mode -1)) to exit-function


reply via email to

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