all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* variable or function for list of known text properties?
@ 2007-04-01 23:10 Drew Adams
  2007-04-02 12:29 ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2007-04-01 23:10 UTC (permalink / raw)
  To: Emacs-Devel

Elisp manual node `Special Properties' lists text properties that "have
special built-in meanings", that is, text properties that are predefined.
Subsequent nodes `Format Properties' and `Links and Mouse-1' list a few more
such predefined text properties.

An Elisp function might want to use a list of such known text properties in
some way (e.g. as TABLE arg to `completing-read' or in a defcustom :type
expression). The list of predefined properties depends on the Emacs release
used.

Going forward, it might be useful to have a variable that holds a list of
such known text properties, or a function that would return such a list.
Then, code that makes use of this list could be release-independent
(starting with the release that provided the var or fn). This list could be
useful even if it is not exhaustive.

Better yet, how about having a macro that defines a new text property,
making it known as such - e.g. `define-text-property'? Then, the var or fn
suggested above would include newly defined properties.

FWIW, below is a list of text properties that I dug out of the Emacs Lisp
code. I don't claim it is exhaustive.

One thing that I see is that the Elisp manual documents some properties,
such as `fontified', that are used only in certain contexts (e.g. jit-lock),
but there are lots of other text properties that are used only in certain
contexts or modes and that are not documented in the manual (e.g.
`kbd-help'). What are the criteria for deciding whether a property (e.g.
`fontified' or `kbd-help') should be mentioned in the manual? I don't claim
that more properties should be documented, but I wonder how the choice is
made.

Another thing I notice is that some text properties that I suspect might
have different interpretations and uses in different libraries have the same
name - `comment', `buffer', `duplicable', `message', and `tags', for
instance. There is no problem, a priori, with the same name being reused for
something different in a different context, but there might be some risk of
interference.

Perhaps we might think about ways to deal with this potential problem (or
perhaps not, if it's not a real problem in practice) - a naming convention,
for example. And if we did have a list of known/defined text properties,
then code could check for membership before defining a new one. Of course,
even when the same property is used purposefully there is a risk of
interference (e.g. values). We might consider a defcustom-like definition
for `define-text-property' that would define not only a property name but
also its allowed values. (Of course, if we had namespaces...)

(After the release...)


----8<------------existing text properties-----------------

Text properties listed in the Elisp manual:
category face font-lock-face mouse-face fontified display
help-echo keymap local-map syntax-table read-only invisible
intangible field cursor pointer line-spacing line-height
modification-hooks insert-in-front-hooks insert-behind-hooks
point-entered point-left hard right-margin left-margin
justification follow-link

The rest of the properties listed here are not in the manual.

in directory lisp:
allout-was-hidden ansi-color buffer buffer-name column
button skip literal front-sticky rear-nonsticky composition
untranslated-utf-8 yank-handler dired-filename
read-face-name directory message debug font-lock-multiline
unknown insert-in-front-hooks kbd-help hilit-chg
ibuffer-filter-group-name ibuffer-properties ibuffer-title
ibuffer-summary ibuffer-title-header
inhibit-line-move-field-capture image-counter header-line
cvs-goal-column occur-target occur-match foreign-selection
before-string after-string ses smerge-force-highlighting
speedbar-function speedbar-token speedbar-text type
stroke-glyph data thumb-image-file original-file-name
associated-dired-buffer tags comment tumme-thumbnail
tutorial-remark vc-cvs-annotate-time end-name old-name
end-link old-link end-perm old-perm perm-changed widget-doc
secret real-field

in directory lisp/emacs-lisp:
elp-symname printed-value duplicable

in directory lisp/emulation: cursor

in directory lisp/erc:
erc-callback erc-data erc-identified erc-parsed erc-parsed
timestamp erc-prompt

in directory lisp/eshell:
comment arg-begin arg-end escaped history number test-func

in directory lisp/gnus:
earcon-data earcon-callback gnus-category gnus-part
article-type gnus-decoration dummy-invisible original-date
gnus-data gnus-callback gnus-prev gnus-next
gnus-mime-details gnus-line-format gnus-backlog
gnus-image-category gnus-image-text-deletable gnus-group
gnus-level gnus-indentation gnus-unread gnus-number articles
gnus-server gnus-named-server gnus-intangible gnus-topic
gnus-topic-level gnus-topic-unread gnus-topic-visible
gnus-active gnus-position gnus-time gnus-face
gnus-undeletable message-rank egg-end egg-lang egg-start
message-hidden message-deletable buffer from mm duplicable
script-name

in directory lisp/international:
kkc-conversion-index advice untranslated-utf-8 composition

in directory lisp/mail:
footnote-number rmail-fontified

in directory lisp/mh-e:
mh-data mh-mime-inserted mh-part mh-region mh-callback
mh-button-pressed mh-line-format mh-folder mh-children-p
mh-expanded mh-level mh-count

in directory lisp/net:
feed w3m-image nt-age nt-title nt-guid nt-desc
org-invisible nt-link nt-type nt-face

in directory lisp/progmodes:
c-type c-awk-NL-prop c-is-sws c-decl-arg-start c-decl-end
c-decl-id-start c-decl-type-start message REx-interpolated
in-pod here-doc-group syntax-type indentable REx-part2
first-format-line attrib-group cperl-postpone cpp-data
cpp-callback token ebrowse-tree ebrowse-member ebrowse-what
gdb-enabled gdb-bptno gdb-max-frames link fetch begin-glyph
begin-glyph-layout idlwave-class data source keyword find-args

in directory lisp/term: mac-ts-active-input-string

in directory lisp/textmodes:
fill-space priority test end-glyph begin-glyph org-cwidth
org-dwidth org-dwidth-n org-linked-text :org-clock-minutes
org-protected org-date-line org-today day org-agenda-type
time-of-day org-not-done-regexp prefix-length tags
org-marker org-agenda-diary-link org-hd-marker dotime
org-category undone-face done-face xr-alist table-cell
text-clones

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

end of thread, other threads:[~2007-04-03 21:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-01 23:10 variable or function for list of known text properties? Drew Adams
2007-04-02 12:29 ` Richard Stallman
2007-04-02 22:33   ` Drew Adams
2007-04-02 22:49     ` Drew Adams
2007-04-03 21:40     ` Richard Stallman

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.