unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* saving compositions or not
@ 2002-08-28  0:43 Stefan Monnier
  2002-08-28 12:17 ` Kenichi Handa
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2002-08-28  0:43 UTC (permalink / raw)



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).
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) ?


	Stefan

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

* Re: saving compositions or not
  2002-08-28  0:43 saving compositions or not Stefan Monnier
@ 2002-08-28 12:17 ` Kenichi Handa
  0 siblings, 0 replies; 2+ messages in thread
From: Kenichi Handa @ 2002-08-28 12:17 UTC (permalink / raw)
  Cc: emacs-devel

In article <200208280043.g7S0hIA32094@rum.cs.yale.edu>, "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> 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
handa@etl.go.jp

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

end of thread, other threads:[~2002-08-28 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-28  0:43 saving compositions or not Stefan Monnier
2002-08-28 12:17 ` Kenichi Handa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).