unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: raw-byte and char-table
@ 2010-08-26  2:58 MON KEY
  2010-08-26  3:34 ` Kenichi Handa
  0 siblings, 1 reply; 13+ messages in thread
From: MON KEY @ 2010-08-26  2:58 UTC (permalink / raw)
  To: handa; +Cc: Eli Zaretskii, Stefan Monnier, emacs-devel

> Number like #x3FFFA0 is so criptic.  The function name
> unibyte-char-to-multibyte is also not ideal, but I think
> it's better than #x3FFFA0.

Maybe I am misunderstanding, but I think the `#x' and `#o' syntax is
not cryptic at all in the context. These at least preserve identity:

 4194208, #o17777640, #x3fffa0

This signals an error:
 (unibyte-char-to-multibyte
  (unibyte-char-to-multibyte 160))

Also, there is the brevity factor:

(aref (syntax-table) #o17777640)

(aref (syntax-table) #x3fffa0)

(aref (syntax-table) 4194208)

(aref (syntax-table)
      (unibyte-char-to-multibyte 160))

> We could provide a ?\NNN (or similar) notation for it.  Similarly to
> what we do for those bytes in multibyte strings.

Howsabout just this one for all of them:

 `#\'

:)

>        Stefan

--
/s_P\



^ permalink raw reply	[flat|nested] 13+ messages in thread
* raw-byte and char-table
@ 2010-08-24  1:11 Kenichi Handa
  2010-08-24  3:06 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Kenichi Handa @ 2010-08-24  1:11 UTC (permalink / raw)
  To: emacs-devel

A char-table is a table indexed by a character code.  So,
it's 0xA0th element is a value for a character U+00A0.
Then, how to set/get a value for raw-byte 0xA0?  Currently,
this is the way to do that:

  (aref CHAR-TABLE (unibyte-char-to-multibyte #xA0))
  (aset CHAR-TABLE (unibyte-char-to-multibyte #xA0) VALUE)

But, this is not documented.  Should we document it?

A display-table is a char-table.  But, the current code uses
0xA0th element of a display-table for both U+00A0 and
raw-byte 0xA0.  For instance, in get_next_display_element of
xdisp.c:

5744	  if (it->dp
5745	      && (dv = DISP_CHAR_VECTOR (it->dp, it->c),
5746		  VECTORP (dv)))

Here, it->c may be 0xA0 comming from a unibyte buffer/string.

Should we change the above code and all other codes setting
0x80th..0xA0th elements of a display table?

---
Kenichi Handa
handa@m17n.org



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

end of thread, other threads:[~2010-08-27  3:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-26  2:58 raw-byte and char-table MON KEY
2010-08-26  3:34 ` Kenichi Handa
2010-08-26  5:30   ` MON KEY
2010-08-26  6:48     ` Kenichi Handa
2010-08-26  7:09       ` Miles Bader
2010-08-27  3:30         ` MON KEY
2010-08-27  3:45           ` Kenichi Handa
  -- strict thread matches above, loose matches on Subject: below --
2010-08-24  1:11 Kenichi Handa
2010-08-24  3:06 ` Eli Zaretskii
2010-08-24  4:29   ` Kenichi Handa
2010-08-24 17:08     ` Eli Zaretskii
2010-08-25  4:05       ` Kenichi Handa
2010-08-26  0:01         ` Stefan Monnier

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