emacs-devel
[Top][All Lists]
Advanced

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

Re: Converting compositions to strings


From: Eli Zaretskii
Subject: Re: Converting compositions to strings
Date: Mon, 30 Jan 2017 17:18:47 +0200

> From: Clément Pit-Claudel <address@hidden>
> Date: Mon, 30 Jan 2017 00:13:34 -0500
> 
> Many compositions can be represented as strings: for example, 
> prettify-symbols-mode composes "lambda" into "λ", and nameless prettifies the 
> name of the current package as ":" or "::".
> 
> How can I reconstruct these strings from the value of the 'composition' text 
> property?  Small experiments suggest that for single-character compositions 
> the property has the shape (_ _ [?λ]) and for multi-character compositions (_ 
> _ [?x _ ?y _ …]), but I also found instances of the shape ((_ ?x _ _)), and 
> ((_ . ?x)) (I think).

The information about this can be found in the doc strong of
compose-region, under COMPONENTS.

> Is there a recipe that I can use to construct a string representation of a 
> composition? (I realize that many compositions can't adequately be 
> represented as plain strings; I'm only interested in those that can).

I don't really understand what you mean by "string representation of a
composition".  In general, a composition doesn't represent a string,
and even those that are represented by characters or strings in the
property are many times something other than a string.  The ones that
seem to be relevant to what you are looking for (I'm guessing) are a
small class, and I don't think you can discern them from the others
unless you look at the "rules" parts of a composition.



reply via email to

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