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

Re: MCL characters



In article <HALTRAET.92May25101817@sparc.si.no> haltraet@sparc.si.no (Hallvard Tr{tteberg) writes:
   I'm writing a small text editor in CLIM 1.0 and MCL 2.0 (both beta),
   but I believe the question is only related to MCL.

Sorry Hal, it turns out that the question concerns CLIM more than MCL.

   Somehow the representation [of the characters #\a , #<c-a> and #<m-a>]
   must differ, since the printer knows the difference, as the printout
   showed.

I little digging inside the print-object method for characters
revealed that CLIM defines an around method that looks at special
char-bits in the character before printing. A little more digging
showed that CLIM also contains a function for setting the char-bits.
It seems that the character representation in MCL has several unused
bits that CLIM uses to code modifier keys (shift, control, meta,
super, hyper as on the symbolics). So the printed representation
refered to above is entirely due to CLIM and not MCL.

   So the question is: How can I make character constants for the three
   characters mentioned above (and all others of course) and what
   function should I use to compare them with read characters?

A character 'contructor' can be written in terms of
CLIM-UTILS::%set-char-bits. Use eql as the test function or test only
the char-bits with =. I have written both, contact me for details.

   I would also be nice to have functions control-character-p and
   meta-character-p (option-character-p) for classifying characters.

Use CLIM-UTILS:char-bits, I've made those, too.

   I hope you can give me help on this, I'm quite stuck.

   Regards, Hallvard Traetteberg

Special thanks to the wonderful MCL Inspector and Disassembler.
Regards, Hallvard Traetteberg.
--
Hallvard Traetteberg
Dept. of Knowledge Based Systems
Center for Industrial Research
Box 124 Blindern, 0314 Oslo 3
NORWAY

Tlf: +47 2 45 20 10
Fax: +47 2 45 20 40
Email: haltraet@si.no