Bonjour,

Je m'excuse de mes lettres en japonais. J'ai pass,bi(B la journ,bi(Be ,b`
(Bcomprendre pourquoi. C'est donc emacs qui cafouille un peu. Je vous
promet que ,bg(Ba n'arrivera plus!

La suite est des d,bi(Btails ennuyeux pour ceux qui ne se serve pas de emacs:

La faute venait de quail. Quand je r,bi(Bpond a un message en me servant
de supercite le message est en iso8859-15. Or quand j',bi(Bcris du
fran,bg(Bais en me servant de quail, j'ins,bi(Brai du texte en iso8859-1. VM
n'aime pas ce m,bi(Blange est se dit que c'est du Japonais! Catastrophe.

Le tout est de r,bi(Bparer quail pour qu'il soit un peu plus malin, et ne
fasse pas le m,bi(Blange. Ce code est utile aussi pour ceux qui tape
plus d'une langue en emacs.

(setq my-charset-to-input-method-alist 
          '((latin-iso8859-1 . latin-1-prefix)
                (latin-iso8859-15 . latin-9-prefix)
                (japanese-jisx0208 . japanese)
))
                                                                           
(defun my-toggle-input-method(&optional arg)
  "Enable or disable multilingual text input method for the current buffer.
Only one input method can be enabled at any time in a given buffer.

Tries to figure out which input method to use depending on the
character encoding of the buffer. It looks in the alist
my-charset-to-input-method-alist to figure out which input method to
use depending on a given buffer encoding.

If the buffer has multiple encoding, it will prompth the user for an
input method.
"

  (interactive "P")
  (if (and current-input-method (not arg))
      (inactivate-input-method)
        (let ((charsets (delq 'ascii (find-charset-region
                                                                  (point-min) 
(point-max)))))
          (if (or (null charsets) (cdr charsets))
                  (toggle-input-method arg)
                (let ((input-method 
                           (cdr (assoc (car charsets) 
my-charset-to-input-method-alist))))
                  (if (null input-method)
                          (toggle-input-method arg)
                        (activate-input-method input-method))))))
)

(global-set-key "\C-\\" 'my-toggle-input-method)

Comme disait RMS ,b`(B Bordeaux "Emacs est une religion", ce fut donc
pri,bh(Bres du jour!

A+

Ivan
--
/-----------------------------------------------------------------------------*
|  "There are some experiences in life which should not  |     Ivan Kanis     |
|  be demanded twice from any man, and one of them is    |  [EMAIL PROTECTED]  |
|  listening to the Brahms Requiem."                     |   www.juliva.com   |
|  (George Bernard Shaw)                                 |                    |
*-----------------------------------------------------------------------------/

Linux-Azur :      http://www.linux-azur.org
D?sinscriptions: http://www.linux-azur.org/liste.php3
**** Pas de message au format HTML, SVP ****

Répondre à