unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* char properties vs char properties: two different meanings
@ 2013-09-11 17:18 Drew Adams
  2013-09-11 19:31 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2013-09-11 17:18 UTC (permalink / raw)
  To: emacs-devel

Not sure what a good solution might be, but we have a terminology problem:
there are two completely different notions of "character property" used
in Emacs Lisp:

1. A character property is either a text property or an overlay property.
   It is what function `get-char-property' returns.  It is good to have
   a term that covers both.  I use it in doc for functions I have that
   act on either, for instance.

2. A character property is a named attribute of a character...
   See (elisp) `Character Properties'.

#2 was added to our doc in Emacs 23.  It is terminology that comes from
outside Emacs (from Unicode).

Both are useful, each makes sense and is a good name for what it means.
But the two have nothing to do with each other.

Perhaps nothing should be done about the different meanings, and context
alone can be used to indicate which is meant.  Dunno.  Or perhaps someone
has a great suggestion, e.g., an alternative term for #1?   (We certainly
should not try to change #2 for Emacs, in any case.)

If we keep the same name for both meanings then perhaps the doc should at
least point out that the term is used in Emacs in two different ways.

It might also help to change the name of the manual node for #2, so that
someone using `g' to find info about #1 won't be misled.  But since #2
is not limited to Unicode character properties in Emacs I can't think of
a better node name offhand.  I.e., it would not be accurate to name the
node, say, `Unicode Character Properties' (which would help users looking
for #1 avoid this node).

One possibility that occurs to me is to take a suggestion from the function
names.  For #1 we have function `get-char-property'.  For #2 we have
`get-char-code-property'.  So perhaps we could, at least in the node name
for #2, for example, change `Character Properties' to `Character Code
Properties'.

Is "character code property" accurate?  If so, then we could also change
the text to use the same name: "character code property" instead of
"character property". If it is not really accurate then perhaps it would
still be OK (& helpful) to rename the node, but to use the proper
terminology in the explanation (node text).



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: char properties vs char properties: two different meanings
  2013-09-11 17:18 char properties vs char properties: two different meanings Drew Adams
@ 2013-09-11 19:31 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2013-09-11 19:31 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

> Date: Wed, 11 Sep 2013 10:18:42 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> Not sure what a good solution might be, but we have a terminology problem:
> there are two completely different notions of "character property" used
> in Emacs Lisp:
> 
> 1. A character property is either a text property or an overlay property.
>    It is what function `get-char-property' returns.  It is good to have
>    a term that covers both.  I use it in doc for functions I have that
>    act on either, for instance.
> 
> 2. A character property is a named attribute of a character...
>    See (elisp) `Character Properties'.

No, we have only 1 "character property": the second one you mention.
The first one lives in function names and is called "char-property".
This is unfortunate (and has bad mnemonic value, IMO), but that's
water under the bridge, because these APIs existed long before Emacs
started supporting Unicode.

> Is "character code property" accurate?

No.  There's no property to the "code" of the character.  The addition
of "code" was a kludge, to work around the fact that char-property was
already taken.

But please don't confuse API names and terminology.  They don't need
to be 100% the same.  It's good if they are, but it's not a
catastrophe if they aren't.

Just stop talking about character properties in the first sense in
human-readable text, such as doc strings.  The manual doesn't use
"char property" anywhere.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-11 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 17:18 char properties vs char properties: two different meanings Drew Adams
2013-09-11 19:31 ` Eli Zaretskii

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).