diff options
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 29 | ||||
| -rw-r--r-- | doc/lispref/control.texi | 19 | ||||
| -rw-r--r-- | doc/lispref/customize.texi | 108 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 60 | ||||
| -rw-r--r-- | doc/lispref/keymaps.texi | 39 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 43 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 11 |
7 files changed, 204 insertions, 105 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index bd7b27bbe60..a172f82d2e5 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,9 +1,38 @@ | |||
| 1 | 2012-02-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * modes.texi (Defining Minor Modes): | ||
| 4 | Expand on args of defined minor modes. | ||
| 5 | |||
| 6 | 2012-02-07 Chong Yidong <cyd@gnu.org> | ||
| 7 | |||
| 8 | * variables.texi (Creating Buffer-Local): Minor clarification | ||
| 9 | to buffer-local-variables doc (Bug#10715). | ||
| 10 | |||
| 11 | 2012-02-07 Glenn Morris <rgm@gnu.org> | ||
| 12 | |||
| 13 | * display.texi (ImageMagick Images): General update. | ||
| 14 | Move most details of imagemagick-render-type to the variable's doc. | ||
| 15 | |||
| 16 | 2012-02-06 Glenn Morris <rgm@gnu.org> | ||
| 17 | |||
| 18 | * keymaps.texi (Tool Bar): Mention separators. | ||
| 19 | (Inheritance and Keymaps): | ||
| 20 | Mention make-composed-keymap and multiple inheritance. | ||
| 21 | |||
| 22 | * modes.texi (Running Hooks): Mention run-hook-wrapped. | ||
| 23 | |||
| 24 | * control.texi (Handling Errors): | ||
| 25 | Mention condition-case-no-debug and with-demoted-errors. | ||
| 26 | |||
| 1 | 2012-02-05 Chong Yidong <cyd@gnu.org> | 27 | 2012-02-05 Chong Yidong <cyd@gnu.org> |
| 2 | 28 | ||
| 3 | * customize.texi (Common Keywords): Minor clarifications. | 29 | * customize.texi (Common Keywords): Minor clarifications. |
| 4 | Document custom-unlispify-remove-prefixes. | 30 | Document custom-unlispify-remove-prefixes. |
| 5 | (Variable Definitions): Backquotes in defcustom seem to work fine | 31 | (Variable Definitions): Backquotes in defcustom seem to work fine |
| 6 | now. Various other copyedits. | 32 | now. Various other copyedits. |
| 33 | (Simple Types): Copyedits. Document color selector. | ||
| 34 | (Composite Types): Copyedits. | ||
| 35 | (Splicing into Lists): Clarifications. | ||
| 7 | 36 | ||
| 8 | * eval.texi (Backquote): Move from macros.texi. | 37 | * eval.texi (Backquote): Move from macros.texi. |
| 9 | 38 | ||
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 0511f21007d..3673f753a0a 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi | |||
| @@ -891,9 +891,8 @@ establishing an error handler, with the special form | |||
| 891 | 891 | ||
| 892 | @noindent | 892 | @noindent |
| 893 | This deletes the file named @var{filename}, catching any error and | 893 | This deletes the file named @var{filename}, catching any error and |
| 894 | returning @code{nil} if an error occurs@footnote{ | 894 | returning @code{nil} if an error occurs. (You can use the macro |
| 895 | Actually, you should use @code{ignore-errors} in such a simple case; | 895 | @code{ignore-errors} for a simple case like this; see below.) |
| 896 | see below.}. | ||
| 897 | 896 | ||
| 898 | The @code{condition-case} construct is often used to trap errors that | 897 | The @code{condition-case} construct is often used to trap errors that |
| 899 | are predictable, such as failure to open a file in a call to | 898 | are predictable, such as failure to open a file in a call to |
| @@ -949,6 +948,13 @@ The effect of @code{debug} here is only to prevent | |||
| 949 | given error will invoke the debugger only if @code{debug-on-error} and | 948 | given error will invoke the debugger only if @code{debug-on-error} and |
| 950 | the other usual filtering mechanisms say it should. @xref{Error Debugging}. | 949 | the other usual filtering mechanisms say it should. @xref{Error Debugging}. |
| 951 | 950 | ||
| 951 | @defmac condition-case-no-debug var protected-form handlers@dots{} | ||
| 952 | The macro @code{condition-case-no-debug} provides another way to | ||
| 953 | handle debugging of such forms. It behaves exactly like | ||
| 954 | @code{condition-case}, unless the variable @code{debug-on-error} is | ||
| 955 | non-@code{nil}, in which case it does not handle any errors at all. | ||
| 956 | @end defmac | ||
| 957 | |||
| 952 | Once Emacs decides that a certain handler handles the error, it | 958 | Once Emacs decides that a certain handler handles the error, it |
| 953 | returns control to that handler. To do so, Emacs unbinds all variable | 959 | returns control to that handler. To do so, Emacs unbinds all variable |
| 954 | bindings made by binding constructs that are being exited, and | 960 | bindings made by binding constructs that are being exited, and |
| @@ -1122,6 +1128,13 @@ Here's the example at the beginning of this subsection rewritten using | |||
| 1122 | @end smallexample | 1128 | @end smallexample |
| 1123 | @end defmac | 1129 | @end defmac |
| 1124 | 1130 | ||
| 1131 | @defmac with-demoted-errors body@dots{} | ||
| 1132 | This macro is like a milder version of @code{ignore-errors}. Rather | ||
| 1133 | than suppressing errors altogether, it converts them into messages. | ||
| 1134 | Use this form around code that is not expected to signal errors, | ||
| 1135 | but should be robust if one does occur. Note that this macro | ||
| 1136 | uses @code{condition-case-no-debug} rather than @code{condition-case}. | ||
| 1137 | @end defmac | ||
| 1125 | 1138 | ||
| 1126 | @node Error Symbols | 1139 | @node Error Symbols |
| 1127 | @subsubsection Error Symbols and Condition Names | 1140 | @subsubsection Error Symbols and Condition Names |
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index b8c30fff8ae..4c3adee0db5 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi | |||
| @@ -519,30 +519,28 @@ Introduction, widget, The Emacs Widget Library}, for details. | |||
| 519 | @node Simple Types | 519 | @node Simple Types |
| 520 | @subsection Simple Types | 520 | @subsection Simple Types |
| 521 | 521 | ||
| 522 | This section describes all the simple customization types. | 522 | This section describes all the simple customization types. For |
| 523 | several of these customization types, the customization widget | ||
| 524 | provides inline completion with @kbd{C-M-i} or @kbd{M-@key{TAB}}. | ||
| 523 | 525 | ||
| 524 | @table @code | 526 | @table @code |
| 525 | @item sexp | 527 | @item sexp |
| 526 | The value may be any Lisp object that can be printed and read back. You | 528 | The value may be any Lisp object that can be printed and read back. |
| 527 | can use @code{sexp} as a fall-back for any option, if you don't want to | 529 | You can use @code{sexp} as a fall-back for any option, if you don't |
| 528 | take the time to work out a more specific type to use. | 530 | want to take the time to work out a more specific type to use. |
| 529 | 531 | ||
| 530 | @item integer | 532 | @item integer |
| 531 | The value must be an integer, and is represented textually | 533 | The value must be an integer. |
| 532 | in the customization buffer. | ||
| 533 | 534 | ||
| 534 | @item number | 535 | @item number |
| 535 | The value must be a number (floating point or integer), and is | 536 | The value must be a number (floating point or integer). |
| 536 | represented textually in the customization buffer. | ||
| 537 | 537 | ||
| 538 | @item float | 538 | @item float |
| 539 | The value must be a floating point number, and is represented | 539 | The value must be a floating point number. |
| 540 | textually in the customization buffer. | ||
| 541 | 540 | ||
| 542 | @item string | 541 | @item string |
| 543 | The value must be a string, and the customization buffer shows just the | 542 | The value must be a string. The customization buffer shows the string |
| 544 | contents, with no delimiting @samp{"} characters and no quoting with | 543 | without delimiting @samp{"} characters or @samp{\} quotes. |
| 545 | @samp{\}. | ||
| 546 | 544 | ||
| 547 | @item regexp | 545 | @item regexp |
| 548 | Like @code{string} except that the string must be a valid regular | 546 | Like @code{string} except that the string must be a valid regular |
| @@ -554,39 +552,35 @@ integer, but this type shows the value by inserting the character in the | |||
| 554 | buffer, rather than by showing the number. | 552 | buffer, rather than by showing the number. |
| 555 | 553 | ||
| 556 | @item file | 554 | @item file |
| 557 | The value must be a file name, and you can do completion with | 555 | The value must be a file name. The widget provides completion. |
| 558 | @kbd{M-@key{TAB}}. | ||
| 559 | 556 | ||
| 560 | @item (file :must-match t) | 557 | @item (file :must-match t) |
| 561 | The value must be a file name for an existing file, and you can do | 558 | The value must be a file name for an existing file. The widget |
| 562 | completion with @kbd{M-@key{TAB}}. | 559 | provides completion. |
| 563 | 560 | ||
| 564 | @item directory | 561 | @item directory |
| 565 | The value must be a directory name, and you can do completion with | 562 | The value must be a directory name. The widget provides completion. |
| 566 | @kbd{M-@key{TAB}}. | ||
| 567 | 563 | ||
| 568 | @item hook | 564 | @item hook |
| 569 | The value must be a list of functions (or a single function, but that is | 565 | The value must be a list of functions. This customization type is |
| 570 | obsolete usage). This customization type is used for hook variables. | 566 | used for hook variables. You can use the @code{:options} keyword in a |
| 571 | You can use the @code{:options} keyword in a hook variable's | 567 | hook variable's @code{defcustom} to specify a list of functions |
| 572 | @code{defcustom} to specify a list of functions recommended for use in | 568 | recommended for use in the hook; @xref{Variable Definitions}. |
| 573 | the hook; see @ref{Variable Definitions}. | ||
| 574 | 569 | ||
| 575 | @item symbol | 570 | @item symbol |
| 576 | The value must be a symbol. It appears in the customization buffer as | 571 | The value must be a symbol. It appears in the customization buffer as |
| 577 | the name of the symbol. | 572 | the symbol name. The widget provides completion. |
| 578 | 573 | ||
| 579 | @item function | 574 | @item function |
| 580 | The value must be either a lambda expression or a function name. When | 575 | The value must be either a lambda expression or a function name. The |
| 581 | it is a function name, you can do completion with @kbd{M-@key{TAB}}. | 576 | widget provides completion for function names. |
| 582 | 577 | ||
| 583 | @item variable | 578 | @item variable |
| 584 | The value must be a variable name, and you can do completion with | 579 | The value must be a variable name. The widget provides completion. |
| 585 | @kbd{M-@key{TAB}}. | ||
| 586 | 580 | ||
| 587 | @item face | 581 | @item face |
| 588 | The value must be a symbol which is a face name, and you can do | 582 | The value must be a symbol which is a face name. The widget provides |
| 589 | completion with @kbd{M-@key{TAB}}. | 583 | completion. |
| 590 | 584 | ||
| 591 | @item boolean | 585 | @item boolean |
| 592 | The value is boolean---either @code{nil} or @code{t}. Note that by | 586 | The value is boolean---either @code{nil} or @code{t}. Note that by |
| @@ -600,8 +594,10 @@ The value must be a coding-system name, and you can do completion with | |||
| 600 | @kbd{M-@key{TAB}}. | 594 | @kbd{M-@key{TAB}}. |
| 601 | 595 | ||
| 602 | @item color | 596 | @item color |
| 603 | The value must be a valid color name, and you can do completion with | 597 | The value must be a valid color name. The widget provides completion |
| 604 | @kbd{M-@key{TAB}}. A sample is provided. | 598 | for color names, as well as a sample and a button for selecting a |
| 599 | color name from a list of color names shown in a @samp{*Colors*} | ||
| 600 | buffer. | ||
| 605 | @end table | 601 | @end table |
| 606 | 602 | ||
| 607 | @node Composite Types | 603 | @node Composite Types |
| @@ -635,9 +631,8 @@ its @sc{cdr} must fit @var{cdr-type}. For example, @code{(cons string | |||
| 635 | symbol)} is a customization type which matches values such as | 631 | symbol)} is a customization type which matches values such as |
| 636 | @code{("foo" . foo)}. | 632 | @code{("foo" . foo)}. |
| 637 | 633 | ||
| 638 | In the customization buffer, the @sc{car} and the @sc{cdr} are | 634 | In the customization buffer, the @sc{car} and @sc{cdr} are displayed |
| 639 | displayed and edited separately, each according to the type | 635 | and edited separately, each according to their specified type. |
| 640 | that you specify for it. | ||
| 641 | 636 | ||
| 642 | @item (list @var{element-types}@dots{}) | 637 | @item (list @var{element-types}@dots{}) |
| 643 | The value must be a list with exactly as many elements as the | 638 | The value must be a list with exactly as many elements as the |
| @@ -680,7 +675,7 @@ specified by the @code{:options} keyword argument. | |||
| 680 | 675 | ||
| 681 | The argument to the @code{:options} keywords should be a list of | 676 | The argument to the @code{:options} keywords should be a list of |
| 682 | specifications for reasonable keys in the alist. Ordinarily, they are | 677 | specifications for reasonable keys in the alist. Ordinarily, they are |
| 683 | simply atoms, which stand for themselves as. For example: | 678 | simply atoms, which stand for themselves. For example: |
| 684 | 679 | ||
| 685 | @smallexample | 680 | @smallexample |
| 686 | :options '("foo" "bar" "baz") | 681 | :options '("foo" "bar" "baz") |
| @@ -753,14 +748,6 @@ key, using variations of this trick: | |||
| 753 | "Alist of basic info about people. | 748 | "Alist of basic info about people. |
| 754 | Each element has the form (NAME AGE MALE-FLAG)." | 749 | Each element has the form (NAME AGE MALE-FLAG)." |
| 755 | :type '(alist :value-type (group integer boolean))) | 750 | :type '(alist :value-type (group integer boolean))) |
| 756 | |||
| 757 | (defcustom pets '(("brian") | ||
| 758 | ("dorith" "dog" "guppy") | ||
| 759 | ("ken" "cat")) | ||
| 760 | "Alist of people's pets. | ||
| 761 | In an element (KEY . VALUE), KEY is the person's name, | ||
| 762 | and the VALUE is a list of that person's pets." | ||
| 763 | :type '(alist :value-type (repeat string))) | ||
| 764 | @end smallexample | 751 | @end smallexample |
| 765 | 752 | ||
| 766 | @item (plist :key-type @var{key-type} :value-type @var{value-type}) | 753 | @item (plist :key-type @var{key-type} :value-type @var{value-type}) |
| @@ -770,9 +757,8 @@ that (i) the information is stored as a property list, | |||
| 770 | defaults to @code{symbol} rather than @code{sexp}. | 757 | defaults to @code{symbol} rather than @code{sexp}. |
| 771 | 758 | ||
| 772 | @item (choice @var{alternative-types}@dots{}) | 759 | @item (choice @var{alternative-types}@dots{}) |
| 773 | The value must fit at least one of @var{alternative-types}. | 760 | The value must fit one of @var{alternative-types}. For example, |
| 774 | For example, @code{(choice integer string)} allows either an | 761 | @code{(choice integer string)} allows either an integer or a string. |
| 775 | integer or a string. | ||
| 776 | 762 | ||
| 777 | In the customization buffer, the user selects an alternative | 763 | In the customization buffer, the user selects an alternative |
| 778 | using a menu, and can then edit the value in the usual way for that | 764 | using a menu, and can then edit the value in the usual way for that |
| @@ -964,20 +950,18 @@ whatever follows the last keyword-value pair. | |||
| 964 | @subsection Splicing into Lists | 950 | @subsection Splicing into Lists |
| 965 | 951 | ||
| 966 | The @code{:inline} feature lets you splice a variable number of | 952 | The @code{:inline} feature lets you splice a variable number of |
| 967 | elements into the middle of a list or vector. You use it in a | 953 | elements into the middle of a @code{list} or @code{vector} |
| 968 | @code{set}, @code{choice} or @code{repeat} type which appears among the | 954 | customization type. You use it by adding @code{:inline t} to a type |
| 969 | element-types of a @code{list} or @code{vector}. | 955 | specification which is contained in a @code{list} or @code{vector} |
| 970 | 956 | specification. | |
| 971 | Normally, each of the element-types in a @code{list} or @code{vector} | 957 | |
| 972 | describes one and only one element of the list or vector. Thus, if an | 958 | Normally, each entry in a @code{list} or @code{vector} type |
| 973 | element-type is a @code{repeat}, that specifies a list of unspecified | 959 | specification describes a single element type. But when an entry |
| 974 | length which appears as one element. | 960 | contains @code{:inline t}, the value it matches is merged directly |
| 975 | 961 | into the containing sequence. For example, if the entry matches a | |
| 976 | But when the element-type uses @code{:inline}, the value it matches is | 962 | list with three elements, those become three elements of the overall |
| 977 | merged directly into the containing sequence. For example, if it | 963 | sequence. This is analogous to @samp{,@@} in a backquote construct |
| 978 | matches a list with three elements, those become three elements of the | 964 | (@pxref{Backquote}). |
| 979 | overall sequence. This is analogous to using @samp{,@@} in the backquote | ||
| 980 | construct. | ||
| 981 | 965 | ||
| 982 | For example, to specify a list whose first element must be @code{baz} | 966 | For example, to specify a list whose first element must be @code{baz} |
| 983 | and whose remaining arguments should be zero or more of @code{foo} and | 967 | and whose remaining arguments should be zero or more of @code{foo} and |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index e97e6c264a3..d5870fd3abb 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -4527,30 +4527,51 @@ specifying the bounding box of the PostScript image, analogous to the | |||
| 4527 | support, you can use the ImageMagick library to load many image formats. | 4527 | support, you can use the ImageMagick library to load many image formats. |
| 4528 | 4528 | ||
| 4529 | @findex imagemagick-types | 4529 | @findex imagemagick-types |
| 4530 | @findex imagemagick-register-types | ||
| 4530 | The function @code{imagemagick-types} returns a list of image file | 4531 | The function @code{imagemagick-types} returns a list of image file |
| 4531 | extensions that your installation of ImageMagick supports. To enable | 4532 | extensions that your installation of ImageMagick supports. To enable |
| 4532 | support, you must call the function @code{imagemagick-register-types}. | 4533 | support, you must call the function @code{imagemagick-register-types}. |
| 4534 | This enables Emacs to visit these file types in @code{image-mode} | ||
| 4535 | (@pxref{File Conveniences,,, emacs, The GNU Emacs Manual}). | ||
| 4536 | If your Emacs was not compiled with ImageMagick support, then | ||
| 4537 | @code{imagemagick-types} will be undefined and | ||
| 4538 | @code{imagemagick-register-types} will do nothing. | ||
| 4533 | 4539 | ||
| 4534 | @vindex imagemagick-types-inhibit | 4540 | @vindex imagemagick-types-inhibit |
| 4535 | The variable @code{imagemagick-types-inhibit} specifies a list of | 4541 | The variable @code{imagemagick-types-inhibit} specifies a list of |
| 4536 | image types that you do @emph{not} want ImageMagick to handle. There | 4542 | image types that you do @emph{not} want ImageMagick to handle. It is |
| 4537 | may be overlap between image loaders in your Emacs installation, and | 4543 | a list of symbols, each of which has the same name as one of the |
| 4538 | you may prefer to use a different one for a given image type (which | 4544 | format tags used internally by ImageMagick (i.e., as |
| 4539 | @c FIXME how is this priority determined? | 4545 | @code{imagemagick-types} returns). ImageMagick has a very broad |
| 4540 | loader will be used in practice depends on the priority of the loaders). | 4546 | definition of what an image is, for example it includes such file |
| 4541 | @c FIXME why are these uppercase when image-types is lower-case? | 4547 | types as C files and HTML files. It is not appropriate to treat these |
| 4542 | @c FIXME what are the possible options? Are these actually file extensions? | 4548 | as images in Emacs. You can add any other ImageMagick type that you |
| 4543 | For example, if you never want to use the ImageMagick loader to use | 4549 | wish to this list. |
| 4550 | @ignore | ||
| 4551 | @c I don't know what this means. I suspect it means eg loading jpg | ||
| 4552 | @c images via libjpeg or ImageMagick. But it doesn't work. | ||
| 4553 | @c If you don't have libjpeg support compiled in, you cannot | ||
| 4554 | @c view jpeg images, even if you have imagemagick support: | ||
| 4555 | @c http://debbugs.gnu.org/9045 | ||
| 4556 | @c And if you have both compiled in, then you always get | ||
| 4557 | @c the libjpeg version: | ||
| 4558 | @c http://debbugs.gnu.org/10746 | ||
| 4559 | There may be overlap between image loaders in your Emacs installation, | ||
| 4560 | and you may prefer to use a different one for a given image type | ||
| 4561 | (which loader will be used in practice depends on the priority of the | ||
| 4562 | loaders). | ||
| 4563 | For example, if you never want to use the ImageMagick loader to view | ||
| 4544 | JPEG files, add @code{JPG} to this list. | 4564 | JPEG files, add @code{JPG} to this list. |
| 4565 | @end ignore | ||
| 4566 | Note that ImageMagick often distinguishes between several different | ||
| 4567 | types of a particular format (e.g., @code{JPG}, @code{JPEG}, | ||
| 4568 | @code{PJPEG}, etc.), and you may need to add all versions to this | ||
| 4569 | list. | ||
| 4545 | 4570 | ||
| 4571 | @c Not sure this should even be in the manual at all. | ||
| 4546 | @vindex imagemagick-render-type | 4572 | @vindex imagemagick-render-type |
| 4547 | You can set the variable @code{imagemagick-render-type} to choose | 4573 | If you wish to experiment with the performance of the ImageMagick |
| 4548 | between screen render methods for the ImageMagick loader. The options | 4574 | loader, see the variable @code{imagemagick-render-type}. |
| 4549 | are: @code{0}, a conservative method which works with older | ||
| 4550 | @c FIXME details of this "newer method"? | ||
| 4551 | @c Presumably it is faster but may be less "robust"? | ||
| 4552 | ImageMagick versions (it is a bit slow, but robust); and @code{1}, | ||
| 4553 | a newer ImageMagick method. | ||
| 4554 | 4575 | ||
| 4555 | Images loaded with ImageMagick support a few new display specifications: | 4576 | Images loaded with ImageMagick support a few new display specifications: |
| 4556 | 4577 | ||
| @@ -4565,10 +4586,11 @@ aspect ratio may not be preserved. | |||
| 4565 | Specifies a rotation angle in degrees. | 4586 | Specifies a rotation angle in degrees. |
| 4566 | 4587 | ||
| 4567 | @item :index | 4588 | @item :index |
| 4568 | Specifies which image to view inside an image bundle file format, such | 4589 | @c Doesn't work: http://debbugs.gnu.org/7978 |
| 4569 | as TIFF or DJVM. You can use the @code{image-metadata} function to | 4590 | This has the same meaning as it does for GIF images (@pxref{GIF Images}), |
| 4570 | retrieve the total number of images in an image bundle (this is | 4591 | i.e. it specifies which image to view inside an image bundle file format |
| 4571 | similar to how GIF files work). | 4592 | such as DJVM. You can use the @code{image-metadata} function to |
| 4593 | retrieve the total number of images in an image bundle. | ||
| 4572 | @end table | 4594 | @end table |
| 4573 | 4595 | ||
| 4574 | 4596 | ||
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 8e03ade285f..a8528a548fc 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi | |||
| @@ -432,6 +432,34 @@ for every numeric character code without modifier bits, even if it is | |||
| 432 | @code{nil}, so these character's bindings are never inherited from | 432 | @code{nil}, so these character's bindings are never inherited from |
| 433 | the parent keymap. | 433 | the parent keymap. |
| 434 | 434 | ||
| 435 | @cindex keymap inheritance from multiple maps | ||
| 436 | Sometimes you want to make a keymap that inherits from more than one | ||
| 437 | map. You can use the function @code{make-composed-keymap} for this. | ||
| 438 | |||
| 439 | @defun make-composed-keymap maps &optional parent | ||
| 440 | This function returns a new keymap composed of the existing keymap(s) | ||
| 441 | @var{maps}, and optionally inheriting from a parent keymap | ||
| 442 | @var{parent}. @var{maps} can be a single keymap or a list of more | ||
| 443 | than one. When looking up a key in the resulting new map, Emacs | ||
| 444 | searches in each of the @var{maps}, and then in @var{parent}, stopping | ||
| 445 | at the first match. A @code{nil} binding in any one of @var{maps} | ||
| 446 | overrides any binding in @var{parent}, but not a non-@code{nil} binding | ||
| 447 | in any other of the @var{maps}. | ||
| 448 | @end defun | ||
| 449 | |||
| 450 | @noindent For example, here is how Emacs sets the parent of | ||
| 451 | @code{help-mode-map}, such that it inherits from both | ||
| 452 | @code{button-buffer-map} and @code{special-mode-map}: | ||
| 453 | |||
| 454 | @example | ||
| 455 | (defvar help-mode-map | ||
| 456 | (let ((map (make-sparse-keymap))) | ||
| 457 | (set-keymap-parent map (make-composed-keymap button-buffer-map | ||
| 458 | special-mode-map)) | ||
| 459 | ... map) ... ) | ||
| 460 | @end example | ||
| 461 | |||
| 462 | |||
| 435 | @node Prefix Keys | 463 | @node Prefix Keys |
| 436 | @section Prefix Keys | 464 | @section Prefix Keys |
| 437 | @cindex prefix key | 465 | @cindex prefix key |
| @@ -2318,7 +2346,7 @@ The various toolkits with which you can build Emacs do not all support | |||
| 2318 | the same set of features for menus. Some code works as expected with | 2346 | the same set of features for menus. Some code works as expected with |
| 2319 | one toolkit, but not under another. | 2347 | one toolkit, but not under another. |
| 2320 | 2348 | ||
| 2321 | One example is menu actions or buttons in a top-level menu-bar. The | 2349 | One example is menu actions or buttons in a top-level menu bar. The |
| 2322 | following works with the Lucid toolkit or on MS Windows, but not with | 2350 | following works with the Lucid toolkit or on MS Windows, but not with |
| 2323 | GTK or Nextstep, where clicking on the item has no effect. | 2351 | GTK or Nextstep, where clicking on the item has no effect. |
| 2324 | 2352 | ||
| @@ -2658,6 +2686,15 @@ The @code{:rtl} property specifies an alternative image to use for | |||
| 2658 | right-to-left languages. Only the Gtk+ version of Emacs supports this | 2686 | right-to-left languages. Only the Gtk+ version of Emacs supports this |
| 2659 | at present. | 2687 | at present. |
| 2660 | 2688 | ||
| 2689 | Like the menu bar, the tool bar can display separators (@pxref{Menu | ||
| 2690 | Separators}). Tool bar separators are vertical rather than | ||
| 2691 | horizontal, though, and only a single style is supported. Separators | ||
| 2692 | are represented in the tool bar keymap in the same way as for the | ||
| 2693 | menu bar, i.e. using a @code{(menu-item "--"}) entry. The Gtk+ and | ||
| 2694 | Nextstep tool bars render separators natively, otherwise Emacs selects | ||
| 2695 | a separator image that is appropriate for the display. Note that tool | ||
| 2696 | bar separators do not support any properties, such as @code{:visible}. | ||
| 2697 | |||
| 2661 | The default tool bar is defined so that items specific to editing do not | 2698 | The default tool bar is defined so that items specific to editing do not |
| 2662 | appear for major modes whose command symbol has a @code{mode-class} | 2699 | appear for major modes whose command symbol has a @code{mode-class} |
| 2663 | property of @code{special} (@pxref{Major Mode Conventions}). Major | 2700 | property of @code{special} (@pxref{Major Mode Conventions}). Major |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 638ab89e37f..052fd037167 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -163,6 +163,14 @@ A wrapper-hook also allows for a hook function to completely replace the | |||
| 163 | default definition (by not calling @var{fun}). | 163 | default definition (by not calling @var{fun}). |
| 164 | @end defmac | 164 | @end defmac |
| 165 | 165 | ||
| 166 | @defun run-hook-wrapped hook wrap-function &rest args | ||
| 167 | This function is similar to @code{run-hook-with-args-until-success}. | ||
| 168 | Like that function, it runs the functions on the abnormal hook | ||
| 169 | @code{hook}, stopping at the first one that returns non-@code{nil}. | ||
| 170 | Instead of calling the hook functions directly, though, it actually | ||
| 171 | calls @code{wrap-function} with arguments @code{fun} and @code{args}. | ||
| 172 | @end defun | ||
| 173 | |||
| 166 | @node Setting Hooks | 174 | @node Setting Hooks |
| 167 | @subsection Setting Hooks | 175 | @subsection Setting Hooks |
| 168 | 176 | ||
| @@ -1372,11 +1380,21 @@ implementing a mode in one self-contained definition. | |||
| 1372 | @defmac define-minor-mode mode doc [init-value [lighter [keymap]]] keyword-args@dots{} body@dots{} | 1380 | @defmac define-minor-mode mode doc [init-value [lighter [keymap]]] keyword-args@dots{} body@dots{} |
| 1373 | This macro defines a new minor mode whose name is @var{mode} (a | 1381 | This macro defines a new minor mode whose name is @var{mode} (a |
| 1374 | symbol). It defines a command named @var{mode} to toggle the minor | 1382 | symbol). It defines a command named @var{mode} to toggle the minor |
| 1375 | mode, with @var{doc} as its documentation string. By default, it also | 1383 | mode, with @var{doc} as its documentation string. |
| 1376 | defines a variable named @var{mode}, which is set to @code{t} or | 1384 | |
| 1377 | @code{nil} by enabling or disabling the mode. The variable is | 1385 | The toggle command takes one optional (prefix) argument. |
| 1378 | initialized to @var{init-value}. Except in unusual circumstances (see | 1386 | If called interactively with no argument it toggles the mode on or off. |
| 1379 | below), this value must be @code{nil}. | 1387 | A positive prefix argument enables the mode, any other prefix argument |
| 1388 | disables it. From Lisp, an argument of @code{toggle} toggles the mode, | ||
| 1389 | whereas an omitted or @code{nil} argument enables the mode. | ||
| 1390 | This makes it easy to enable the minor mode in a major mode hook, for example. | ||
| 1391 | If @var{doc} is nil, the macro supplies a default documentation string | ||
| 1392 | explaining the above. | ||
| 1393 | |||
| 1394 | By default, it also defines a variable named @var{mode}, which is set to | ||
| 1395 | @code{t} or @code{nil} by enabling or disabling the mode. The variable | ||
| 1396 | is initialized to @var{init-value}. Except in unusual circumstances | ||
| 1397 | (see below), this value must be @code{nil}. | ||
| 1380 | 1398 | ||
| 1381 | The string @var{lighter} says what to display in the mode line | 1399 | The string @var{lighter} says what to display in the mode line |
| 1382 | when the mode is enabled; if it is @code{nil}, the mode is not displayed | 1400 | when the mode is enabled; if it is @code{nil}, the mode is not displayed |
| @@ -1470,9 +1488,10 @@ for this macro. | |||
| 1470 | @smallexample | 1488 | @smallexample |
| 1471 | (define-minor-mode hungry-mode | 1489 | (define-minor-mode hungry-mode |
| 1472 | "Toggle Hungry mode. | 1490 | "Toggle Hungry mode. |
| 1473 | With no argument, this command toggles the mode. | 1491 | Interactively with no argument, this command toggles the mode. |
| 1474 | Non-null prefix argument turns on the mode. | 1492 | A positive prefix argument enables the mode, any other prefix |
| 1475 | Null prefix argument turns off the mode. | 1493 | argument disables it. From Lisp, argument omitted or nil enables |
| 1494 | the mode, `toggle' toggles the state. | ||
| 1476 | 1495 | ||
| 1477 | When Hungry mode is enabled, the control delete key | 1496 | When Hungry mode is enabled, the control delete key |
| 1478 | gobbles all preceding whitespace except the last. | 1497 | gobbles all preceding whitespace except the last. |
| @@ -1501,13 +1520,7 @@ minor modes don't need any. | |||
| 1501 | @smallexample | 1520 | @smallexample |
| 1502 | (define-minor-mode hungry-mode | 1521 | (define-minor-mode hungry-mode |
| 1503 | "Toggle Hungry mode. | 1522 | "Toggle Hungry mode. |
| 1504 | With no argument, this command toggles the mode. | 1523 | ...rest of documentation as before..." |
| 1505 | Non-null prefix argument turns on the mode. | ||
| 1506 | Null prefix argument turns off the mode. | ||
| 1507 | |||
| 1508 | When Hungry mode is enabled, the control delete key | ||
| 1509 | gobbles all preceding whitespace except the last. | ||
| 1510 | See the command \\[hungry-electric-delete]." | ||
| 1511 | ;; The initial value. | 1524 | ;; The initial value. |
| 1512 | :init-value nil | 1525 | :init-value nil |
| 1513 | ;; The indicator for the mode line. | 1526 | ;; The indicator for the mode line. |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index bdb16cd10a8..ab3a4edc0ac 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -1317,11 +1317,12 @@ value (@pxref{Default Value}) of @var{variable} instead. | |||
| 1317 | 1317 | ||
| 1318 | @defun buffer-local-variables &optional buffer | 1318 | @defun buffer-local-variables &optional buffer |
| 1319 | This function returns a list describing the buffer-local variables in | 1319 | This function returns a list describing the buffer-local variables in |
| 1320 | buffer @var{buffer}. (If @var{buffer} is omitted, the current buffer is | 1320 | buffer @var{buffer}. (If @var{buffer} is omitted, the current buffer |
| 1321 | used.) It returns an association list (@pxref{Association Lists}) in | 1321 | is used.) Normally, each list element has the form |
| 1322 | which each element contains one buffer-local variable and its value. | 1322 | @w{@code{(@var{sym} . @var{val})}}, where @var{sym} is a buffer-local |
| 1323 | However, when a variable's buffer-local binding in @var{buffer} is void, | 1323 | variable (a symbol) and @var{val} is its buffer-local value. But when |
| 1324 | then the variable appears directly in the resulting list. | 1324 | a variable's buffer-local binding in @var{buffer} is void, its list |
| 1325 | element is just @var{sym}. | ||
| 1325 | 1326 | ||
| 1326 | @example | 1327 | @example |
| 1327 | @group | 1328 | @group |