From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Converting compositions to strings Date: Mon, 30 Jan 2017 17:18:47 +0200 Message-ID: <83a8a8y3s8.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1485789581 20212 195.159.176.226 (30 Jan 2017 15:19:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 30 Jan 2017 15:19:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 30 16:19:37 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYDjy-00052P-3B for ged-emacs-devel@m.gmane.org; Mon, 30 Jan 2017 16:19:34 +0100 Original-Received: from localhost ([::1]:33327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYDk3-0004TW-Kq for ged-emacs-devel@m.gmane.org; Mon, 30 Jan 2017 10:19:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYDjK-0004TK-5C for emacs-devel@gnu.org; Mon, 30 Jan 2017 10:18:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYDjG-0007ls-Uk for emacs-devel@gnu.org; Mon, 30 Jan 2017 10:18:54 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYDjG-0007lm-Qq; Mon, 30 Jan 2017 10:18:50 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3969 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cYDjF-0003Tr-Tw; Mon, 30 Jan 2017 10:18:50 -0500 In-reply-to: (message from =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel on Mon, 30 Jan 2017 00:13:34 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211763 Archived-At: > From: Clément Pit-Claudel > 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.