all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#3568: 23.0.94; no doc for character composition
@ 2009-06-14 23:17 Drew Adams
  2016-04-27 19:23 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2009-06-14 23:17 UTC (permalink / raw)
  To: emacs-pretest-bug

I can find no doc at all regarding character composition, beyond the
cursory explanation given in the Emacs manual, node Input Methods.
 
In particular, there is nothing in the Elisp manual about it. No
documentation of functions such as `compose-region' and
`compose-chars'.
 
And there is no usage commentary in `composite.el'.
 
How does one compose characters using Emacs Lisp? If characters have
been composed, how do you decompose them? Are there any caveats to be
aware of? Users will have such questions.
 
For example, this snippet is commonly used here and there to display the word
`lambda' as the Greek character:
 
(font-lock-add-keywords
   mode `(("\\<lambda\\>"
   (0 (progn (compose-region (match-beginning 0) (match-end 0)
        ,(make-char 'greek-iso8859-7 107))
      nil)))))
 
But removing that keyword entry from font-lock-keywords, unfontifying, then
refontifying is not sufficient to display `lambda' as a word again. What needs
to be done, to restore the normal display of the word `lambda'?  This kind of
information is missing.
 
Perusing `composite.el', I see that this will do the job:
 
(font-lock-remove-keywords
     nil `(("\\<lambda\\>"
            (0 (progn (compose-region (match-beginning 0) (match-end 0)
                                      ,(make-char 'greek-iso8859-7 107))
                      nil)))))
(save-excursion
   (goto-char (point-min))
   (while (re-search-forward "\\<lambda\\>" nil t)
     (decompose-region (match-beginning 0) (match-end 0))))
 
But it would be helpful to have a little doc in the Elisp manual
explaining how to use character composition. This feature deserves some doc. 

Compare, for example, the doc for font-locking with that for character
composition. Even if these features are not of the same scale, you can see a
qualitative difference in the doc support.

Look at the commentary in file font-lock.el - a section explaining clearly "How
Font Lock mode fontifies", and another section explaining "What is fontification
for?". Plenty of Info doc, in both the Emacs and Elisp manuals.

Character composition should be better documented. I can understand if the
author is not comfortable providing lots of English doc, but someone who
understands character composition should do so. Think in terms of how Emacs
users and Emacs-Lisp users might make use of this feature, then write that up
for those of us who are ignorant.

Thanks.
 
In GNU Emacs 23.0.94.1 (i386-mingw-nt5.1.2600)
 of 2009-05-24 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
 






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

end of thread, other threads:[~2016-04-28  5:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-14 23:17 bug#3568: 23.0.94; no doc for character composition Drew Adams
2016-04-27 19:23 ` Lars Ingebrigtsen
2016-04-27 19:42   ` Drew Adams
2016-04-27 20:11     ` Eli Zaretskii
     [not found]   ` <<623906f5-d8d6-416b-b435-7f3b0f44944a@default>
     [not found]     ` <<83mvoeyfpx.fsf@gnu.org>
2016-04-27 21:18       ` Drew Adams
2016-04-28  5:07         ` Eli Zaretskii

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.