[Top][All Lists]

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

Re: Comments on display.texi

From: Richard Stallman
Subject: Re: Comments on display.texi
Date: Sun, 26 Sep 2004 14:20:16 -0400

    The code uses the integer value (the bitmap number), so I didn't see
    any reason to use a symbol here.

The reason is, it is more Lisp-like to use symbols than numbers.
It is easier to debug a program when you see a symbol whose name
is meaningful than when you see a number.

    It is the same for e.g. images -- you specify the image, not a symbol
    identifying an image.

Sorry, I don't understand.  When you say "you specify the image",
what data type is that?

    > @item Value indicating that no fringe bitmap is present:
    > @code{no-fringe-bitmap}.
    > @c ??? I don't understand what that means.
    > @c ??? Where would you find that value?

    In the car or cdr of the return value from fringe-bitmaps-at-pos if
    there is no bitmap in left or right fringe.

It should use nil for that.
nil is the canonical Lisp way to say such a thing.

    If you specify an undefined fringe bitmap in a display property,
    e.g. using fringe bitmap number 100 and only 50 bitmaps are defined.
    Then the fringe will contain the undef-fringe-bitmap (a question-mark).

It would be better for this function to return the value you specified
and for display to ignore undefined bitmaps.

    > @c ??? Why not return a list of symbols that identify the bitmaps?
    > @c ??? This is Lisp, not C.

    Internally the bitmaps are represented and managed using integers
    (indexes), so there are no internal symbols defining bitmaps --- just
    like there are no internal symbols defining images.

    For simplicity, I chose to expose those integers as "opaque fringe
    bitmap numbers".  Using symbols would be a lot of extra work for no
    added functionality!

Just because the internals use integers is no reason to design the
Lisp-level interface that way.

The change to use symbols would only affect two functions:
define-fringe-bitmap and fringe-bitmaps-at-pos.  The symbol could
still have an integer as its value.  define-fringe-bitmap would record
the names of the symbols in a vector, indexed by the integer, and
fringe-bitmaps-at-pos would get the symbols out of that vector.

In addition, when the text property contains a symbol instead of the
now-expected integer, use the symbol's value.

Meanwhile, why does the code only support 255 different values?
That arbitrary limit is embarrassing.  What would it cost to get
rid of that limit?

reply via email to

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