unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: Idea: Be able to use text properties as face attributes
Date: Tue, 28 Mar 2017 14:39:51 -0700 (PDT)	[thread overview]
Message-ID: <47dbc994-71ea-4606-9d9a-06bd7d800de4@default> (raw)
In-Reply-To: <<83tw6d785i.fsf@gnu.org>>

> > > As I explained, the display engine, which is the part that implements
> > > the faces, will be unable to do anything with attributes that don't
> > > affect display.
> >
> > Yes, you explained that.  Thanks.
> >
> > Does that mean that such code could not invoke _other_ code
> > that _would_ be able to do something with those text properties
> > (that masquerade in a face spec as face attributes)?
> 
> We can invoke (almost) any code we like, but the question is what
> would that other code do with those attributes?  Those attributes,
> like their corresponding text properties, have their effect when the
> corresponding Emacs features are invoked,

And that's the only time the face spec containing those
properties needs to be handled by that other code.

Instead of just looking for the text property that it
handles, as something that belongs to the text char
it checks, it would need to first check that char for
a face property.

And if there is a face property with that text property
embedded in it (as a pseudo face attribute) then whatever
that code would do with the text property it would do
with the text property from the face spec.

That's all.

> like buffer text
> modification for the 'read-only' property or keyboard
> input processing for the 'keymap' property.

Yes, exactly.  The code that checks for and handles a
`read-only' or a `keymap' text property would simply
check for it in two places instead of one: (1) first,
embedded in a face property, if there is one, (2) if
not, directly on the char.

> There's nothing we could do with these
> attributes during processing of faces by the display engine,

Yes, that's been clear for a while now.  You were thrown
off in that direction by my referring to "display engine"
and "redisplay" out of ignorance of where in the C code
this or that property is handled.

The point is that _wherever_ a given text property is
handled in the code, that code would need to take a
larger view to check for the property.  It would not
look only for the property directly on the text; it
would look also (and first) for that property as
embedded in a face property (`face', `font-lock-face',
or  `mouse-face').

> Text properties are precisely a way to record such
> information, but you don't want to use text properties in this case.

I want to use a _face_ text property to record them.
So yes, I do want to use a text property: one of
the properties `face', `font-lock-face', and 
`mouse-face'.  And I want to (be able to) record
the values of other text properties _within the
value of the face property_.

> So some other means of recording the information will
> have to be invented.

No.  Not in my view.  They would be recorded in a face
property.  No other recording needed.

> But since those means will most probably be very similar to
> text properties, at least implementation-wise, what would be the point
> of inventing that?

No such invention is needed, in my view.

> > I think by now you should understand why I proposed the
> > feature - its use.  I've made that pretty clear.
> >
> > You are free to think that it's a useless feature, of course,
> > and you are free to think that it might be useful but is not
> > feasible to implement.
> 
> Sorry, I don't understand.  My questions and my confusion are real, so
> please bear with me and don't assume I'm repeatedly asking the same
> questions for argument's sake.  I'm asking them because I really don't
> understand your motivation for proposing this feature in the form that
> you proposed it.  It's your proposal, so only you can explain its
> details.

OK, glad to hear that.  Sometimes it's not clear.  Do you
understand now?  If not, do you think there is something
else I can add that would make things clearer?

The motivation is to be able to leverage face-occurrence
locations to manipulate (indirectly) text properties at
those locations.

We have functions - even user commands - that you can use
to change the attributes of a face, and doing that affects
all occurrences of the face (or all on a given frame,
optionally).

We can leverage these features to let users and code
(in effect) manipulate other text properties at whole
sets of locations at once.  Which locations?  Those of
a given face.

And we have umpteen ways to apply a face to different
locations - again, either by Lisp or user commands.

So users will be able to:

1. Put a face wherever they want (they can do that now).

2. Manipulate any text properties (that are supported)
   at those locations.

Please let me know if this is becoming any clearer
to you.  Neither of us wants to waste the time of the
other (and others), if there is no real communication
going on.



  parent reply	other threads:[~2017-03-28 21:39 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-26 19:14 Idea: Be able to use text properties as face attributes Drew Adams
2017-03-26 20:01 ` Clément Pit-Claudel
2017-03-26 21:42   ` Drew Adams
2017-03-26 22:14     ` Clément Pit-Claudel
2017-03-26 23:26       ` Drew Adams
2017-03-27  1:23         ` Clément Pit-Claudel
2017-03-27 14:54   ` Eli Zaretskii
2017-03-27  4:51 ` Drew Adams
2017-03-27 14:01   ` Drew Adams
2017-03-27 14:57     ` Eli Zaretskii
     [not found]   ` <<30eb5a49-2d98-4f37-8f8c-32a88cd76827@default>
     [not found]     ` <<83bmsm938f.fsf@gnu.org>
2017-03-27 15:49       ` Drew Adams
2017-03-27 18:59         ` Eli Zaretskii
     [not found]   ` <<<30eb5a49-2d98-4f37-8f8c-32a88cd76827@default>
     [not found]     ` <<<83bmsm938f.fsf@gnu.org>
     [not found]       ` <<7f98847c-9b5e-47cf-85f2-247c2045d0af@default>
     [not found]         ` <<834lye8s1k.fsf@gnu.org>
2017-03-27 20:01           ` Drew Adams
2017-03-28 15:06             ` Eli Zaretskii
2017-03-28 15:26               ` Stefan Monnier
2017-03-28 21:40                 ` Drew Adams
2017-03-28 22:45                   ` Stefan Monnier
2017-03-28 23:10                     ` Drew Adams
2017-03-29  1:36                       ` Stefan Monnier
2017-03-29  5:32                         ` Drew Adams
     [not found]   ` <<<<30eb5a49-2d98-4f37-8f8c-32a88cd76827@default>
     [not found]     ` <<<<83bmsm938f.fsf@gnu.org>
     [not found]       ` <<<7f98847c-9b5e-47cf-85f2-247c2045d0af@default>
     [not found]         ` <<<834lye8s1k.fsf@gnu.org>
     [not found]           ` <<93aa220a-35c8-4be1-bfb5-299c46c9eba9@default>
     [not found]             ` <<83tw6d785i.fsf@gnu.org>
2017-03-28 21:39               ` Drew Adams [this message]
2017-03-27  7:56 ` Yuri Khan
2017-03-27 14:01   ` Drew Adams
2017-03-27 14:55   ` Eli Zaretskii
2017-03-27 14:51 ` Eli Zaretskii
     [not found] <<7a902f7b-d808-4d0f-8ff9-b8f07eaddf83@default>
     [not found] ` <<83h92e93ip.fsf@gnu.org>
2017-03-27 16:22   ` Drew Adams
2017-03-27 18:52     ` Eli Zaretskii
     [not found] <<<7a902f7b-d808-4d0f-8ff9-b8f07eaddf83@default>
     [not found] ` <<<83h92e93ip.fsf@gnu.org>
     [not found]   ` <<8080a162-700f-42cc-aec9-5fdd7c646297@default>
     [not found]     ` <<8360iu8sdm.fsf@gnu.org>
2017-03-27 20:01       ` Drew Adams
2017-03-28 15:08         ` Eli Zaretskii
     [not found] <<<<7a902f7b-d808-4d0f-8ff9-b8f07eaddf83@default>
     [not found] ` <<<<83h92e93ip.fsf@gnu.org>
     [not found]   ` <<<8080a162-700f-42cc-aec9-5fdd7c646297@default>
     [not found]     ` <<<8360iu8sdm.fsf@gnu.org>
     [not found]       ` <<19e94d18-656f-4a8f-8843-4d46ffdd037b@default>
     [not found]         ` <<83shlx782i.fsf@gnu.org>
2017-03-28 21:39           ` Drew Adams
2017-03-29 14:51             ` Eli Zaretskii
2017-03-29 15:21               ` Lars Ingebrigtsen
2017-03-29 15:36                 ` Clément Pit-Claudel
2017-03-29 17:08                   ` Drew Adams
2017-03-29 15:41                 ` Andreas Politz
2017-03-29 17:08                 ` Drew Adams
     [not found] <<<<<7a902f7b-d808-4d0f-8ff9-b8f07eaddf83@default>
     [not found] ` <<<<<83h92e93ip.fsf@gnu.org>
     [not found]   ` <<<<8080a162-700f-42cc-aec9-5fdd7c646297@default>
     [not found]     ` <<<<8360iu8sdm.fsf@gnu.org>
     [not found]       ` <<<19e94d18-656f-4a8f-8843-4d46ffdd037b@default>
     [not found]         ` <<<83shlx782i.fsf@gnu.org>
     [not found]           ` <<403a3ff2-464f-4eb5-9843-60592e786955@default>
     [not found]             ` <<83a8846srr.fsf@gnu.org>
2017-03-29 17:06               ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47dbc994-71ea-4606-9d9a-06bd7d800de4@default \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).