all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
To: rms@gnu.org
Cc: emacs-devel@gnu.org, drew.adams@oracle.com, miles@gnu.org
Subject: Re: cannot understand Elisp manual node Glyphs
Date: Fri, 09 Feb 2007 15:05:57 +0100	[thread overview]
Message-ID: <m3sldftohm.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <m3lkj7vb2p.fsf@kfs-l.imdomain.dk> (Kim F. Storm's message of "Fri\, 09 Feb 2007 12\:12\:46 +0100")

storm@cua.dk (Kim F. Storm) writes:

> Furthermore, the unicode branch only allows the first 511 faces
> defined to be used in glyph-code (vs. 4088 in Emacs 22) ... so maybe
> the whole implementation of glyph-codes need to be revised in Emacs 23
> -- yet another reason for making a clean interface for this NOW.

I've thought a little more about the Emacs 23 issue with glyph codes.

The current implementation (using a Lisp integer) is simply inadequate
for Emacs 23, so a solution must be found for it (perhaps using a cons
(char . face) or a float to represent glyph codes with faces.

This means that we will have to introduce the suggested functions
anyway at some point ... but by introducing them now, we prepare the
necessary framework for Emacs 23.

Consequently, mentioning at all how faces are encoded in glyph codes
in the lisp reference is a mistake - as this implementation will change
in the next Emacs release.

Here is a shot at rewording the glyph code section of the lispref
in an "Emacs 23 compatible" way (using the proposed new glyph API
functions):

*** display.texi	02 Feb 2007 11:06:10 +0100	1.247
--- display.texi	09 Feb 2007 14:57:07 +0100
***************
*** 5266,5291 ****

  @cindex glyph
    A @dfn{glyph} is a generalization of a character; it stands for an
! image that takes up a single character position on the screen.  Glyphs
! are represented in Lisp as integers, just as characters are.  Normally
! glyph come from vectors in the display table (@pxref{Display Tables}).
!
!   A glyph code can be @dfn{simple} or it can be defined by the
! @dfn{glyph table}.  A simple glyph code is just a way of specifying a
! character and a face to output it in.  When a glyph code is simple,
! the code, mod 524288, is the character to output, and the code divided
! by 524288 specifies the face number (@pxref{Face Functions}) to use
! while outputting it.  (524288 is
! @ifnottex
! 2**19.)
! @end ifnottex
! @tex
! $2^{19}$.)
! @end tex
! @xref{Faces}.

    On character terminals, you can set up a @dfn{glyph table} to define
! the meaning of glyph codes.

  @defvar glyph-table
  The value of this variable is the current glyph table.  It should be
--- 5266,5297 ----

  @cindex glyph
    A @dfn{glyph} is a generalization of a character; it stands for an
! image that takes up a single character position on the screen.  Normally
! glyphs come from vectors in the display table (@pxref{Display Tables}).
!
!   A glyph is represented in Lisp as a @dfn{glyph code}.  A glyph code
! can be @dfn{simple} or it can be defined by the @dfn{glyph table}.  A
! simple glyph code is just a way of specifying a character and a face
! to output it in.  @xref{Faces}.
!
!   The following functions are used to manipulate simple glyph codes:
!
! @defun make-glyph-code char &optional face
! This function returns a simple glyph code representing char @var{char}
! with face @var{face}.
! @end defun
!
! @defun glyph-char glyph
! This function returns the character of simple glyph code @var{glyph}.
! @end defun
!
! @defun glyph-face glyph
! This function returns face of simple glyph code @var{glyph}, or
! @code{nil} if @var{glyph} has the default face (face-id 0).
! @end defun

    On character terminals, you can set up a @dfn{glyph table} to define
! the meaning of glyph codes (represented as small integers).

  @defvar glyph-table
  The value of this variable is the current glyph table.  It should be
***************
*** 5307,5316 ****
  Send the characters in @var{string} to the terminal to output
  this glyph code.

! @item @var{integer}
! Define this glyph code as an alias for glyph code @var{integer}.  You
! can use such an alias to define a small-numbered glyph code which
! specifies a face.

  @item @code{nil}
  This glyph code is simple.
--- 5313,5322 ----
  Send the characters in @var{string} to the terminal to output
  this glyph code.

! @item @var{code}
! Define this glyph code as an alias for glyph code @var{code} created
! by @code{make-glyph-code}.  You can use such an alias to define a
! small-numbered glyph code which specifies a character with a face.

  @item @code{nil}
  This glyph code is simple.

--
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2007-02-09 14:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-05 23:11 cannot understand Elisp manual node Glyphs Drew Adams
2007-02-07 13:29 ` Kim F. Storm
2007-02-07 14:54   ` Drew Adams
2007-02-07 15:24     ` Kim F. Storm
2007-02-07 15:53       ` Drew Adams
2007-02-07 16:16         ` Stuart D. Herring
2007-02-07 16:21           ` Drew Adams
2007-02-08 16:38             ` Stuart D. Herring
2007-02-07 22:52   ` Miles Bader
2007-02-08  8:26     ` Kim F. Storm
2007-02-08  8:51       ` David Kastrup
2007-02-08 10:39         ` Kim F. Storm
2007-02-08 23:46           ` Richard Stallman
2007-02-09  7:17             ` David Kastrup
2007-02-09  9:12               ` Markus Triska
2007-02-09  9:43                 ` Nick Roberts
2007-02-09 23:48                 ` Richard Stallman
2007-02-09 14:23               ` Richard Stallman
2007-02-09 11:12             ` Kim F. Storm
2007-02-09 11:32               ` Juanma Barranquero
2007-02-09 23:48                 ` Richard Stallman
2007-02-09 14:05               ` Kim F. Storm [this message]
2007-02-09 23:49                 ` Richard Stallman
2007-02-10  0:40                   ` Drew Adams
2007-02-10 17:40                     ` Richard Stallman
2007-02-11 14:18                       ` Miles Bader
2007-02-11 21:07                       ` Kim F. Storm
2007-02-12 17:53                         ` Richard Stallman
2007-02-14 23:32                           ` Kim F. Storm
2007-02-10 10:19                   ` Eli Zaretskii
2007-02-10 17:41                     ` Richard Stallman
2007-02-10 13:59                   ` Miles Bader
2007-02-11  0:20                     ` Richard Stallman
2007-02-11  1:34                       ` Drew Adams
2007-02-11 14:16                       ` Miles Bader
2007-02-12 17:52                         ` Richard Stallman
2007-02-09 18:16               ` Stuart D. Herring
2007-02-08 16:21       ` Stefan Monnier
2007-02-08 16:36         ` Juanma Barranquero
2007-02-08  9:58     ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3sldftohm.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.