diff options
| author | Chong Yidong | 2011-10-17 21:42:28 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-10-17 21:42:28 -0400 |
| commit | d366bd532dcd13baa89962e9ab7443cb4dd76772 (patch) | |
| tree | 2fc24b1765222230cd2c3ad796a981002d011deb | |
| parent | aa22bff2be02d0b3f1264276afc04e47d53cd421 (diff) | |
| download | emacs-d366bd532dcd13baa89962e9ab7443cb4dd76772.tar.gz emacs-d366bd532dcd13baa89962e9ab7443cb4dd76772.zip | |
Edits to Display chapter of Emacs manual.
* doc/emacs/display.texi (Faces): Simplify discussion. Move documentation
of list-faces-display here, from Standard Faces node. Note
special role of `default' background.
(Standard Faces): Note special role of `default' background. Note
that region face may be taken fom GTK. Add xref to Text Display.
(Text Scale): Rename from "Temporary Face Changes". Callers
changed. Don't bother documenting variable-pitch-mode.
(Font Lock): Copyedits. Remove font-lock-maximum-size.
(Useless Whitespace): Simplify description of
delete-trailing-whitespace. Note active region case.
(Text Display): Fix description of escape-glyph face assignment.
Remove unibye mode discussion. Update some parts for Unicode.
Move glyphless chars documentation to Lisp manual.
* doc/emacs/frames.texi (Tooltips): Document x-gtk-use-system-tooltips.
* doc/lispref/display.texi (Glyphless Chars): New node.
| -rw-r--r-- | doc/emacs/ChangeLog | 18 | ||||
| -rw-r--r-- | doc/emacs/basic.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/display.texi | 493 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/frames.texi | 9 | ||||
| -rw-r--r-- | doc/emacs/macos.texi | 12 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 94 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/vol1.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/vol2.texi | 3 | ||||
| -rw-r--r-- | etc/NEWS | 7 |
12 files changed, 359 insertions, 291 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index a39b703b4dd..5f7f63fca31 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2011-10-18 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * display.texi (Faces): Simplify discussion. Move documentation | ||
| 4 | of list-faces-display here, from Standard Faces node. Note | ||
| 5 | special role of `default' background. | ||
| 6 | (Standard Faces): Note special role of `default' background. Note | ||
| 7 | that region face may be taken fom GTK. Add xref to Text Display. | ||
| 8 | (Text Scale): Rename from "Temporary Face Changes". Callers | ||
| 9 | changed. Don't bother documenting variable-pitch-mode. | ||
| 10 | (Font Lock): Copyedits. Remove font-lock-maximum-size. | ||
| 11 | (Useless Whitespace): Simplify description of | ||
| 12 | delete-trailing-whitespace. Note active region case. | ||
| 13 | (Text Display): Fix description of escape-glyph face assignment. | ||
| 14 | Remove unibye mode discussion. Update some parts for Unicode. | ||
| 15 | Move glyphless chars documentation to Lisp manual. | ||
| 16 | |||
| 17 | * frames.texi (Tooltips): Document x-gtk-use-system-tooltips. | ||
| 18 | |||
| 1 | 2011-10-15 Chong Yidong <cyd@stupidchicken.com> | 19 | 2011-10-15 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 20 | ||
| 3 | * display.texi (Scrolling): Tweak explanation of scroll direction. | 21 | * display.texi (Scrolling): Tweak explanation of scroll direction. |
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index e4e7dadd548..714e03720bc 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi | |||
| @@ -109,7 +109,7 @@ command provides completion (@pxref{Completion}). If you enter a | |||
| 109 | code-point, it should be a hexadecimal number (which is the convention | 109 | code-point, it should be a hexadecimal number (which is the convention |
| 110 | for Unicode). The command then inserts the corresponding character | 110 | for Unicode). The command then inserts the corresponding character |
| 111 | into the buffer. For example, both of the following insert the | 111 | into the buffer. For example, both of the following insert the |
| 112 | infinity sign (Unicode code-point @code{#x221E}): | 112 | infinity sign (Unicode code-point @code{U+221E}): |
| 113 | 113 | ||
| 114 | @example | 114 | @example |
| 115 | @kbd{C-x 8 @key{RET} infinity @key{RET}} | 115 | @kbd{C-x 8 @key{RET} infinity @key{RET}} |
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index d2f49c62e4a..68b2209ffba 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -21,7 +21,7 @@ the text is displayed. | |||
| 21 | * Follow Mode:: Follow mode lets two windows scroll as one. | 21 | * Follow Mode:: Follow mode lets two windows scroll as one. |
| 22 | * Faces:: How to change the display style using faces. | 22 | * Faces:: How to change the display style using faces. |
| 23 | * Standard Faces:: Emacs' predefined faces. | 23 | * Standard Faces:: Emacs' predefined faces. |
| 24 | * Temporary Face Changes:: Commands to temporarily modify the default text face | 24 | * Text Scale:: Increasing or decreasing text size in a buffer. |
| 25 | * Font Lock:: Minor mode for syntactic highlighting using faces. | 25 | * Font Lock:: Minor mode for syntactic highlighting using faces. |
| 26 | * Highlight Interactively:: Tell Emacs what text to highlight. | 26 | * Highlight Interactively:: Tell Emacs what text to highlight. |
| 27 | * Fringes:: Enabling or disabling window fringes. | 27 | * Fringes:: Enabling or disabling window fringes. |
| @@ -55,7 +55,7 @@ direction that the window moves relative to the text; this terminology | |||
| 55 | was taken up by Emacs before the modern meaning of ``scrolling up'' | 55 | was taken up by Emacs before the modern meaning of ``scrolling up'' |
| 56 | and ``scrolling down'' became widely adopted. Hence the strange | 56 | and ``scrolling down'' became widely adopted. Hence the strange |
| 57 | result that @key{PageDown} scrolls ``up'' in the Emacs sense. In this | 57 | result that @key{PageDown} scrolls ``up'' in the Emacs sense. In this |
| 58 | manual, we refer to scrolling ``foward'' and ``backward'' where | 58 | manual, we refer to scrolling ``forward'' and ``backward'' where |
| 59 | possible, in order to minimize confusion. | 59 | possible, in order to minimize confusion. |
| 60 | 60 | ||
| 61 | The portion of a buffer displayed in a window always contains point. | 61 | The portion of a buffer displayed in a window always contains point. |
| @@ -439,76 +439,69 @@ one large window. | |||
| 439 | @section Faces: Controlling Text Display Style | 439 | @section Faces: Controlling Text Display Style |
| 440 | @cindex faces | 440 | @cindex faces |
| 441 | 441 | ||
| 442 | Emacs can display text in several different styles, which are called | 442 | Emacs can display text in several different styles, called |
| 443 | @dfn{faces}. Each face can specify various @dfn{face attributes}, | 443 | @dfn{faces}. Each face can specify various @dfn{face attributes}, |
| 444 | such as the font, height, weight and slant, the foreground and | 444 | such as the font, height, weight, slant, foreground and background |
| 445 | background color, and underlining or overlining. A face does not have | 445 | color, and underlining or overlining. Most major modes assign faces |
| 446 | to specify all of these attributes; often it inherits most of them | 446 | to the text automatically, via Font Lock mode. @xref{Font Lock}, for |
| 447 | from another face. | 447 | more information about how these faces are assigned. |
| 448 | 448 | ||
| 449 | On a text-only terminal, not all face attributes are meaningful. | 449 | @findex list-faces-display |
| 450 | Some text-only terminals support inverse video, bold, and underline | 450 | To see what faces are currently defined, and what they look like, |
| 451 | attributes; some support colors. Text-only terminals generally do not | 451 | type @kbd{M-x list-faces-display}. With a prefix argument, this |
| 452 | support changing the height, width or font. | 452 | prompts for a regular expression, and displays only faces with names |
| 453 | 453 | matching that regular expression (@pxref{Regexps}). | |
| 454 | Most major modes assign faces to the text automatically through the | 454 | |
| 455 | work of Font Lock mode. @xref{Font Lock}, for more information about | 455 | It's possible for a given face to look different in different |
| 456 | Font Lock mode and syntactic highlighting. You can print the current | 456 | frames. For instance, some text-only terminals do not support all |
| 457 | buffer with the highlighting that appears on your screen using the | 457 | face attributes, particularly font, height, and width, and some |
| 458 | command @code{ps-print-buffer-with-faces}. @xref{PostScript}. | 458 | support a limited range of colors. The @code{list-faces-display} |
| 459 | 459 | command shows the appearance for the selected frame. | |
| 460 | Enriched mode, the mode for editing formatted text, provides | ||
| 461 | commands and menus for specifying faces for text in the buffer. | ||
| 462 | @xref{Format Faces}. | ||
| 463 | 460 | ||
| 464 | @cindex face colors, setting | 461 | @cindex face colors, setting |
| 465 | To alter the appearance of a face, use the customization buffer. | 462 | @cindex background color |
| 466 | @xref{Face Customization}. You can also use X resources to specify | 463 | @cindex default face |
| 467 | attributes of any particular face (@pxref{Resources}). When | 464 | You can customize a face to alter its appearance, and save those |
| 468 | displaying a character, any attribute that isn't specified by its face | 465 | changes for future Emacs sessions. @xref{Face Customization}. A face |
| 469 | is taken from the @code{default} face, whose attributes reflect the | 466 | does not have to specify every single attribute; often it inherits |
| 470 | default settings of the frame itself. | 467 | most attributes from another face. Any ultimately unspecified |
| 468 | attribute is taken from a face named @code{default}, whose attributes | ||
| 469 | are all specified. The @code{default} face is the default for | ||
| 470 | displaying text, and its background color is also used as the frame's | ||
| 471 | background color. | ||
| 472 | |||
| 473 | You can also use X resources to specify attributes of any particular | ||
| 474 | face. @xref{Resources}. | ||
| 471 | 475 | ||
| 472 | @findex set-face-foreground | 476 | @findex set-face-foreground |
| 473 | @findex set-face-background | 477 | @findex set-face-background |
| 474 | You can also change the foreground and background colors of a | 478 | You can also change the foreground and background colors of a face |
| 475 | specific face with @kbd{M-x set-face-foreground} and @kbd{M-x | 479 | with @kbd{M-x set-face-foreground} and @kbd{M-x set-face-background}. |
| 476 | set-face-background}. These commands prompt in the minibuffer for a | 480 | These commands prompt in the minibuffer for a face name and a color |
| 477 | face name and a color name, with completion, and then set that face to | 481 | name, with completion, and then set that face to use the specified |
| 478 | use the specified color. @xref{Face Customization}, for information | 482 | color (@pxref{Face Customization}, for information about color names). |
| 479 | about color names. These commands affect the face colors on all | 483 | They affect the face colors on all frames, but their effects do not |
| 480 | frames, both existing and those to be created in the future. These | 484 | persist for future Emacs sessions, unlike using the customization |
| 481 | changes do not, however, persist for future Emacs sessions; to make | 485 | buffer or X resources. You can also use frame parameters to set |
| 482 | lasting changes, use the customization buffer (@pxref{Face | 486 | foreground and background colors for a specific frame; see @ref{Frame |
| 483 | Customization}). | 487 | Parameters}. |
| 484 | 488 | ||
| 485 | You can also set foreground and background colors for the current | 489 | Emacs can display variable-width fonts, but some Emacs commands, |
| 486 | frame only; see @ref{Frame Parameters}. | 490 | particularly indentation commands, do not account for variable |
| 487 | 491 | character display widths. Therefore, we recommend not using | |
| 488 | Emacs can display variable-width fonts, but some of the Emacs | 492 | variable-width fonts for most faces, particularly those assigned by |
| 489 | commands that calculate width and indentation do not know how to | 493 | Font Lock mode. |
| 490 | calculate variable widths. This can sometimes lead to incorrect | ||
| 491 | results when you use variable-width fonts. In particular, indentation | ||
| 492 | commands can give inconsistent results, so we recommend you avoid | ||
| 493 | variable-width fonts, especially for editing program source code. | ||
| 494 | 494 | ||
| 495 | @node Standard Faces | 495 | @node Standard Faces |
| 496 | @section Standard Faces | 496 | @section Standard Faces |
| 497 | 497 | ||
| 498 | @findex list-faces-display | ||
| 499 | To see what faces are currently defined, and what they look like, | ||
| 500 | type @kbd{M-x list-faces-display}. It's possible for a given face to | ||
| 501 | look different in different frames; this command shows the appearance | ||
| 502 | in the frame in which you type it. With a prefix argument, this | ||
| 503 | prompts for a regular expression, and displays only faces with names | ||
| 504 | matching that regular expression. | ||
| 505 | |||
| 506 | Here are the standard faces for specifying text appearance. You can | 498 | Here are the standard faces for specifying text appearance. You can |
| 507 | apply them to specific text when you want the effects they produce. | 499 | apply them to specific text when you want the effects they produce. |
| 508 | 500 | ||
| 509 | @table @code | 501 | @table @code |
| 510 | @item default | 502 | @item default |
| 511 | This face is used for ordinary text that doesn't specify any face. | 503 | This face is used for ordinary text that doesn't specify any face. |
| 504 | Its background color is used as the frame's background color. | ||
| 512 | @item bold | 505 | @item bold |
| 513 | This face uses a bold variant of the default font. | 506 | This face uses a bold variant of the default font. |
| 514 | @item italic | 507 | @item italic |
| @@ -535,37 +528,38 @@ their own faces for this purpose.) | |||
| 535 | 528 | ||
| 536 | @table @code | 529 | @table @code |
| 537 | @item highlight | 530 | @item highlight |
| 538 | This face is used for highlighting portions of text, in various modes. | 531 | This face is used for text highlighting in various contexts, such as |
| 539 | For example, mouse-sensitive text is highlighted using this face. | 532 | when the mouse cursor is moved over a hyperlink. |
| 540 | @item isearch | 533 | @item isearch |
| 541 | This face is used for highlighting the current Isearch match | 534 | This face is used to highlight the current Isearch match |
| 542 | (@pxref{Incremental Search}). | 535 | (@pxref{Incremental Search}). |
| 543 | @item query-replace | 536 | @item query-replace |
| 544 | This face is used for highlighting the current Query Replace match | 537 | This face is used to highlight the current Query Replace match |
| 545 | (@pxref{Replace}). | 538 | (@pxref{Replace}). |
| 546 | @item lazy-highlight | 539 | @item lazy-highlight |
| 547 | This face is used for lazy highlighting of Isearch and Query Replace | 540 | This face is used to highlight ``lazy matches'' for Isearch and Query |
| 548 | matches other than the current one. | 541 | Replace (matches other than the current one). |
| 549 | @item region | 542 | @item region |
| 550 | This face is used for displaying a selected region (@pxref{Mark}). | 543 | This face is used for displaying an active region (@pxref{Mark}). |
| 544 | When Emacs is built with GTK support, its colors are taken from the | ||
| 545 | current GTK theme. | ||
| 551 | @item secondary-selection | 546 | @item secondary-selection |
| 552 | This face is used for displaying a secondary X selection (@pxref{Secondary | 547 | This face is used for displaying a secondary X selection (@pxref{Secondary |
| 553 | Selection}). | 548 | Selection}). |
| 554 | @item trailing-whitespace | 549 | @item trailing-whitespace |
| 555 | The face for highlighting excess spaces and tabs at the end of a line | 550 | The face for highlighting excess spaces and tabs at the end of a line |
| 556 | when @code{show-trailing-whitespace} is non-@code{nil}; see | 551 | when @code{show-trailing-whitespace} is non-@code{nil} (@pxref{Useless |
| 557 | @ref{Useless Whitespace}. | 552 | Whitespace}). |
| 558 | @item nobreak-space | ||
| 559 | The face for displaying the character ``nobreak space.'' | ||
| 560 | @item escape-glyph | 553 | @item escape-glyph |
| 561 | The face for highlighting the @samp{\} or @samp{^} that indicates | 554 | The face for displaying control characters and escape sequences |
| 562 | a control character. It's also used when @samp{\} indicates a | 555 | (@pxref{Text Display}). |
| 563 | nobreak space or nobreak (soft) hyphen. | 556 | @item nobreak-space |
| 557 | The face for displaying ``non-breaking'' space characters (@pxref{Text | ||
| 558 | Display}). | ||
| 564 | @end table | 559 | @end table |
| 565 | 560 | ||
| 566 | These faces control the appearance of parts of the Emacs frame. | 561 | The following faces control the appearance of parts of the Emacs |
| 567 | They exist as faces to provide a consistent way to customize the | 562 | frame: |
| 568 | appearance of these parts of the frame. | ||
| 569 | 563 | ||
| 570 | @table @code | 564 | @table @code |
| 571 | @item mode-line | 565 | @item mode-line |
| @@ -588,11 +582,8 @@ at the top of a window just as the mode line appears at the bottom. | |||
| 588 | Most windows do not have a header line---only some special modes, such | 582 | Most windows do not have a header line---only some special modes, such |
| 589 | Info mode, create one. | 583 | Info mode, create one. |
| 590 | @item vertical-border | 584 | @item vertical-border |
| 591 | This face is used for the vertical divider between windows. | 585 | This face is used for the vertical divider between windows on |
| 592 | By default this face inherits from the @code{mode-line-inactive} face | 586 | text-only terminals. |
| 593 | on character terminals. On graphical displays the foreground color of | ||
| 594 | this face is used for the vertical line between windows without | ||
| 595 | scrollbars. | ||
| 596 | @item minibuffer-prompt | 587 | @item minibuffer-prompt |
| 597 | @cindex @code{minibuffer-prompt} face | 588 | @cindex @code{minibuffer-prompt} face |
| 598 | @vindex minibuffer-prompt-properties | 589 | @vindex minibuffer-prompt-properties |
| @@ -607,35 +598,37 @@ The face for the fringes to the left and right of windows on graphic | |||
| 607 | displays. (The fringes are the narrow portions of the Emacs frame | 598 | displays. (The fringes are the narrow portions of the Emacs frame |
| 608 | between the text area and the window's right and left borders.) | 599 | between the text area and the window's right and left borders.) |
| 609 | @xref{Fringes}. | 600 | @xref{Fringes}. |
| 610 | @item scroll-bar | ||
| 611 | This face determines the visual appearance of the scroll bar. | ||
| 612 | @xref{Scroll Bars}. | ||
| 613 | @item border | ||
| 614 | This face determines the color of the frame border. | ||
| 615 | @item cursor | 601 | @item cursor |
| 616 | This face determines the color of the cursor. | 602 | This face determines the color of the text cursor. |
| 603 | @item tooltip | ||
| 604 | This face is used for tooltip text. By default, if Emacs is built | ||
| 605 | with GTK support, tooltips are drawn via GTK and this face has no | ||
| 606 | effect. @xref{Tooltips}. | ||
| 617 | @item mouse | 607 | @item mouse |
| 618 | This face determines the color of the mouse pointer. | 608 | This face determines the color of the mouse pointer. |
| 609 | @end table | ||
| 610 | |||
| 611 | The following faces likewise control the appearance of parts of the | ||
| 612 | Emacs frame, but only on text-only terminals, or when Emacs is built | ||
| 613 | on X with no toolkit support. (For all other cases, the appearance of | ||
| 614 | the respective frame elements is determined by system-wide settings.) | ||
| 615 | |||
| 616 | @table @code | ||
| 617 | @item scroll-bar | ||
| 618 | This face determines the visual appearance of the scroll bar. | ||
| 619 | @xref{Scroll Bars}. | ||
| 619 | @item tool-bar | 620 | @item tool-bar |
| 620 | This face determines the color of tool bar icons. @xref{Tool Bars}. | 621 | This face determines the color of tool bar icons. @xref{Tool Bars}. |
| 621 | @item tooltip | ||
| 622 | This face is used for tooltips. @xref{Tooltips}. | ||
| 623 | @item menu | 622 | @item menu |
| 624 | @cindex menu bar appearance | 623 | @cindex menu bar appearance |
| 625 | @cindex @code{menu} face, no effect if customized | 624 | @cindex @code{menu} face, no effect if customized |
| 626 | @cindex customization of @code{menu} face | 625 | @cindex customization of @code{menu} face |
| 627 | This face determines the colors and font of Emacs's menus. @xref{Menu | 626 | This face determines the colors and font of Emacs's menus. @xref{Menu |
| 628 | Bars}. This has no effect in Emacs built with GTK and in the | 627 | Bars}. |
| 629 | MS-Windows/Mac ports; you need to use system-wide styles and options | ||
| 630 | to change the appearance of GTK, Windows, or Mac menus. Setting the | ||
| 631 | font of LessTif/Motif menus is currently not supported; attempts to | ||
| 632 | set the font are ignored in this case. | ||
| 633 | @end table | 628 | @end table |
| 634 | 629 | ||
| 635 | @node Temporary Face Changes | 630 | @node Text Scale |
| 636 | @section Temporary Face Changes | 631 | @section Text Scale |
| 637 | |||
| 638 | The following commands change the default face within a buffer. | ||
| 639 | 632 | ||
| 640 | @cindex adjust buffer face height | 633 | @cindex adjust buffer face height |
| 641 | @findex text-scale-adjust | 634 | @findex text-scale-adjust |
| @@ -652,9 +645,11 @@ determine which action to take. | |||
| 652 | 645 | ||
| 653 | The final key of these commands may be repeated without the leading | 646 | The final key of these commands may be repeated without the leading |
| 654 | @kbd{C-x}. For instance, @kbd{C-x C-= C-= C-=} increases the face | 647 | @kbd{C-x}. For instance, @kbd{C-x C-= C-= C-=} increases the face |
| 655 | height by three steps. Each step scales the height of the default | 648 | height by three steps. Each step scales the text height by a factor |
| 656 | face by the value of the variable @code{text-scale-mode-step}. As a | 649 | of 1.2; to change this factor, customize the variable |
| 657 | special case, an argument of 0 removes any scaling currently active. | 650 | @code{text-scale-mode-step}. As an exception, a numeric argument of 0 |
| 651 | to the @code{text-scale-adjust} command restores the default height, | ||
| 652 | similar to typing @kbd{C-x C-0}. | ||
| 658 | 653 | ||
| 659 | @cindex increase buffer face height | 654 | @cindex increase buffer face height |
| 660 | @findex text-scale-increase | 655 | @findex text-scale-increase |
| @@ -668,21 +663,14 @@ You may find it convenient to bind to these commands, rather than | |||
| 668 | 663 | ||
| 669 | @cindex set buffer face height | 664 | @cindex set buffer face height |
| 670 | @findex text-scale-set | 665 | @findex text-scale-set |
| 671 | The command @code{text-scale-set} sets the height of the default face | 666 | The command @code{text-scale-set} scales the height of the default |
| 672 | in the current buffer to an absolute level specified by its prefix | 667 | face in the current buffer to an absolute level specified by its |
| 673 | argument. | 668 | prefix argument. |
| 674 | 669 | ||
| 675 | @findex text-scale-mode | 670 | @findex text-scale-mode |
| 676 | The above commands automatically enable or disable the minor mode | 671 | The above commands automatically enable the minor mode |
| 677 | @code{text-scale-mode}, depending on whether the current font scaling | 672 | @code{text-scale-mode} if the current font scaling is other than 1, |
| 678 | is other than 1 or not. | 673 | and disable it otherwise. |
| 679 | |||
| 680 | @cindex variable pitch mode | ||
| 681 | @findex variable-pitch-mode | ||
| 682 | To temporarily change the face in the current buffer to a | ||
| 683 | variable-pitch (``proportional'') font, use the command @kbd{M-x | ||
| 684 | variable-pitch-mode} to enable or disable the Variable Pitch minor | ||
| 685 | mode. | ||
| 686 | 674 | ||
| 687 | @node Font Lock | 675 | @node Font Lock |
| 688 | @section Font Lock mode | 676 | @section Font Lock mode |
| @@ -691,41 +679,36 @@ mode. | |||
| 691 | @cindex syntax highlighting and coloring | 679 | @cindex syntax highlighting and coloring |
| 692 | 680 | ||
| 693 | Font Lock mode is a minor mode, always local to a particular buffer, | 681 | Font Lock mode is a minor mode, always local to a particular buffer, |
| 694 | which highlights (or ``fontifies'') the buffer contents according to | 682 | which assigns faces to (or @dfn{fontifies}) the text in the buffer. |
| 695 | the syntax of the text you are editing. It can recognize comments and | 683 | Each buffer's major mode tells Font Lock mode which text to fontify; |
| 696 | strings in most programming languages; in several languages, it can | 684 | for instance, programming language modes fontify syntactically |
| 697 | also recognize and properly highlight various other important | 685 | relevant constructs like comments, strings, and function names. |
| 698 | constructs, such as names of functions being defined or reserved | ||
| 699 | keywords. Some special modes, such as Occur mode and Info mode, have | ||
| 700 | completely specialized ways of assigning fonts for Font Lock mode. | ||
| 701 | 686 | ||
| 702 | @findex font-lock-mode | 687 | @findex font-lock-mode |
| 703 | Font Lock mode is turned on by default in all modes which support it. | 688 | Font Lock mode is enabled by default. To toggle it in the current |
| 704 | You can toggle font-lock for each buffer with the command @kbd{M-x | 689 | buffer, type @kbd{M-x font-lock-mode}. A positive numeric argument |
| 705 | font-lock-mode}. Using a positive argument unconditionally turns Font | 690 | unconditionally enables Font Lock mode, and a negative or zero |
| 706 | Lock mode on, and a negative or zero argument turns it off. | 691 | argument disables it. |
| 707 | 692 | ||
| 708 | @findex global-font-lock-mode | 693 | @findex global-font-lock-mode |
| 709 | @vindex global-font-lock-mode | 694 | @vindex global-font-lock-mode |
| 710 | If you do not wish Font Lock mode to be turned on by default, | 695 | To toggle Font Lock mode in all buffers, type @kbd{M-x |
| 711 | customize the variable @code{global-font-lock-mode} using the Customize | 696 | global-font-lock-mode}. To impose this setting for future Emacs |
| 712 | interface (@pxref{Easy Customization}), or use the function | 697 | sessions, customize the variable @code{global-font-lock-mode} |
| 713 | @code{global-font-lock-mode} in your @file{.emacs} file, like this: | 698 | (@pxref{Easy Customization}), or add the following line to your init |
| 699 | file: | ||
| 714 | 700 | ||
| 715 | @example | 701 | @example |
| 716 | (global-font-lock-mode 0) | 702 | (global-font-lock-mode 0) |
| 717 | @end example | 703 | @end example |
| 718 | 704 | ||
| 719 | @noindent | ||
| 720 | This variable, like all the variables that control Font Lock mode, | ||
| 721 | take effect whenever fontification is done; that is, potentially at | ||
| 722 | any time. | ||
| 723 | |||
| 724 | @findex turn-on-font-lock | 705 | @findex turn-on-font-lock |
| 725 | If you have disabled Global Font Lock mode, you can still enable Font | 706 | @noindent |
| 707 | If you have disabled Global Font Lock mode, you can still enable Font | ||
| 726 | Lock for specific major modes by adding the function | 708 | Lock for specific major modes by adding the function |
| 727 | @code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For | 709 | @code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For |
| 728 | example, to enable Font Lock mode for editing C files, you can do this: | 710 | example, to enable Font Lock mode for editing C files, you can do |
| 711 | this: | ||
| 729 | 712 | ||
| 730 | @example | 713 | @example |
| 731 | (add-hook 'c-mode-hook 'turn-on-font-lock) | 714 | (add-hook 'c-mode-hook 'turn-on-font-lock) |
| @@ -739,27 +722,19 @@ use that customization buffer to customize the appearance of these | |||
| 739 | faces. @xref{Face Customization}. | 722 | faces. @xref{Face Customization}. |
| 740 | 723 | ||
| 741 | @vindex font-lock-maximum-decoration | 724 | @vindex font-lock-maximum-decoration |
| 742 | The variable @code{font-lock-maximum-decoration} specifies the | 725 | You can customize the variable @code{font-lock-maximum-decoration} |
| 743 | preferred level of fontification, for modes that provide multiple | 726 | to alter the amount of fontification applied by Font Lock mode, for |
| 744 | levels. Level 1 is the least amount of fontification; some modes | 727 | major modes that support this feature. The value should be a number |
| 745 | support levels as high as 3. The normal default is ``as high as | 728 | (with 1 representing a minimal amount of fontification; some modes |
| 746 | possible.'' You can specify an integer, which applies to all modes, or | 729 | support levels as high as 3); or @code{t}, meaning ``as high as |
| 747 | you can specify different numbers for particular major modes; for | 730 | possible'' (the default). You can also specify different numbers for |
| 748 | example, to use level 1 for C/C++ modes, and the default level | 731 | particular major modes; for example, to use level 1 for C/C++ modes, |
| 749 | otherwise, use this: | 732 | and the default level otherwise, use the value |
| 750 | 733 | ||
| 751 | @example | 734 | @example |
| 752 | (setq font-lock-maximum-decoration | 735 | '((c-mode . 1) (c++-mode . 1))) |
| 753 | '((c-mode . 1) (c++-mode . 1))) | ||
| 754 | @end example | 736 | @end example |
| 755 | 737 | ||
| 756 | @vindex font-lock-maximum-size | ||
| 757 | Fontification can be too slow for large buffers, so you can suppress | ||
| 758 | it for buffers above a certain size. The variable | ||
| 759 | @code{font-lock-maximum-size} specifies a buffer size, beyond which | ||
| 760 | buffer fontification is suppressed. | ||
| 761 | |||
| 762 | @c @w is used below to prevent a bad page-break. | ||
| 763 | @vindex font-lock-beginning-of-syntax-function | 738 | @vindex font-lock-beginning-of-syntax-function |
| 764 | @cindex incorrect fontification | 739 | @cindex incorrect fontification |
| 765 | @cindex parenthesis in column zero and fontification | 740 | @cindex parenthesis in column zero and fontification |
| @@ -768,11 +743,10 @@ buffer fontification is suppressed. | |||
| 768 | relies on analysis of the syntactic structure of the buffer text. For | 743 | relies on analysis of the syntactic structure of the buffer text. For |
| 769 | the sake of speed, some modes, including Lisp mode, rely on a special | 744 | the sake of speed, some modes, including Lisp mode, rely on a special |
| 770 | convention: an open-parenthesis or open-brace in the leftmost column | 745 | convention: an open-parenthesis or open-brace in the leftmost column |
| 771 | always defines the @w{beginning} of a defun, and is thus always | 746 | always defines the beginning of a defun, and is thus always outside |
| 772 | outside any string or comment. (@xref{Left Margin Paren}.) If you | 747 | any string or comment. Therefore, you should avoid placing a an |
| 773 | don't follow this convention, Font Lock mode can misfontify the text | 748 | open-parenthesis or open-brace in the leftmost column, if it is inside |
| 774 | that follows an open-parenthesis or open-brace in the leftmost column | 749 | a string or comment. @xref{Left Margin Paren}, for details. |
| 775 | that is inside a string or comment. | ||
| 776 | 750 | ||
| 777 | @cindex slow display during scrolling | 751 | @cindex slow display during scrolling |
| 778 | The variable @code{font-lock-beginning-of-syntax-function}, which is | 752 | The variable @code{font-lock-beginning-of-syntax-function}, which is |
| @@ -788,11 +762,11 @@ considerably slow down redisplay while scrolling, particularly if you | |||
| 788 | are close to the end of a large buffer. | 762 | are close to the end of a large buffer. |
| 789 | 763 | ||
| 790 | @findex font-lock-add-keywords | 764 | @findex font-lock-add-keywords |
| 791 | Font Lock highlighting patterns already exist for many modes, but you | 765 | Font Lock highlighting patterns already exist for most modes, but |
| 792 | may want to fontify additional patterns. You can use the function | 766 | you may want to fontify additional patterns. You can use the function |
| 793 | @code{font-lock-add-keywords}, to add your own highlighting patterns for | 767 | @code{font-lock-add-keywords}, to add your own highlighting patterns |
| 794 | a particular mode. For example, to highlight @samp{FIXME:} words in C | 768 | for a particular mode. For example, to highlight @samp{FIXME:} words |
| 795 | comments, use this: | 769 | in C comments, use this: |
| 796 | 770 | ||
| 797 | @example | 771 | @example |
| 798 | (add-hook 'c-mode-hook | 772 | (add-hook 'c-mode-hook |
| @@ -803,19 +777,20 @@ comments, use this: | |||
| 803 | @end example | 777 | @end example |
| 804 | 778 | ||
| 805 | @findex font-lock-remove-keywords | 779 | @findex font-lock-remove-keywords |
| 806 | To remove keywords from the font-lock highlighting patterns, use the | 780 | @noindent |
| 781 | To remove keywords from the font-lock highlighting patterns, use the | ||
| 807 | function @code{font-lock-remove-keywords}. @xref{Search-based | 782 | function @code{font-lock-remove-keywords}. @xref{Search-based |
| 808 | Fontification,,, elisp, The Emacs Lisp Reference Manual}. | 783 | Fontification,,, elisp, The Emacs Lisp Reference Manual}. |
| 809 | 784 | ||
| 810 | @cindex just-in-time (JIT) font-lock | 785 | @cindex just-in-time (JIT) font-lock |
| 811 | @cindex background syntax highlighting | 786 | @cindex background syntax highlighting |
| 812 | Fontifying large buffers can take a long time. To avoid large | 787 | Fontifying large buffers can take a long time. To avoid large |
| 813 | delays when a file is visited, Emacs fontifies only the visible | 788 | delays when a file is visited, Emacs initially fontifies only the |
| 814 | portion of a buffer. As you scroll through the buffer, each portion | 789 | visible portion of a buffer. As you scroll through the buffer, each |
| 815 | that becomes visible is fontified as soon as it is displayed; this | 790 | portion that becomes visible is fontified as soon as it is displayed; |
| 816 | type of Font Lock is called @dfn{Just-In-Time} (or @dfn{JIT}) Lock. | 791 | this type of Font Lock is called @dfn{Just-In-Time} (or @dfn{JIT}) |
| 817 | You can control how JIT Lock behaves, including telling it to perform | 792 | Lock. You can control how JIT Lock behaves, including telling it to |
| 818 | fontification while idle, by customizing variables in the | 793 | perform fontification while idle, by customizing variables in the |
| 819 | customization group @samp{jit-lock}. @xref{Specific Customization}. | 794 | customization group @samp{jit-lock}. @xref{Specific Customization}. |
| 820 | 795 | ||
| 821 | @node Highlight Interactively | 796 | @node Highlight Interactively |
| @@ -826,7 +801,7 @@ customization group @samp{jit-lock}. @xref{Specific Customization}. | |||
| 826 | 801 | ||
| 827 | @findex highlight-changes-mode | 802 | @findex highlight-changes-mode |
| 828 | Highlight Changes mode is a minor mode that @dfn{highlights} the parts | 803 | Highlight Changes mode is a minor mode that @dfn{highlights} the parts |
| 829 | of the buffer were changed most recently, by giving that text a | 804 | of the buffer that were changed most recently, by giving that text a |
| 830 | different face. To enable or disable Highlight Changes mode, use | 805 | different face. To enable or disable Highlight Changes mode, use |
| 831 | @kbd{M-x highlight-changes-mode}. | 806 | @kbd{M-x highlight-changes-mode}. |
| 832 | 807 | ||
| @@ -931,21 +906,23 @@ mode's symbol is a member of the list @code{hi-lock-exclude-modes}. | |||
| 931 | display symbols that provide information about the text in the window. | 906 | display symbols that provide information about the text in the window. |
| 932 | 907 | ||
| 933 | The most common use of the fringes is to indicate a continuation | 908 | The most common use of the fringes is to indicate a continuation |
| 934 | line, when one line of text is split into multiple lines on the | 909 | line (@pxref{Continuation Lines}). When one line of text is split |
| 935 | screen. The left fringe shows a curving arrow for each screen line | 910 | into multiple screen lines, the left fringe shows a curving arrow for |
| 936 | except the first, indicating that ``this is not the real beginning.'' | 911 | each screen line except the first, indicating that ``this is not the |
| 937 | The right fringe shows a curving arrow for each screen line except the | 912 | real beginning.'' The right fringe shows a curving arrow for each |
| 938 | last, indicating that ``this is not the real end.'' If the line's | 913 | screen line except the last, indicating that ``this is not the real |
| 939 | direction is right-to-left (@pxref{Bidirectional Editing}), the | 914 | end.'' If the line's direction is right-to-left (@pxref{Bidirectional |
| 940 | meaning of the curving arrows in the left and right fringes are | 915 | Editing}), the meanings of the curving arrows in the fringes are |
| 941 | swapped. | 916 | swapped. |
| 942 | 917 | ||
| 943 | The fringes indicate line truncation with short horizontal arrows | 918 | The fringes indicate line truncation with short horizontal arrows |
| 944 | meaning ``there's more text on this line which is scrolled | 919 | meaning ``there's more text on this line which is scrolled |
| 945 | horizontally out of view;'' clicking the mouse on one of the arrows | 920 | horizontally out of view.'' Clicking the mouse on one of the arrows |
| 946 | scrolls the display horizontally in the direction of the arrow. The | 921 | scrolls the display horizontally in the direction of the arrow. |
| 947 | fringes can also indicate other things, such as empty lines, or where a | 922 | |
| 948 | program you are debugging is executing (@pxref{Debuggers}). | 923 | The fringes can also indicate other things, such as buffer |
| 924 | boundaries (@pxref{Displaying Boundaries}), and where a program you | ||
| 925 | are debugging is executing (@pxref{Debuggers}). | ||
| 949 | 926 | ||
| 950 | @findex set-fringe-style | 927 | @findex set-fringe-style |
| 951 | @findex fringe-mode | 928 | @findex fringe-mode |
| @@ -958,10 +935,10 @@ for the selected frame, use @kbd{M-x set-fringe-style}. | |||
| 958 | 935 | ||
| 959 | @vindex indicate-buffer-boundaries | 936 | @vindex indicate-buffer-boundaries |
| 960 | On a graphical display, Emacs can indicate the buffer boundaries in | 937 | On a graphical display, Emacs can indicate the buffer boundaries in |
| 961 | the fringes. It indicates the first line and the last line with | 938 | the fringes. If you enable this feature, the first line and the last |
| 962 | angle images in the fringes. This can be combined with up and down | 939 | line are marked with angle images in the fringes. This can be |
| 963 | arrow images which say whether it is possible to scroll the window up | 940 | combined with up and down arrow images which say whether it is |
| 964 | and down. | 941 | possible to scroll the window. |
| 965 | 942 | ||
| 966 | The buffer-local variable @code{indicate-buffer-boundaries} controls | 943 | The buffer-local variable @code{indicate-buffer-boundaries} controls |
| 967 | how the buffer boundaries and window scrolling is indicated in the | 944 | how the buffer boundaries and window scrolling is indicated in the |
| @@ -1006,25 +983,22 @@ the location of point is enough to show you that the spaces are | |||
| 1006 | present. | 983 | present. |
| 1007 | 984 | ||
| 1008 | @findex delete-trailing-whitespace | 985 | @findex delete-trailing-whitespace |
| 1009 | Type @kbd{M-x delete-trailing-whitespace @key{RET}} to delete all | 986 | Type @kbd{M-x delete-trailing-whitespace} to delete all trailing |
| 1010 | trailing whitespace within the buffer's accessible portion | 987 | whitespace within the buffer. If the region is active, it deletes all |
| 1011 | (@pxref{Narrowing}). This command does not remove newline characters. | 988 | trailing whitespace in the region instead. |
| 1012 | 989 | ||
| 1013 | @vindex indicate-empty-lines | 990 | @vindex indicate-empty-lines |
| 1014 | @cindex unused lines | 991 | @cindex unused lines |
| 1015 | @cindex fringes, and unused line indication | 992 | @cindex fringes, and unused line indication |
| 1016 | Emacs can indicate unused lines at the end of the window with a | 993 | On graphical displays, Emacs can indicate unused lines at the end of |
| 1017 | small image in the left fringe (@pxref{Fringes}). The image appears | 994 | the window with a small image in the left fringe (@pxref{Fringes}). |
| 1018 | for window lines that do not correspond to any buffer text. Blank | 995 | The image appears for window lines that do not correspond to any |
| 1019 | lines at the end of the buffer then stand out because they do not have | 996 | buffer text. Blank lines at the end of the buffer then stand out |
| 1020 | this image in the fringe. | 997 | because they do not have this image in the fringe. To enable this |
| 1021 | 998 | feature, set the buffer-local variable @code{indicate-empty-lines} to | |
| 1022 | To enable this feature, set the buffer-local variable | 999 | a non-@code{nil} value. You can enable or disable this feature for |
| 1023 | @code{indicate-empty-lines} to a non-@code{nil} value. You can enable | 1000 | all new buffers by setting the default value of this variable, |
| 1024 | or disable this feature for all new buffers by setting the default | 1001 | e.g.@:@code{(setq-default indicate-empty-lines t)}. |
| 1025 | value of this variable, e.g.@: @code{(setq-default | ||
| 1026 | indicate-empty-lines t)};. (This feature currently doesn't work on | ||
| 1027 | text-only terminals.) | ||
| 1028 | 1002 | ||
| 1029 | @node Selective Display | 1003 | @node Selective Display |
| 1030 | @section Selective Display | 1004 | @section Selective Display |
| @@ -1178,11 +1152,10 @@ percentage of the total charge. | |||
| 1178 | @cindex mode line, 3D appearance | 1152 | @cindex mode line, 3D appearance |
| 1179 | @cindex attributes of mode line, changing | 1153 | @cindex attributes of mode line, changing |
| 1180 | @cindex non-integral number of lines in a window | 1154 | @cindex non-integral number of lines in a window |
| 1181 | By default, the mode line is drawn on graphics displays with | 1155 | On a graphical display, the mode line is drawn as a 3D box. If you |
| 1182 | 3D-style highlighting, like that of a button when it is not being | 1156 | don't like this effect, you can disable it by customizing the |
| 1183 | pressed. If you don't like this effect, you can disable the 3D | 1157 | @code{mode-line} face and setting its @code{box} attribute to |
| 1184 | highlighting of the mode line, by customizing the attributes of the | 1158 | @code{nil}. @xref{Face Customization}. |
| 1185 | @code{mode-line} face. @xref{Face Customization}. | ||
| 1186 | 1159 | ||
| 1187 | @cindex non-selected windows, mode line appearance | 1160 | @cindex non-selected windows, mode line appearance |
| 1188 | By default, the mode line of nonselected windows is displayed in a | 1161 | By default, the mode line of nonselected windows is displayed in a |
| @@ -1210,51 +1183,45 @@ formats by setting each of the variables @code{eol-mnemonic-unix}, | |||
| 1210 | @node Text Display | 1183 | @node Text Display |
| 1211 | @section How Text Is Displayed | 1184 | @section How Text Is Displayed |
| 1212 | @cindex characters (in text) | 1185 | @cindex characters (in text) |
| 1186 | @cindex printing character | ||
| 1213 | 1187 | ||
| 1214 | @acronym{ASCII} printing characters (octal codes 040 through 0176) in Emacs | 1188 | Most characters are @dfn{printing characters}: when they appear in a |
| 1215 | buffers are displayed with their graphics, as are non-@acronym{ASCII} multibyte | 1189 | buffer, they are displayed literally on the screen. Printing |
| 1216 | printing characters (octal codes above 0400). | 1190 | characters include @acronym{ASCII} numbers, letters, and punctuation |
| 1191 | characters, as well as many non-@acronym{ASCII} characters. | ||
| 1217 | 1192 | ||
| 1218 | @vindex tab-width | 1193 | @vindex tab-width |
| 1219 | Some @acronym{ASCII} control characters are displayed in special | 1194 | @cindex control character |
| 1220 | ways. The newline character (octal code 012) is displayed by starting | 1195 | The @acronym{ASCII} character set contains non-printing @dfn{control |
| 1221 | a new line. The tab character (octal code 011) is displayed by moving | 1196 | characters}. Two of these are displayed specially: the newline |
| 1222 | to the next tab stop column (normally every 8 columns). The number of | 1197 | character (Unicode code point @code{U+000A}) is displayed by starting |
| 1223 | spaces per tab is controlled by the variable @code{tab-width}, which | 1198 | a new line, while the tab character (@code{U+0009}) is displayed as a |
| 1224 | must have an integer value between 1 and 1000, inclusive, and is made | 1199 | space that extends to the next tab stop column (normally every 8 |
| 1225 | buffer-local by changing it. Note that how the tab character in the buffer | 1200 | columns). The number of spaces per tab is controlled by the |
| 1226 | is displayed has nothing to do with the definition of @key{TAB} as a | 1201 | buffer-local variable @code{tab-width}, which must have an integer |
| 1227 | command. | 1202 | value between 1 and 1000, inclusive. Note that how the tab character |
| 1228 | 1203 | in the buffer is displayed has nothing to do with the definition of | |
| 1229 | Other @acronym{ASCII} control characters are normally displayed as a caret | 1204 | @key{TAB} as a command. |
| 1230 | (@samp{^}) followed by the non-control version of the character; thus, | 1205 | |
| 1231 | control-A is displayed as @samp{^A}. The caret appears in face | 1206 | Other @acronym{ASCII} control characters are displayed as a caret |
| 1232 | @code{escape-glyph}. | 1207 | (@samp{^}) followed by the non-control version of the character, with |
| 1233 | 1208 | the @code{escape-glyph} face. For instance, the @samp{control-A} | |
| 1234 | Non-@acronym{ASCII} characters 0200 through 0237 (octal) are | 1209 | character, @code{U+0001}, is displayed as @samp{^A}. |
| 1235 | displayed with octal escape sequences; thus, character code 0230 | ||
| 1236 | (octal) is displayed as @samp{\230}. The backslash appears in face | ||
| 1237 | @code{escape-glyph}. | ||
| 1238 | 1210 | ||
| 1239 | @vindex ctl-arrow | 1211 | @vindex ctl-arrow |
| 1240 | If the variable @code{ctl-arrow} is @code{nil}, control characters in | 1212 | The non-@acronym{ASCII}, non-printing characters @code{U+0080} |
| 1241 | the buffer are displayed with octal escape sequences, except for newline | 1213 | (octal 200) through @code{U+009F} (octal 237) are displayed as octal |
| 1242 | and tab. Altering the value of @code{ctl-arrow} makes it local to the | 1214 | escape sequences, with the @code{escape-glyph} face. For instance, |
| 1243 | current buffer; until that time, the default value is in effect. The | 1215 | character code @code{U+0098} (octal 230) is displayed as @samp{\230}. |
| 1244 | default is initially @code{t}. | 1216 | If you change the buffer-local variable @code{ctl-arrow} to |
| 1245 | 1217 | @code{nil}, @acronym{ASCII} control characters are also displayed as | |
| 1246 | The display of character codes 0240 through 0377 (octal) may be | 1218 | octal escape sequences instead of caret escape sequences. |
| 1247 | either as escape sequences or as graphics. They do not normally occur | ||
| 1248 | in multibyte buffers, but if they do, they are displayed as Latin-1 | ||
| 1249 | graphics. In unibyte mode, if you enable European display they are | ||
| 1250 | displayed using their graphics (assuming your terminal supports them), | ||
| 1251 | otherwise as escape sequences. @xref{Unibyte Mode}. | ||
| 1252 | 1219 | ||
| 1253 | @vindex nobreak-char-display | 1220 | @vindex nobreak-char-display |
| 1254 | @cindex no-break space, display | 1221 | @cindex non-breaking space, display |
| 1255 | @cindex no-break hyphen, display | 1222 | @cindex non-breaking hyphen, display |
| 1256 | @cindex soft hyphen, display | 1223 | @cindex soft hyphen, display |
| 1257 | Some character sets define ``no-break'' versions of the space and | 1224 | There are two special ``non-breaking'' versions of the space and |
| 1258 | hyphen characters, which are used where a line should not be broken. | 1225 | hyphen characters, which are used where a line should not be broken. |
| 1259 | Emacs normally displays these characters with special faces | 1226 | Emacs normally displays these characters with special faces |
| 1260 | (respectively, @code{nobreak-space} and @code{escape-glyph}) to | 1227 | (respectively, @code{nobreak-space} and @code{escape-glyph}) to |
| @@ -1269,45 +1236,13 @@ elisp, The Emacs Lisp Reference Manual}. | |||
| 1269 | 1236 | ||
| 1270 | @cindex glyphless characters | 1237 | @cindex glyphless characters |
| 1271 | @cindex characters with no font glyphs | 1238 | @cindex characters with no font glyphs |
| 1272 | On graphics displays, some characters could have no glyphs in any of | 1239 | On graphical displays, some characters may have no glyphs in any of |
| 1273 | the fonts available to Emacs. On text terminals, some characters | 1240 | the fonts available to Emacs. These @dfn{glyphless characters} are |
| 1274 | could be impossible to encode with the terminal coding system | 1241 | normally displayed as boxes containing the hexadecimal character code. |
| 1275 | (@pxref{Terminal Coding}). Emacs can display such @dfn{glyphless} | 1242 | You can control the display method by customizing the variable |
| 1276 | characters using one of the following methods: | 1243 | @code{glyphless-char-display-control}. @xref{Glyphless Chars,, |
| 1277 | 1244 | Glyphless Character Display, elisp, The Emacs Lisp Reference Manual}, | |
| 1278 | @table @code | 1245 | for details. |
| 1279 | @item zero-width | ||
| 1280 | Don't display the character. | ||
| 1281 | |||
| 1282 | @item thin-space | ||
| 1283 | Display a thin space, 1-pixel wide on graphics displays or 1-character | ||
| 1284 | wide on text terminals. | ||
| 1285 | |||
| 1286 | @item empty-box | ||
| 1287 | Display an empty box. | ||
| 1288 | |||
| 1289 | @item acronym | ||
| 1290 | Display the acronym of the character's name (such as @sc{zwnj} or | ||
| 1291 | @sc{rlm}) in a box. | ||
| 1292 | |||
| 1293 | @item hex-code | ||
| 1294 | Display the Unicode codepoint of the character in hexadecimal | ||
| 1295 | notation, in a box. | ||
| 1296 | @end table | ||
| 1297 | |||
| 1298 | @noindent | ||
| 1299 | @cindex @code{glyphless-char} face | ||
| 1300 | With the exception of @code{zero-width}, all other methods draw these | ||
| 1301 | characters in a special face @code{glyphless-char}, which you can | ||
| 1302 | customize. | ||
| 1303 | |||
| 1304 | @vindex glyphless-char-display-control | ||
| 1305 | @vindex char-acronym-table | ||
| 1306 | To control what glyphless characters are displayed using which method, | ||
| 1307 | customize the variable @code{glyphless-char-display-control}; see its | ||
| 1308 | doc string for the details. For even finer control, set the elements | ||
| 1309 | of 2 char-tables: @code{glyphless-char-display} and | ||
| 1310 | @code{char-acronym-table}. | ||
| 1311 | 1246 | ||
| 1312 | @node Cursor Display | 1247 | @node Cursor Display |
| 1313 | @section Displaying the Cursor | 1248 | @section Displaying the Cursor |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 8a15c783fc0..44f1aed134e 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -350,7 +350,7 @@ Controlling the Display | |||
| 350 | * Follow Mode:: Follow mode lets two windows scroll as one. | 350 | * Follow Mode:: Follow mode lets two windows scroll as one. |
| 351 | * Faces:: How to change the display style using faces. | 351 | * Faces:: How to change the display style using faces. |
| 352 | * Standard Faces:: Emacs' predefined faces. | 352 | * Standard Faces:: Emacs' predefined faces. |
| 353 | * Temporary Face Changes:: Commands to temporarily modify the default text face | 353 | * Text Scale:: Increasing or decreasing text size in a buffer. |
| 354 | * Font Lock:: Minor mode for syntactic highlighting using faces. | 354 | * Font Lock:: Minor mode for syntactic highlighting using faces. |
| 355 | * Highlight Interactively:: Tell Emacs what text to highlight. | 355 | * Highlight Interactively:: Tell Emacs what text to highlight. |
| 356 | * Fringes:: Enabling or disabling window fringes. | 356 | * Fringes:: Enabling or disabling window fringes. |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 14fdb3121a4..4c239d364f0 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -299,7 +299,7 @@ you can access them without having to display the menu bar. | |||
| 299 | 299 | ||
| 300 | @item S-Mouse-1 | 300 | @item S-Mouse-1 |
| 301 | This menu is for changing the default face within the window's buffer. | 301 | This menu is for changing the default face within the window's buffer. |
| 302 | @xref{Temporary Face Changes}. | 302 | @xref{Text Scale}. |
| 303 | @end table | 303 | @end table |
| 304 | 304 | ||
| 305 | @node Mode Line Mouse | 305 | @node Mode Line Mouse |
| @@ -1185,6 +1185,13 @@ options for displaying tooltips, use @kbd{M-x customize-group | |||
| 1185 | @key{RET} tooltip @key{RET}}. @xref{X Resources}, for information on | 1185 | @key{RET} tooltip @key{RET}}. @xref{X Resources}, for information on |
| 1186 | customizing the windows that display tooltips. | 1186 | customizing the windows that display tooltips. |
| 1187 | 1187 | ||
| 1188 | @vindex x-gtk-use-system-tooltips | ||
| 1189 | If Emacs is built with GTK support, it displays tooltips via GTK, | ||
| 1190 | using the default appearance of GTK tooltips. To disable this, change | ||
| 1191 | the variable @code{x-gtk-use-system-tooltips} to @code{nil}. If you | ||
| 1192 | do this, or if Emacs is built without GTK support, the @code{tooltip} | ||
| 1193 | face specifies most attributes of the tooltip text. | ||
| 1194 | |||
| 1188 | @node Mouse Avoidance | 1195 | @node Mouse Avoidance |
| 1189 | @section Mouse Avoidance | 1196 | @section Mouse Avoidance |
| 1190 | @cindex avoiding mouse in the way of your typing | 1197 | @cindex avoiding mouse in the way of your typing |
diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi index 85d92c9fcd7..f4a5a2858cf 100644 --- a/doc/emacs/macos.texi +++ b/doc/emacs/macos.texi | |||
| @@ -54,12 +54,12 @@ to change the foreground color of the face at that position (if the | |||
| 54 | instead). To discard the settings, create a new frame and close the | 54 | instead). To discard the settings, create a new frame and close the |
| 55 | altered one. | 55 | altered one. |
| 56 | 56 | ||
| 57 | @key{S-Mouse-1} (i.e., clicking the left mouse button | 57 | @key{S-Mouse-1} (i.e., clicking the left mouse button while holding |
| 58 | while holding down the @key{Shift} key) adjusts the region to the | 58 | down the @key{Shift} key) adjusts the region to the click position, |
| 59 | click position, just like @key{Mouse-3} (@code{mouse-save-then-kill}); | 59 | just like @key{Mouse-3} (@code{mouse-save-then-kill}); it does not pop |
| 60 | it does not pop up a menu for changing the default face, as | 60 | up a menu for changing the default face, as @key{S-Mouse-1} normally |
| 61 | @key{S-Mouse-1} normally does (@pxref{Temporary Face Changes}). This | 61 | does (@pxref{Text Scale}). This change makes Emacs behave more like |
| 62 | change makes Emacs behave more like other Mac / GNUstep applications. | 62 | other Mac / GNUstep applications. |
| 63 | 63 | ||
| 64 | When you open or save files using the menus, or using the | 64 | When you open or save files using the menus, or using the |
| 65 | @key{Cmd-o} and @key{Cmd-S} bindings, Emacs uses graphical file | 65 | @key{Cmd-o} and @key{Cmd-S} bindings, Emacs uses graphical file |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 345e69e6989..490280dae29 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-10-18 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * display.texi (Glyphless Chars): New node. | ||
| 4 | |||
| 1 | 2011-10-13 Chong Yidong <cyd@stupidchicken.com> | 5 | 2011-10-13 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 6 | ||
| 3 | * text.texi (Yanking): Document yank-excluded-properties. | 7 | * text.texi (Yanking): Document yank-excluded-properties. |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 18cb93557e9..034d92f78c3 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -36,6 +36,7 @@ that Emacs presents to the user. | |||
| 36 | * Window Systems:: Which window system is being used. | 36 | * Window Systems:: Which window system is being used. |
| 37 | * Bidirectional Display:: Display of bidirectional scripts, such as | 37 | * Bidirectional Display:: Display of bidirectional scripts, such as |
| 38 | Arabic and Farsi. | 38 | Arabic and Farsi. |
| 39 | * Glyphless Chars:: How glyphless characters are drawn. | ||
| 39 | @end menu | 40 | @end menu |
| 40 | 41 | ||
| 41 | @node Refresh Screen | 42 | @node Refresh Screen |
| @@ -6242,3 +6243,96 @@ affect all Emacs frames and windows. | |||
| 6242 | appropriate mirrored character in the reordered text. Lisp programs | 6243 | appropriate mirrored character in the reordered text. Lisp programs |
| 6243 | can affect the mirrored display by changing this property. Again, any | 6244 | can affect the mirrored display by changing this property. Again, any |
| 6244 | such changes affect all of Emacs display. | 6245 | such changes affect all of Emacs display. |
| 6246 | |||
| 6247 | @node Glyphless Chars | ||
| 6248 | @section Glyphless Character Display | ||
| 6249 | @cindex glyphless characters | ||
| 6250 | |||
| 6251 | @dfn{Glyphless characters} are not displayed in the usual way when | ||
| 6252 | they appear in a buffer, but in some special way (e.g. as a box | ||
| 6253 | containing a hexadecimal code). These include characters that cannot | ||
| 6254 | be displayed with any available font (on a graphical display), or that | ||
| 6255 | cannot be encoded by the terminal's coding system (on a text-only | ||
| 6256 | terminal). Specific characters can also be defined to be glyphless. | ||
| 6257 | |||
| 6258 | @defvar glyphless-char-display | ||
| 6259 | The value of this variable is a char-table that defines glyphless | ||
| 6260 | characters and how they are displayed. If an entry is @code{nil}, the | ||
| 6261 | corresponding character is displayed in its usual way. Otherwise, an | ||
| 6262 | entry should be one of the following display methods: | ||
| 6263 | |||
| 6264 | @table @asis | ||
| 6265 | @item @code{zero-width} | ||
| 6266 | Don't display the character. | ||
| 6267 | |||
| 6268 | @item @code{thin-space} | ||
| 6269 | Display a thin space, 1-pixel wide on graphical displays, or | ||
| 6270 | 1-character wide on text-only terminals. | ||
| 6271 | |||
| 6272 | @item @code{empty-box} | ||
| 6273 | Display an empty box. | ||
| 6274 | |||
| 6275 | @item @code{hex-code} | ||
| 6276 | Display a box containing the Unicode codepoint of the character, in | ||
| 6277 | hexadecimal notation. | ||
| 6278 | |||
| 6279 | @item an @acronym{ASCII} string | ||
| 6280 | Display a box containing that string. | ||
| 6281 | @end table | ||
| 6282 | |||
| 6283 | @noindent | ||
| 6284 | Except for @code{zero-width}, these methods display using the | ||
| 6285 | @code{glyphless-char} face. | ||
| 6286 | |||
| 6287 | An entry can also be a cons cell @code{(@var{graphical} | ||
| 6288 | . @var{text})}, where @var{graphical} and @var{text} are the display | ||
| 6289 | methods on graphical displays and text-only terminals respectively. | ||
| 6290 | |||
| 6291 | The char-table has one extra slot, which determines how to display any | ||
| 6292 | character that cannot be displayed with any available font, or cannot | ||
| 6293 | be encoded by the terminal's coding system. Its value should be one | ||
| 6294 | of the above display methods, except @code{zero-width} or a cons cell. | ||
| 6295 | @end defvar | ||
| 6296 | |||
| 6297 | @defopt glyphless-char-display-control | ||
| 6298 | This user option provides a convenient way to set | ||
| 6299 | @code{glyphless-char-display} for groups of similar characters. It | ||
| 6300 | takes effect via a custom @code{:set} function (@pxref{Variable | ||
| 6301 | Definitions}), which update @code{glyphless-char-display}. | ||
| 6302 | |||
| 6303 | Its value should be an alist of elements @code{(@var{group} | ||
| 6304 | . @var{method})}, where @var{group} is a symbol specifying a group of | ||
| 6305 | characters, and @var{method} is a symbol specifying how to display | ||
| 6306 | them. | ||
| 6307 | |||
| 6308 | @var{group} should be one of the following: | ||
| 6309 | |||
| 6310 | @table @code | ||
| 6311 | @item c0-control | ||
| 6312 | @acronym{ASCII} control characters @code{U+0000} to @code{U+001F}, | ||
| 6313 | excluding the newline and tab characters (normally displayed as escape | ||
| 6314 | sequences like @samp{^A}; @pxref{Text Display,, How Text Is Displayed, | ||
| 6315 | emacs, The GNU Emacs Manual}). | ||
| 6316 | |||
| 6317 | @item c1-control | ||
| 6318 | Non-@acronym{ASCII}, non-printing characters @code{U+0080} to | ||
| 6319 | @code{U+009F} (normally displayed as octal escape sequences like | ||
| 6320 | @samp{\230}). | ||
| 6321 | |||
| 6322 | @item format-control | ||
| 6323 | Characters of Unicode General Category `Cf', such as @samp{U+200E} | ||
| 6324 | (Left-to-Right Mark), but excluding characters that have graphic | ||
| 6325 | images, such as @samp{U+00AD} (Soft Hyphen). | ||
| 6326 | |||
| 6327 | @item no-font | ||
| 6328 | Characters for there is no suitable font, or which cannot be encoded | ||
| 6329 | by the terminal's coding system. | ||
| 6330 | @end table | ||
| 6331 | |||
| 6332 | @c FIXME: this can also be `acronym', but that's not currently | ||
| 6333 | @c completely implemented; it applies only to the format-control | ||
| 6334 | @c group, and only works if the acronym is in `char-acronym-table'. | ||
| 6335 | The @var{method} symbol should be one of @code{zero-width}, | ||
| 6336 | @code{thin-space}, @code{empty-box}, or @code{hex-code}. These have | ||
| 6337 | the same meanings as in @code{glyphless-char-display}, above. | ||
| 6338 | @end defopt | ||
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 8350c9b7080..cefa917a4e1 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -1278,6 +1278,9 @@ Emacs Display | |||
| 1278 | * Display Tables:: How to specify other conventions. | 1278 | * Display Tables:: How to specify other conventions. |
| 1279 | * Beeping:: Audible signal to the user. | 1279 | * Beeping:: Audible signal to the user. |
| 1280 | * Window Systems:: Which window system is being used. | 1280 | * Window Systems:: Which window system is being used. |
| 1281 | * Bidirectional Display:: Display of bidirectional scripts, such as | ||
| 1282 | Arabic and Farsi. | ||
| 1283 | * Glyphless Chars:: How glyphless characters are drawn. | ||
| 1281 | 1284 | ||
| 1282 | The Echo Area | 1285 | The Echo Area |
| 1283 | 1286 | ||
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi index 0fa23d6412c..914ba5b1fd8 100644 --- a/doc/lispref/vol1.texi +++ b/doc/lispref/vol1.texi | |||
| @@ -1299,6 +1299,9 @@ Emacs Display | |||
| 1299 | * Display Tables:: How to specify other conventions. | 1299 | * Display Tables:: How to specify other conventions. |
| 1300 | * Beeping:: Audible signal to the user. | 1300 | * Beeping:: Audible signal to the user. |
| 1301 | * Window Systems:: Which window system is being used. | 1301 | * Window Systems:: Which window system is being used. |
| 1302 | * Bidirectional Display:: Display of bidirectional scripts, such as | ||
| 1303 | Arabic and Farsi. | ||
| 1304 | * Glyphless Chars:: How glyphless characters are drawn. | ||
| 1302 | 1305 | ||
| 1303 | The Echo Area | 1306 | The Echo Area |
| 1304 | 1307 | ||
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi index 2469a742900..1f84b267c9b 100644 --- a/doc/lispref/vol2.texi +++ b/doc/lispref/vol2.texi | |||
| @@ -1298,6 +1298,9 @@ Emacs Display | |||
| 1298 | * Display Tables:: How to specify other conventions. | 1298 | * Display Tables:: How to specify other conventions. |
| 1299 | * Beeping:: Audible signal to the user. | 1299 | * Beeping:: Audible signal to the user. |
| 1300 | * Window Systems:: Which window system is being used. | 1300 | * Window Systems:: Which window system is being used. |
| 1301 | * Bidirectional Display:: Display of bidirectional scripts, such as | ||
| 1302 | Arabic and Farsi. | ||
| 1303 | * Glyphless Chars:: How glyphless characters are drawn. | ||
| 1301 | 1304 | ||
| 1302 | The Echo Area | 1305 | The Echo Area |
| 1303 | 1306 | ||
| @@ -236,10 +236,10 @@ is taken from the desktop settings. | |||
| 236 | The frame-parameter tool-bar-position controls this. It takes the values | 236 | The frame-parameter tool-bar-position controls this. It takes the values |
| 237 | top, left, right or bottom. The Options => Show/Hide menu has entries | 237 | top, left, right or bottom. The Options => Show/Hide menu has entries |
| 238 | for this. | 238 | for this. |
| 239 | 239 | +++ | |
| 240 | *** The colors for selected text (the `region' face) are taken from | 240 | *** The colors for selected text (the `region' face) are taken from |
| 241 | the GTK theme when Emacs is built with GTK. | 241 | the GTK theme when Emacs is built with GTK. |
| 242 | 242 | +++ | |
| 243 | *** Emacs uses GTK tooltips by default if built with GTK. You can turn that | 243 | *** Emacs uses GTK tooltips by default if built with GTK. You can turn that |
| 244 | off by customizing x-gtk-use-system-tooltips. | 244 | off by customizing x-gtk-use-system-tooltips. |
| 245 | 245 | ||
| @@ -1146,6 +1146,7 @@ combined with minibuffer-local-must-match-map. | |||
| 1146 | *** New variable `completing-read-function' allows overriding the | 1146 | *** New variable `completing-read-function' allows overriding the |
| 1147 | behavior of `completing-read'. | 1147 | behavior of `completing-read'. |
| 1148 | 1148 | ||
| 1149 | +++ | ||
| 1149 | ** `glyphless-char-display' can now distinguish between graphical and | 1150 | ** `glyphless-char-display' can now distinguish between graphical and |
| 1150 | text terminal display, via a char-table entry that is a cons cell. | 1151 | text terminal display, via a char-table entry that is a cons cell. |
| 1151 | 1152 | ||
| @@ -1311,7 +1312,7 @@ Use `filter-buffer-substring-functions' instead. | |||
| 1311 | *** `byte-compile-disable-print-circle' is obsolete. | 1312 | *** `byte-compile-disable-print-circle' is obsolete. |
| 1312 | 1313 | ||
| 1313 | *** `deferred-action-list' and `deferred-action-function' are obsolete. | 1314 | *** `deferred-action-list' and `deferred-action-function' are obsolete. |
| 1314 | 1315 | +++ | |
| 1315 | *** `font-lock-maximum-size' is obsolete. | 1316 | *** `font-lock-maximum-size' is obsolete. |
| 1316 | 1317 | ||
| 1317 | 1318 | ||