diff options
| author | Chong Yidong | 2011-08-30 11:24:07 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-08-30 11:24:07 -0400 |
| commit | 35137ed3a511d8e27e8fb07f506f55d76e2f6e0f (patch) | |
| tree | 6effa072cc53f6459b45879d8a03930821d519a9 | |
| parent | b1a4f8e1d8df32b582a21fa4110b0a99eba19715 (diff) | |
| download | emacs-35137ed3a511d8e27e8fb07f506f55d76e2f6e0f.tar.gz emacs-35137ed3a511d8e27e8fb07f506f55d76e2f6e0f.zip | |
Document new Emacs 24 faces in Lisp manual.
* doc/lispref/display.texi (Basic Faces): New node. Document new faces.
* doc/lispref/modes.texi (Major Mode Conventions): Move some text there.
(Mode Help): Remove major-mode var, duplicated in Major Modes.
| -rw-r--r-- | doc/lispref/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 59 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 41 | ||||
| -rw-r--r-- | doc/lispref/vol1.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/vol2.texi | 1 | ||||
| -rw-r--r-- | etc/NEWS | 1 |
7 files changed, 75 insertions, 36 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 57dde5ac4cb..37689c16e59 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-08-30 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * display.texi (Basic Faces): New node. Document new faces. | ||
| 4 | |||
| 5 | * modes.texi (Major Mode Conventions): Move some text there. | ||
| 6 | (Mode Help): Remove major-mode var, duplicated in Major Modes. | ||
| 7 | |||
| 1 | 2011-08-29 Chong Yidong <cyd@stupidchicken.com> | 8 | 2011-08-29 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 9 | ||
| 3 | * modes.texi (Basic Major Modes): New node. Callers updated. | 10 | * modes.texi (Basic Major Modes): New node. Callers updated. |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index cfe4b8298fb..68291319ef1 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -1833,9 +1833,10 @@ particular face name a special meaning in one frame if you wish. | |||
| 1833 | * Face Attributes:: What is in a face? | 1833 | * Face Attributes:: What is in a face? |
| 1834 | * Attribute Functions:: Functions to examine and set face attributes. | 1834 | * Attribute Functions:: Functions to examine and set face attributes. |
| 1835 | * Displaying Faces:: How Emacs combines the faces specified for a character. | 1835 | * Displaying Faces:: How Emacs combines the faces specified for a character. |
| 1836 | * Face Remapping:: Remapping faces to alternative definitions. | 1836 | * Face Remapping:: Remapping faces to alternative definitions. |
| 1837 | * Face Functions:: How to define and examine faces. | 1837 | * Face Functions:: How to define and examine faces. |
| 1838 | * Auto Faces:: Hook for automatic face assignment. | 1838 | * Auto Faces:: Hook for automatic face assignment. |
| 1839 | * Basic Faces:: Faces that are defined by default. | ||
| 1839 | * Font Selection:: Finding the best available font for a face. | 1840 | * Font Selection:: Finding the best available font for a face. |
| 1840 | * Font Lookup:: Looking up the names of available fonts | 1841 | * Font Lookup:: Looking up the names of available fonts |
| 1841 | and information about them. | 1842 | and information about them. |
| @@ -2687,6 +2688,62 @@ For efficiency, we recommend writing these functions so that they | |||
| 2687 | usually assign faces to around 400 to 600 characters at each call. | 2688 | usually assign faces to around 400 to 600 characters at each call. |
| 2688 | @end defvar | 2689 | @end defvar |
| 2689 | 2690 | ||
| 2691 | @node Basic Faces | ||
| 2692 | @subsection Basic Faces | ||
| 2693 | |||
| 2694 | If your Emacs Lisp program needs to assign some faces to text, it is | ||
| 2695 | often a good idea to use certain existing faces or inherit from them, | ||
| 2696 | rather than defining entirely new faces. This way, if other users | ||
| 2697 | have customized the basic faces to give Emacs a certain look, your | ||
| 2698 | program will ``fit in'' without additional customization. | ||
| 2699 | |||
| 2700 | Some of the basic faces defined in Emacs are listed below. In | ||
| 2701 | addition to these, you might want to make use of the Font Lock faces | ||
| 2702 | for syntactic highlighting, if highlighting is not already handled by | ||
| 2703 | Font Lock mode, or if some Font Lock faces are not in use. | ||
| 2704 | @xref{Faces for Font Lock}. | ||
| 2705 | |||
| 2706 | @table @code | ||
| 2707 | @item default | ||
| 2708 | The default face, whose attributes are all specified. All other faces | ||
| 2709 | implicitly inherit from it: any unspecified attribute defaults to the | ||
| 2710 | attribute on this face (@pxref{Face Attributes}). | ||
| 2711 | |||
| 2712 | @item bold | ||
| 2713 | @itemx italic | ||
| 2714 | @itemx bold-italic | ||
| 2715 | @itemx underline | ||
| 2716 | @itemx fixed-pitch | ||
| 2717 | @itemx variable-pitch | ||
| 2718 | These have the attributes indicated by their names (e.g. @code{bold} | ||
| 2719 | has a bold @code{:weight} attribute), with all other attributes | ||
| 2720 | unspecified (and so given by @code{default}). | ||
| 2721 | |||
| 2722 | @item shadow | ||
| 2723 | For ``dimmed out'' text. For example, it is used for the ignored | ||
| 2724 | part of a filename in the minibuffer (@pxref{Minibuffer File,, | ||
| 2725 | Minibuffers for File Names, emacs, The GNU Emacs Manual}). | ||
| 2726 | |||
| 2727 | @item link | ||
| 2728 | @itemx link-visited | ||
| 2729 | For clickable text buttons that send the user to a different | ||
| 2730 | buffer or ``location''. | ||
| 2731 | |||
| 2732 | @item highlight | ||
| 2733 | For stretches of text that should temporarily stand out. For example, | ||
| 2734 | it is commonly assigned to the @code{mouse-face} property for cursor | ||
| 2735 | highlighting (@pxref{Special Properties}). | ||
| 2736 | |||
| 2737 | @item match | ||
| 2738 | For text matching a search command. | ||
| 2739 | |||
| 2740 | @item error | ||
| 2741 | @itemx warning | ||
| 2742 | @itemx success | ||
| 2743 | For text concerning errors, warnings, or successes. For example, | ||
| 2744 | these are used for messages in @samp{*Compilation*} buffers. | ||
| 2745 | @end table | ||
| 2746 | |||
| 2690 | @node Font Selection | 2747 | @node Font Selection |
| 2691 | @subsection Font Selection | 2748 | @subsection Font Selection |
| 2692 | 2749 | ||
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index a19af903027..bcf6d3318ef 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -1308,6 +1308,7 @@ Faces | |||
| 1308 | * Face Remapping:: Remapping faces to alternative definitions. | 1308 | * Face Remapping:: Remapping faces to alternative definitions. |
| 1309 | * Face Functions:: How to define and examine faces. | 1309 | * Face Functions:: How to define and examine faces. |
| 1310 | * Auto Faces:: Hook for automatic face assignment. | 1310 | * Auto Faces:: Hook for automatic face assignment. |
| 1311 | * Basic Faces:: Faces that are defined by default. | ||
| 1311 | * Font Selection:: Finding the best available font for a face. | 1312 | * Font Selection:: Finding the best available font for a face. |
| 1312 | * Font Lookup:: Looking up the names of available fonts | 1313 | * Font Lookup:: Looking up the names of available fonts |
| 1313 | and information about them. | 1314 | and information about them. |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 586fc0bbbfb..eb81ebc4acb 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -225,9 +225,9 @@ several major modes, in files such as @file{text-mode.el}, | |||
| 225 | study these libraries to see how modes are written. | 225 | study these libraries to see how modes are written. |
| 226 | 226 | ||
| 227 | @defopt major-mode | 227 | @defopt major-mode |
| 228 | The buffer-local value of this variable is a symbol naming the buffer's | 228 | The buffer-local value of this variable holds the symbol for the current |
| 229 | current major mode. Its default value holds the default major mode for | 229 | major mode. Its default value holds the default major mode for new |
| 230 | new buffers. The standard default value is @code{fundamental-mode}. | 230 | buffers. The standard default value is @code{fundamental-mode}. |
| 231 | 231 | ||
| 232 | If the default value is @code{nil}, then whenever Emacs creates a new | 232 | If the default value is @code{nil}, then whenever Emacs creates a new |
| 233 | buffer via a command such as @kbd{C-x b} (@code{switch-to-buffer}), the | 233 | buffer via a command such as @kbd{C-x b} (@code{switch-to-buffer}), the |
| @@ -403,28 +403,7 @@ setting up a buffer-local value for the variable | |||
| 403 | 403 | ||
| 404 | @item | 404 | @item |
| 405 | Each face that the mode defines should, if possible, inherit from an | 405 | Each face that the mode defines should, if possible, inherit from an |
| 406 | existing Emacs face. This reduces the chance of conflicting with a | 406 | existing Emacs face. @xref{Basic Faces}, and @ref{Faces for Font Lock}. |
| 407 | user's face customizations. Useful faces include: | ||
| 408 | |||
| 409 | @table @asis | ||
| 410 | @item @code{highlight} | ||
| 411 | for stretches of text that should temporarily stand out. | ||
| 412 | |||
| 413 | @item @code{match} | ||
| 414 | for text matching a search command. | ||
| 415 | |||
| 416 | @item @code{link} and @code{link-visited} | ||
| 417 | for clickable text buttons that send the user to a different buffer or | ||
| 418 | ``location''. | ||
| 419 | |||
| 420 | @item @code{button} | ||
| 421 | for clickable text buttons that perform other actions. | ||
| 422 | |||
| 423 | @item @asis{Font Lock faces} | ||
| 424 | for other kinds of syntactic highlighting, if highlighting is not | ||
| 425 | handled by Font Lock mode or some Font Lock faces are not in use. | ||
| 426 | @xref{Faces for Font Lock}, for how to assign Font Lock faces. | ||
| 427 | @end table | ||
| 428 | 407 | ||
| 429 | @item | 408 | @item |
| 430 | The mode should specify how Imenu should find the definitions or | 409 | The mode should specify how Imenu should find the definitions or |
| @@ -702,8 +681,8 @@ init file.) | |||
| 702 | 681 | ||
| 703 | The @code{describe-mode} function is provides information about major | 682 | The @code{describe-mode} function is provides information about major |
| 704 | modes. It is normally bound to @kbd{C-h m}. It uses the value of the | 683 | modes. It is normally bound to @kbd{C-h m}. It uses the value of the |
| 705 | variable @code{major-mode} (which is why every major mode command needs | 684 | variable @code{major-mode} (@pxref{Major Modes}), which is why every |
| 706 | to set this variable). | 685 | major mode command needs to set that variable. |
| 707 | 686 | ||
| 708 | @deffn Command describe-mode | 687 | @deffn Command describe-mode |
| 709 | This function displays the documentation of the current major mode. | 688 | This function displays the documentation of the current major mode. |
| @@ -714,14 +693,6 @@ displays the documentation string of the major mode command. | |||
| 714 | (@xref{Accessing Documentation}.) | 693 | (@xref{Accessing Documentation}.) |
| 715 | @end deffn | 694 | @end deffn |
| 716 | 695 | ||
| 717 | @defvar major-mode | ||
| 718 | This buffer-local variable holds the symbol for the current buffer's | ||
| 719 | major mode. This symbol should have a function definition that is the | ||
| 720 | command to switch to that major mode. The @code{describe-mode} | ||
| 721 | function uses the documentation string of the function as the | ||
| 722 | documentation of the major mode. | ||
| 723 | @end defvar | ||
| 724 | |||
| 725 | @node Derived Modes | 696 | @node Derived Modes |
| 726 | @subsection Defining Derived Modes | 697 | @subsection Defining Derived Modes |
| 727 | @cindex derived mode | 698 | @cindex derived mode |
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi index c192e3bf4b7..1275628cc94 100644 --- a/doc/lispref/vol1.texi +++ b/doc/lispref/vol1.texi | |||
| @@ -1329,6 +1329,7 @@ Faces | |||
| 1329 | * Face Remapping:: Remapping faces to alternative definitions. | 1329 | * Face Remapping:: Remapping faces to alternative definitions. |
| 1330 | * Face Functions:: How to define and examine faces. | 1330 | * Face Functions:: How to define and examine faces. |
| 1331 | * Auto Faces:: Hook for automatic face assignment. | 1331 | * Auto Faces:: Hook for automatic face assignment. |
| 1332 | * Basic Faces:: Faces that are defined by default. | ||
| 1332 | * Font Selection:: Finding the best available font for a face. | 1333 | * Font Selection:: Finding the best available font for a face. |
| 1333 | * Font Lookup:: Looking up the names of available fonts | 1334 | * Font Lookup:: Looking up the names of available fonts |
| 1334 | and information about them. | 1335 | and information about them. |
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi index 8e78a5fb5ca..3d849fa2dcf 100644 --- a/doc/lispref/vol2.texi +++ b/doc/lispref/vol2.texi | |||
| @@ -1328,6 +1328,7 @@ Faces | |||
| 1328 | * Face Remapping:: Remapping faces to alternative definitions. | 1328 | * Face Remapping:: Remapping faces to alternative definitions. |
| 1329 | * Face Functions:: How to define and examine faces. | 1329 | * Face Functions:: How to define and examine faces. |
| 1330 | * Auto Faces:: Hook for automatic face assignment. | 1330 | * Auto Faces:: Hook for automatic face assignment. |
| 1331 | * Basic Faces:: Faces that are defined by default. | ||
| 1331 | * Font Selection:: Finding the best available font for a face. | 1332 | * Font Selection:: Finding the best available font for a face. |
| 1332 | * Font Lookup:: Looking up the names of available fonts | 1333 | * Font Lookup:: Looking up the names of available fonts |
| 1333 | and information about them. | 1334 | and information about them. |
| @@ -239,6 +239,7 @@ theme when Emacs is built with GTK. | |||
| 239 | *** Emacs uses GTK tooltips by default if built with GTK. You can turn that | 239 | *** Emacs uses GTK tooltips by default if built with GTK. You can turn that |
| 240 | off by customizing x-gtk-use-system-tooltips. | 240 | off by customizing x-gtk-use-system-tooltips. |
| 241 | 241 | ||
| 242 | +++ | ||
| 242 | ** New basic faces `error', `warning', `success' are available to | 243 | ** New basic faces `error', `warning', `success' are available to |
| 243 | highlight strings that indicate failure, caution or successful operation. | 244 | highlight strings that indicate failure, caution or successful operation. |
| 244 | 245 | ||