From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Idea: Be able to use text properties as face attributes Date: Mon, 27 Mar 2017 07:01:22 -0700 (PDT) Message-ID: <30eb5a49-2d98-4f37-8f8c-32a88cd76827@default> References: <7a902f7b-d808-4d0f-8ff9-b8f07eaddf83@default> <30d920b0-e1de-497d-98de-8b69e835e855@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1490623318 12597 195.159.176.226 (27 Mar 2017 14:01:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Mar 2017 14:01:58 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 27 16:01:47 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 1csVDA-0001Fs-Gr for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2017 16:01:32 +0200 Original-Received: from localhost ([::1]:46946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csVDG-0000dV-F5 for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2017 10:01:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csVDA-0000dK-8K for emacs-devel@gnu.org; Mon, 27 Mar 2017 10:01:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csVD5-0004fx-Ja for emacs-devel@gnu.org; Mon, 27 Mar 2017 10:01:32 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:44072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1csVD5-0004fq-BE for emacs-devel@gnu.org; Mon, 27 Mar 2017 10:01:27 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v2RE1OTe018595 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 27 Mar 2017 14:01:25 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v2RE1O7b023815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Mar 2017 14:01:24 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v2RE1NGv019295 for ; Mon, 27 Mar 2017 14:01:24 GMT In-Reply-To: <30d920b0-e1de-497d-98de-8b69e835e855@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 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:213414 Archived-At: > (I can't check this right now, but) I wonder if it might not > be as simple as changing `get-text-property' to check whether > the character at the given POSITION either has the given PROP > or has a face property (`face', `font-lock-face', `mouse-face') > that has the given PROP as one of its attributes, and if so > to return the PROP value. I sent that quickly, without qualification or explanation. I was talking only about reading the `face' property and determining the effect to be given by the display engine. I didn't really mean to imply that `get-text-property' would itself be changed in any way. It should not be. (But perhaps it would be useful to have another function, `get-text-property-implied', which does give you such a value.) In my view, the effect of a applying a face whose spec contains non-face properties to some text would not change the text properties of that text (other than its `face', `font-lock-face', or `mouse-face' property). It would change only the rendered _effect_, i.e., what the display engine does. The text would appear as if the non-face properties were applied directly to the text, but in fact they would remain encapsulated within the `face' etc. property. There would thus be a difference between applying a non-face property directly to the text and "applying" it indirectly by adding it as a face attribute for a `face' etc. property that is applied to it. That keeps things clean and lets you change or undo the effect of that property _for that face_ only, by changing its face spec. > Priority should be given to the latter (PROP on the face) if > both exist, in my view. Dunno about priority among `face', > `font-lock-face', and `mouse-face', if more than one of them > has the PROP and those PROP values differ.