emacs-devel
[Top][All Lists]
Advanced

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

Re: saving compositions or not


From: Kenichi Handa
Subject: Re: saving compositions or not
Date: Wed, 28 Aug 2002 21:17:33 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.1.30 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, "Stefan Monnier" <monnier+gnu/address@hidden> 
writes:
> I've been using my silly "lambda hack" (posted on gnu.emacs.sources
> a little while back) and have noticed that it has an unintended
> consequence: because it uses compositions (to turn the `lambda'
> keyword into a lambda letter from the greek alphabet) it ends up
> modifying the file if the file is saved in emacs-mule format (which
> is the format naturally chosen by Emacs for those files it seems).

If your file doesn't contain any non-ascii chars except in
compositions, I don't know why emacs-mule is naturally
chosen.  Or, do you actually inserts non-ASCII chars of
several charsets?

> That is, the composition itself is saved, so the file still works,
> but it unexpectedly still appears with a lambda-char rather than
> a lambda-keyword if you load it in `emacs -q --no-site-file'.

> Up until here, I could consider it a feature, except that it means
> that the file will look odd in a non-Emacs editor (because it
> uses the emacs-mule coding-system rather than plain ASCII)
> and (more importantly) that `cvs diff' will show that the file has
> changed, replacing the lambda keyword with a lambda char composition.

> How could I change my hack such that the composition is *not* saved
> (i.e. is kept as a display-only trick which has no impact whatsoever on
> the saved buffer) ?

Currently, the coding system emacs-mule is hardcoded to
handle composition.  But, many coding systems
(e.g. iso-latin-*, utf-8) doesn't handle composition.  So,
using one of them will solve your problem.

But, if you really inserts non-ASCII chars of many charsets
in your file, and thus non of above is useless, you can use
iso-latin-X-with-esc.

You can also make a coding system something like this and
use it.

(make-coding-system
 'iso-2022-7bit-no-composition 2 ?J
 "Like iso-2022-7bit bug doesn't preserve information of compositions."
 '((ascii t) nil nil nil
   short ascii-eol ascii-cntl seven)
 '((safe-charsets . t)))

---
Ken'ichi HANDA
address@hidden




reply via email to

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