Mercurial > emacs
comparison lispref/modes.texi @ 24934:f5e3b4ecd255
*** empty log message ***
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 07 Jul 1999 23:14:06 +0000 |
parents | f0cd03a7dac9 |
children | 467b88fab665 |
comparison
equal
deleted
inserted
replaced
24933:b43a8099ffb7 | 24934:f5e3b4ecd255 |
---|---|
106 special commands available in this mode. @kbd{C-h m} | 106 special commands available in this mode. @kbd{C-h m} |
107 (@code{describe-mode}) in your mode will display this string. | 107 (@code{describe-mode}) in your mode will display this string. |
108 | 108 |
109 The documentation string may include the special documentation | 109 The documentation string may include the special documentation |
110 substrings, @samp{\[@var{command}]}, @samp{\@{@var{keymap}@}}, and | 110 substrings, @samp{\[@var{command}]}, @samp{\@{@var{keymap}@}}, and |
111 @samp{\<@var{keymap}>}, that enable the documentation to adapt | 111 @samp{\<@var{keymap}>}, which enable the documentation to adapt |
112 automatically to the user's own key bindings. @xref{Keys in | 112 automatically to the user's own key bindings. @xref{Keys in |
113 Documentation}. | 113 Documentation}. |
114 | 114 |
115 @item | 115 @item |
116 The major mode command should start by calling | 116 The major mode command should start by calling |
460 (define-key lisp-mode-map "\C-c\C-z" 'run-lisp)) | 460 (define-key lisp-mode-map "\C-c\C-z" 'run-lisp)) |
461 @end group | 461 @end group |
462 @end smallexample | 462 @end smallexample |
463 | 463 |
464 Finally, here is the complete major mode function definition for | 464 Finally, here is the complete major mode function definition for |
465 Emacs Lisp mode. | 465 Lisp mode. |
466 | 466 |
467 @smallexample | 467 @smallexample |
468 @group | 468 @group |
469 (defun lisp-mode () | 469 (defun lisp-mode () |
470 "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. | 470 "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. |
659 @end smallexample | 659 @end smallexample |
660 @end defvar | 660 @end defvar |
661 | 661 |
662 @defvar interpreter-mode-alist | 662 @defvar interpreter-mode-alist |
663 This variable specifies major modes to use for scripts that specify a | 663 This variable specifies major modes to use for scripts that specify a |
664 command interpreter in an @samp{#!} line. Its value is a list of | 664 command interpreter in a @samp{#!} line. Its value is a list of |
665 elements of the form @code{(@var{interpreter} . @var{mode})}; for | 665 elements of the form @code{(@var{interpreter} . @var{mode})}; for |
666 example, @code{("perl" . perl-mode)} is one element present by default. | 666 example, @code{("perl" . perl-mode)} is one element present by default. |
667 The element says to use mode @var{mode} if the file specifies | 667 The element says to use mode @var{mode} if the file specifies |
668 an interpreter which matches @var{interpreter}. The value of | 668 an interpreter which matches @var{interpreter}. The value of |
669 @var{interpreter} is actually a regular expression. | 669 @var{interpreter} is actually a regular expression. |
913 | 913 |
914 @node Easy-Mmode | 914 @node Easy-Mmode |
915 @subsection Easy-Mmode | 915 @subsection Easy-Mmode |
916 | 916 |
917 The easy-mmode package provides a convenient way of implementing a | 917 The easy-mmode package provides a convenient way of implementing a |
918 minor mode; with it, you can specify all about a simple minor mode in | 918 minor mode; with it, you can specify everything about a simple minor |
919 one self-contained definition. | 919 mode in one self-contained definition. |
920 | 920 |
921 @defmac easy-mmode-define-minor-mode mode doc &optional init-value mode-indicator keymap | 921 @defmac easy-mmode-define-minor-mode mode doc &optional init-value mode-indicator keymap |
922 @tindex easy-mmode-define-minor-mode | 922 @tindex easy-mmode-define-minor-mode |
923 This macro defines a new minor mode whose name is @var{mode} (a symbol). | 923 This macro defines a new minor mode whose name is @var{mode} (a symbol). |
924 | 924 |
1581 @node Font Lock Basics | 1581 @node Font Lock Basics |
1582 @subsection Font Lock Basics | 1582 @subsection Font Lock Basics |
1583 | 1583 |
1584 There are several variables that control how Font Lock mode highlights | 1584 There are several variables that control how Font Lock mode highlights |
1585 text. But major modes should not set any of these variables directly. | 1585 text. But major modes should not set any of these variables directly. |
1586 Instead, it should set @code{font-lock-defaults} as a buffer-local | 1586 Instead, they should set @code{font-lock-defaults} as a buffer-local |
1587 variable. The value assigned to this variable is used, if and when Font | 1587 variable. The value assigned to this variable is used, if and when Font |
1588 Lock mode is enabled, to set all the other variables. | 1588 Lock mode is enabled, to set all the other variables. |
1589 | 1589 |
1590 @defvar font-lock-defaults | 1590 @defvar font-lock-defaults |
1591 This variable is set by major modes, as a buffer-local variable, to | 1591 This variable is set by major modes, as a buffer-local variable, to |
1620 table is stored in @code{font-lock-syntax-table}. | 1620 table is stored in @code{font-lock-syntax-table}. |
1621 | 1621 |
1622 The fifth element, @var{syntax-begin}, specifies the value of | 1622 The fifth element, @var{syntax-begin}, specifies the value of |
1623 @code{font-lock-beginning-of-syntax-function} (see below). | 1623 @code{font-lock-beginning-of-syntax-function} (see below). |
1624 | 1624 |
1625 Any further elements @var{other-vars} are have form | 1625 Any further elements @var{other-vars} are of the form |
1626 @code{(@var{variable} . @var{value})}. This kind of element means to | 1626 @code{(@var{variable} . @var{value})}. This kind of element means to |
1627 make @var{variable} buffer-local and then set it to @var{value}. This | 1627 make @var{variable} buffer-local and then set it to @var{value}. This |
1628 is used to set other variables that affect fontification. | 1628 is used to set other variables that affect fontification. |
1629 @end defvar | 1629 @end defvar |
1630 | 1630 |
1674 When @var{function} is called, it receives one argument, the limit of | 1674 When @var{function} is called, it receives one argument, the limit of |
1675 the search. It should return non-@code{nil} if it succeeds, and set the | 1675 the search. It should return non-@code{nil} if it succeeds, and set the |
1676 match data to describe the match that was found. | 1676 match data to describe the match that was found. |
1677 | 1677 |
1678 @item (@var{matcher} . @var{match}) | 1678 @item (@var{matcher} . @var{match}) |
1679 In this kind of element, @var{matcher} stands for either a regular | 1679 In this kind of element, @var{matcher} is either a regular |
1680 expression or a function, as described above. The @sc{cdr}, | 1680 expression or a function, as described above. The @sc{cdr}, |
1681 @var{match}, specifies which subexpression of @var{matcher} should be | 1681 @var{match}, specifies which subexpression of @var{matcher} should be |
1682 highlighted (instead of the entire text that @var{matcher} matched). | 1682 highlighted (instead of the entire text that @var{matcher} matched). |
1683 | 1683 |
1684 @example | 1684 @example |