From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: variable or function for list of known text properties? Date: Sun, 1 Apr 2007 16:10:30 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1175469084 7291 80.91.229.12 (1 Apr 2007 23:11:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Apr 2007 23:11:24 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 02 01:11:21 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HY9Ci-00042i-HY for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2007 01:11:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HY9Fg-0004Q1-7B for ged-emacs-devel@m.gmane.org; Sun, 01 Apr 2007 19:14:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HY9Fd-0004Pg-0H for emacs-devel@gnu.org; Sun, 01 Apr 2007 19:14:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HY9Fb-0004PS-9v for emacs-devel@gnu.org; Sun, 01 Apr 2007 19:14:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HY9Fb-0004PP-64 for emacs-devel@gnu.org; Sun, 01 Apr 2007 19:14:19 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HY9Cc-00068S-IJ for emacs-devel@gnu.org; Sun, 01 Apr 2007 19:11:14 -0400 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l31NBCr5025169 for ; Sun, 1 Apr 2007 17:11:12 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l31MisXb016702 for ; Sun, 1 Apr 2007 17:11:11 -0600 Original-Received: from dhcp-amer-whq-csvpn-gw3-141-144-81-196.vpn.oracle.com by acsmt351.oracle.com with ESMTP id 2579145801175469037; Sun, 01 Apr 2007 16:10:37 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68912 Archived-At: 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