all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Converting compositions to strings
Date: Mon, 30 Jan 2017 17:18:47 +0200	[thread overview]
Message-ID: <83a8a8y3s8.fsf@gnu.org> (raw)
In-Reply-To: <fe43fcaf-6fca-4ee7-4fbc-d4dd983e9e33@gmail.com> (message from Clément Pit-Claudel on Mon, 30 Jan 2017 00:13:34 -0500)

> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> 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.



  parent reply	other threads:[~2017-01-30 15:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30  5:13 Converting compositions to strings Clément Pit-Claudel
2017-01-30 13:34 ` Stefan Monnier
2017-01-30 16:23   ` Clément Pit-Claudel
2017-01-30 14:24 ` Ted Zlatanov
2017-01-30 16:27   ` Clément Pit-Claudel
2017-01-30 17:48     ` Ted Zlatanov
2017-01-30 15:18 ` Eli Zaretskii [this message]
2017-01-30 16:39   ` Clément Pit-Claudel
2017-01-30 16:52     ` Eli Zaretskii
2017-01-31 14:31       ` Stefan Monnier

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=83a8a8y3s8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cpitclaudel@gmail.com \
    --cc=emacs-devel@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.