diff options
| author | Glenn Morris | 2012-02-01 21:57:26 -0500 |
|---|---|---|
| committer | Glenn Morris | 2012-02-01 21:57:26 -0500 |
| commit | 12f381b73de44148af86efd823ff69c637dedeec (patch) | |
| tree | 45feea574b567912406e1039861c837b392511e8 /doc/lispref | |
| parent | 44f9273998bc2b42e2b17b4bb35b4e0f0e1cf27d (diff) | |
| download | emacs-12f381b73de44148af86efd823ff69c637dedeec.tar.gz emacs-12f381b73de44148af86efd823ff69c637dedeec.zip | |
Document change-major-mode-after-body-hook
* doc/lispref/hooks.texi (Standard Hooks):
* doc/lispref/modes.texi (Major Mode Conventions, Mode Hooks):
Document change-major-mode-after-body-hook.
* lisp/subr.el (run-mode-hooks): Doc fix.
* etc/NEWS: Markup
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/lispref/hooks.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 27 |
3 files changed, 27 insertions, 9 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 6a8b7750f0b..1ba070dccc0 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-02-02 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * hooks.texi (Standard Hooks): | ||
| 4 | * modes.texi (Major Mode Conventions, Mode Hooks): | ||
| 5 | Document change-major-mode-after-body-hook. | ||
| 6 | |||
| 1 | 2012-02-01 Glenn Morris <rgm@gnu.org> | 7 | 2012-02-01 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * modes.texi (Defining Minor Modes): | 9 | * modes.texi (Defining Minor Modes): |
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi index 95655324ab4..b311da66110 100644 --- a/doc/lispref/hooks.texi +++ b/doc/lispref/hooks.texi | |||
| @@ -127,6 +127,9 @@ not exactly a hook, but does a similar job. | |||
| 127 | @xref{Calendar Customizing,,, emacs}. | 127 | @xref{Calendar Customizing,,, emacs}. |
| 128 | @end ifnottex | 128 | @end ifnottex |
| 129 | 129 | ||
| 130 | @item change-major-mode-after-body-hook | ||
| 131 | @xref{Mode Hooks}. | ||
| 132 | |||
| 130 | @item change-major-mode-hook | 133 | @item change-major-mode-hook |
| 131 | @xref{Creating Buffer-Local}. | 134 | @xref{Creating Buffer-Local}. |
| 132 | 135 | ||
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index f8a21e003e0..e142be44e0d 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -468,8 +468,9 @@ other packages would interfere with them. | |||
| 468 | @cindex major mode hook | 468 | @cindex major mode hook |
| 469 | Each major mode should have a normal @dfn{mode hook} named | 469 | Each major mode should have a normal @dfn{mode hook} named |
| 470 | @code{@var{modename}-mode-hook}. The very last thing the major mode command | 470 | @code{@var{modename}-mode-hook}. The very last thing the major mode command |
| 471 | should do is to call @code{run-mode-hooks}. This runs the mode hook, | 471 | should do is to call @code{run-mode-hooks}. This runs the normal |
| 472 | and then runs the normal hook @code{after-change-major-mode-hook}. | 472 | hook @code{change-major-mode-after-body-hook}, the mode hook, |
| 473 | and then the normal hook @code{after-change-major-mode-hook}. | ||
| 473 | @xref{Mode Hooks}. | 474 | @xref{Mode Hooks}. |
| 474 | 475 | ||
| 475 | @item | 476 | @item |
| @@ -939,8 +940,9 @@ before it runs the mode hook variable @code{@var{mode}-hook}. | |||
| 939 | @node Mode Hooks | 940 | @node Mode Hooks |
| 940 | @subsection Mode Hooks | 941 | @subsection Mode Hooks |
| 941 | 942 | ||
| 942 | Every major mode command should finish by running its mode hook and | 943 | Every major mode command should finish by running the mode-independent |
| 943 | the mode-independent normal hook @code{after-change-major-mode-hook}. | 944 | normal hook @code{change-major-mode-after-body-hook}, its mode hook, |
| 945 | and the normal hook @code{after-change-major-mode-hook}. | ||
| 944 | It does this by calling @code{run-mode-hooks}. If the major mode is a | 946 | It does this by calling @code{run-mode-hooks}. If the major mode is a |
| 945 | derived mode, that is if it calls another major mode (the parent mode) | 947 | derived mode, that is if it calls another major mode (the parent mode) |
| 946 | in its body, it should do this inside @code{delay-mode-hooks} so that | 948 | in its body, it should do this inside @code{delay-mode-hooks} so that |
| @@ -949,11 +951,12 @@ call to @code{run-mode-hooks} runs the parent's mode hook too. | |||
| 949 | @xref{Major Mode Conventions}. | 951 | @xref{Major Mode Conventions}. |
| 950 | 952 | ||
| 951 | Emacs versions before Emacs 22 did not have @code{delay-mode-hooks}. | 953 | Emacs versions before Emacs 22 did not have @code{delay-mode-hooks}. |
| 952 | When user-implemented major modes have not been updated to use it, | 954 | Versions before 24 did not have @code{change-major-mode-after-body-hook}. |
| 953 | they won't entirely follow these conventions: they may run the | 955 | When user-implemented major modes do not use @code{run-mode-hooks} and |
| 954 | parent's mode hook too early, or fail to run | 956 | have not been updated to use these newer features, they won't entirely |
| 955 | @code{after-change-major-mode-hook}. If you encounter such a major | 957 | follow these conventions: they may run the parent's mode hook too early, |
| 956 | mode, please correct it to follow these conventions. | 958 | or fail to run @code{after-change-major-mode-hook}. If you encounter |
| 959 | such a major mode, please correct it to follow these conventions. | ||
| 957 | 960 | ||
| 958 | When you defined a major mode using @code{define-derived-mode}, it | 961 | When you defined a major mode using @code{define-derived-mode}, it |
| 959 | automatically makes sure these conventions are followed. If you | 962 | automatically makes sure these conventions are followed. If you |
| @@ -963,6 +966,7 @@ use the following functions to handle these conventions automatically. | |||
| 963 | @defun run-mode-hooks &rest hookvars | 966 | @defun run-mode-hooks &rest hookvars |
| 964 | Major modes should run their mode hook using this function. It is | 967 | Major modes should run their mode hook using this function. It is |
| 965 | similar to @code{run-hooks} (@pxref{Hooks}), but it also runs | 968 | similar to @code{run-hooks} (@pxref{Hooks}), but it also runs |
| 969 | @code{change-major-mode-after-body-hook} and | ||
| 966 | @code{after-change-major-mode-hook}. | 970 | @code{after-change-major-mode-hook}. |
| 967 | 971 | ||
| 968 | When this function is called during the execution of a | 972 | When this function is called during the execution of a |
| @@ -982,6 +986,11 @@ The hooks will actually run during the next call to | |||
| 982 | construct. | 986 | construct. |
| 983 | @end defmac | 987 | @end defmac |
| 984 | 988 | ||
| 989 | @defvar change-major-mode-after-body-hook | ||
| 990 | This is a normal hook run by @code{run-mode-hooks}. It is run before | ||
| 991 | the mode hooks. | ||
| 992 | @end defvar | ||
| 993 | |||
| 985 | @defvar after-change-major-mode-hook | 994 | @defvar after-change-major-mode-hook |
| 986 | This is a normal hook run by @code{run-mode-hooks}. It is run at the | 995 | This is a normal hook run by @code{run-mode-hooks}. It is run at the |
| 987 | very end of every properly-written major mode command. | 996 | very end of every properly-written major mode command. |