aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
Diffstat (limited to 'lispref')
-rw-r--r--lispref/ChangeLog20
-rw-r--r--lispref/files.texi47
-rw-r--r--lispref/frames.texi21
-rw-r--r--lispref/modes.texi62
4 files changed, 84 insertions, 66 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 25909586102..6077deea9bb 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,23 @@
12005-05-29 Luc Teirlinck <teirllm@auburn.edu>
2
3 * modes.texi (Major Mode Conventions): A derived mode only needs
4 to put the call to the parent mode inside `delay-mode-hooks'.
5
62005-05-29 Richard M. Stallman <rms@gnu.org>
7
8 * modes.texi (Mode Hooks): Explain that after-change-major-mode-hook is
9 new, and what that implies. Clarify.
10
11 * files.texi (Locating Files): Clean up the text.
12
13 * frames.texi (Window Frame Parameters): Document user-size.
14 Shorten entry for top by referring to left.
15
162005-05-26 Richard M. Stallman <rms@gnu.org>
17
18 * modes.texi (Mode Hooks): Explain that after-change-major-mode-hook
19 is new, and what the implications are. Other clarifications.
20
12005-05-24 Richard M. Stallman <rms@gnu.org> 212005-05-24 Richard M. Stallman <rms@gnu.org>
2 22
3 * frames.texi (Dialog Boxes): Minor fixes. 23 * frames.texi (Dialog Boxes): Minor fixes.
diff --git a/lispref/files.texi b/lispref/files.texi
index 25c4dfeb0d0..766220aa882 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -1261,36 +1261,36 @@ is on file system number -32252.
1261@cindex locate files 1261@cindex locate files
1262@cindex find files 1262@cindex find files
1263 1263
1264 Sometimes, you need to find a file that could reside in one of the 1264 This section explains how to search for a file in a list of
1265standard directories. One example is when you need to look for a 1265directories. One example is when you need to look for a program's
1266program's executable file, e.g., to find out whether a given program 1266executable file, e.g., to find out whether a given program is
1267is installed on the user's system. Another example is the search for 1267installed on the user's system. Another example is the search for
1268Lisp libraries (@pxref{Library Search}). Such searches generally need 1268Lisp libraries (@pxref{Library Search}). Such searches generally need
1269to try several alternative file name extensions, in addition to 1269to try various possible file name extensions, in addition to various
1270looking in every standard directory where the file could be found. 1270possible directories. Emacs provides a function for such a
1271Emacs provides a function for such a generalized search for a file. 1271generalized search for a file.
1272 1272
1273@defun locate-file filename path &optional suffixes predicate 1273@defun locate-file filename path &optional suffixes predicate
1274This function searches for the file whose name is @var{filename} in 1274This function searches for a file whose name is @var{filename} in a
1275a list of directories given by @var{path}. If it finds the file, it 1275list of directories given by @var{path}, trying the suffixes in
1276returns its full @dfn{absolute file name} (@pxref{Relative File 1276@var{suffixes}. If it finds such a file, it returns the full
1277Names}); if the file is not found, the function returns @code{nil}. 1277@dfn{absolute file name} of the file (@pxref{Relative File Names});
1278otherwise it returns @code{nil}.
1278 1279
1279The optional argument @var{suffixes} gives the list of file-name 1280The optional argument @var{suffixes} gives the list of file-name
1280suffixes to append to @var{filename} when searching. If 1281suffixes to append to @var{filename} when searching.
1281@var{suffixes} is @code{nil}, it's equivalent to passing a list with a 1282@code{locate-file} tries each possible directory with each of these
1282single element that is an empty string @code{""}. 1283suffixes. If @var{suffixes} is @code{nil}, or @code{("")}, then there
1283 1284are no suffixes, and @var{filename} is used only as-is. Typical
1284Typical values of @var{path} are @code{exec-path} (@pxref{Subprocess 1285values of @var{suffixes} are @code{exec-suffixes} (@pxref{Subprocess
1286Creation, exec-suffixes}) and @code{load-suffixes} (@pxref{Library
1287Search, load-suffixes}).
1288
1289Typical values for @var{path} are @code{exec-path} (@pxref{Subprocess
1285Creation, exec-path}) when looking for executable programs or 1290Creation, exec-path}) when looking for executable programs or
1286@code{load-path} (@pxref{Library Search, load-path}) when looking for 1291@code{load-path} (@pxref{Library Search, load-path}) when looking for
1287Lisp files. Use @code{("/")} to disable the path search (e.g., if 1292Lisp files. If @var{filename} is absolute, @var{path} has no effect,
1288@var{filename} already includes the leading directories), but still 1293but the suffixes in @var{suffixes} are still tried.
1289try the extensions in @var{suffixes}.
1290
1291Typical values of @var{suffixes} are @code{exec-suffixes}
1292(@pxref{Subprocess Creation, exec-suffixes}) and @code{load-suffixes}
1293(@pxref{Library Search, load-suffixes}).
1294 1294
1295The optional argument @var{predicate}, if non-@code{nil}, specifies 1295The optional argument @var{predicate}, if non-@code{nil}, specifies
1296the predicate function to use for testing whether a candidate file is 1296the predicate function to use for testing whether a candidate file is
@@ -1316,7 +1316,6 @@ in @code{exec-path} and tries all the file-name extensions in
1316@code{exec-suffixes}. 1316@code{exec-suffixes}.
1317@end defun 1317@end defun
1318 1318
1319
1320@node Changing Files 1319@node Changing Files
1321@section Changing File Names and Attributes 1320@section Changing File Names and Attributes
1322@cindex renaming files 1321@cindex renaming files
diff --git a/lispref/frames.texi b/lispref/frames.texi
index 77694c87130..ffcc16f6289 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -362,20 +362,8 @@ non-@code{nil} value for the @code{user-position} parameter as well.
362 362
363@item top 363@item top
364The screen position of the top edge, in pixels, with respect to the 364The screen position of the top edge, in pixels, with respect to the
365top edge of the screen. The value may be a positive number @var{pos}, 365top edge of the screen. It works just like @code{left}, except vertically
366or a list of the form @code{(+ @var{pos})} which permits specifying a 366instead of horizontally.
367negative @var{pos} value.
368
369A negative number @minus{}@var{pos}, or a list of the form @code{(-
370@var{pos})}, actually specifies the position of the bottom edge of the
371window with respect to the bottom edge of the screen. A positive value
372of @var{pos} counts toward the top. @strong{Reminder:} if the
373parameter is a negative integer @minus{}@var{pos}, then @var{pos} is
374positive.
375
376Some window managers ignore program-specified positions. If you want to
377be sure the position you specify is not ignored, specify a
378non-@code{nil} value for the @code{user-position} parameter as well.
379 367
380@item icon-left 368@item icon-left
381The screen position of the left edge @emph{of the frame's icon}, in 369The screen position of the left edge @emph{of the frame's icon}, in
@@ -418,6 +406,11 @@ pixels, call @code{frame-pixel-height}; see @ref{Size and Position}.)
418The width of the frame contents, in characters. (To get the height in 406The width of the frame contents, in characters. (To get the height in
419pixels, call @code{frame-pixel-width}; see @ref{Size and Position}.) 407pixels, call @code{frame-pixel-width}; see @ref{Size and Position}.)
420 408
409@item user-size
410This does for the size parameters @code{height} and @code{width} what
411the @code{user-position} parameter (see above) does for the position
412parameters @code{top} and @code{left}.
413
421@item fullscreen 414@item fullscreen
422Specify that width, height or both shall be set to the size of the screen. 415Specify that width, height or both shall be set to the size of the screen.
423The value @code{fullwidth} specifies that width shall be the size of the 416The value @code{fullwidth} specifies that width shall be the size of the
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 61bc878b581..f8c1ae82a4e 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -437,10 +437,8 @@ The major mode command may start by calling some other major mode
437command (called the @dfn{parent mode}) and then alter some of its 437command (called the @dfn{parent mode}) and then alter some of its
438settings. A mode that does this is called a @dfn{derived mode}. The 438settings. A mode that does this is called a @dfn{derived mode}. The
439recommended way to define one is to use @code{define-derived-mode}, 439recommended way to define one is to use @code{define-derived-mode},
440but this is not required. Such a mode should use 440but this is not required. Such a mode should call the parent mode
441@code{delay-mode-hooks} around its entire body (including the call to 441command inside a @code{delay-mode-hooks} form. (Using
442the parent mode command) @emph{except} for the final call to
443@code{run-mode-hooks}, which runs the derived mode's hook. (Using
444@code{define-derived-mode} does this automatically.) @xref{Derived 442@code{define-derived-mode} does this automatically.) @xref{Derived
445Modes}, and @ref{Mode Hooks}. 443Modes}, and @ref{Mode Hooks}.
446 444
@@ -1117,7 +1115,7 @@ it runs the mode hook variable @code{@var{mode}-hook}.
1117@node Mode Hooks 1115@node Mode Hooks
1118@subsection Mode Hooks 1116@subsection Mode Hooks
1119 1117
1120The two last things a major mode function does is to run its mode 1118 The two last things a major mode function should do is run its mode
1121hook and finally the mode independent normal hook 1119hook and finally the mode independent normal hook
1122@code{after-change-major-mode-hook}. If the major mode is a derived 1120@code{after-change-major-mode-hook}. If the major mode is a derived
1123mode, that is if it calls another major mode (the parent mode) in its 1121mode, that is if it calls another major mode (the parent mode) in its
@@ -1125,45 +1123,53 @@ body, then the parent's mode hook is run just before the derived
1125mode's hook. Neither the parent's mode hook nor 1123mode's hook. Neither the parent's mode hook nor
1126@code{after-change-major-mode-hook} are run at the end of the actual 1124@code{after-change-major-mode-hook} are run at the end of the actual
1127call to the parent mode. This applies recursively if the parent mode 1125call to the parent mode. This applies recursively if the parent mode
1128has itself a parent. That is, the mode hooks of all major modes called 1126has itself a parent. That is, the mode hooks of all major modes
1129directly or indirectly by the major mode function are all run in 1127called directly or indirectly by the major mode function are all run
1130sequence at the end, just before @code{after-change-major-mode-hook}. 1128in sequence at the end, just before
1131 1129@code{after-change-major-mode-hook}.
1132If you are customizing a major mode, rather than defining one, the 1130
1133above is all you need to know about the hooks run at the end of a 1131 These conventions are new in Emacs 22, and some major modes
1134major mode. This also applies if you use @code{define-derived-mode} 1132implemented by users do not follow them yet. So if you put a function
1135to define a major mode, because that macro will automatically 1133onto @code{after-change-major-mode-hook}, keep in mind that some modes
1136implement the above for you. 1134will fail to run it. If a user complains about that, you can respond,
1137 1135``That major mode fails to follow Emacs conventions, and that's why it
1138Programmers wishing to define a major mode without using 1136fails to work. Please fix the major mode.'' In most cases, that is
1139@code{define-derived-mode}, should make sure that their major mode 1137good enough, so go ahead and use @code{after-change-major-mode-hook}.
1140follows the above conventions. @xref{Major Mode Conventions}, for how 1138However, if a certain feature needs to be completely reliable,
1141this should be accomplished. Below, we give some implementation 1139it should not use @code{after-change-major-mode-hook} as of yet.
1142details. 1140
1141 When you defined a major mode using @code{define-derived-mode}, it
1142automatically makes sure these conventions are followed. If you
1143define a major mode ``from scratch'', not using
1144@code{define-derived-mode}, make sure the major mode command follows
1145these and other conventions. @xref{Major Mode Conventions}. You use
1146these functions to do it properly.
1143 1147
1144@defun run-mode-hooks &rest hookvars 1148@defun run-mode-hooks &rest hookvars
1145Major modes should run their mode hook using this function. It is 1149Major modes should run their mode hook using this function. It is
1146similar to @code{run-hooks} (@pxref{Hooks}), but if run inside a 1150similar to @code{run-hooks} (@pxref{Hooks}), but it also runs
1147@code{delay-mode-hooks} form, this function does not run any hooks.
1148Instead, it arranges for @var{hookvars} to be run at a later call to
1149the function. Otherwise, @code{run-mode-hooks} runs any delayed hooks
1150in order, then @var{hookvars} and finally
1151@code{after-change-major-mode-hook}. 1151@code{after-change-major-mode-hook}.
1152
1153When the call to this function is dynamically inside a
1154@code{delay-mode-hooks} form, this function does not run any hooks.
1155Instead, it arranges for the next call to @code{run-mode-hooks} to run
1156@var{hookvars}.
1152@end defun 1157@end defun
1153 1158
1154@defmac delay-mode-hooks body... 1159@defmac delay-mode-hooks body...
1155This macro executes @var{body} like @code{progn}, but all calls to 1160This macro executes @var{body} like @code{progn}, but all calls to
1156@code{run-mode-hooks} inside @var{body} delay running their hooks. 1161@code{run-mode-hooks} inside @var{body} delay running their hooks.
1157They will be run by the first call to @code{run-mode-hooks} after exit 1162They will be run by the first call to @code{run-mode-hooks} after exit
1158from @code{delay-mode-hooks}. 1163from @code{delay-mode-hooks}. This is the proper way for a major mode
1164command to invoke its parent mode.
1159@end defmac 1165@end defmac
1160 1166
1161@defvar after-change-major-mode-hook 1167@defvar after-change-major-mode-hook
1162Every major mode function should run this normal hook at its very end. 1168Every major mode function should run this normal hook at its very end.
1163It normally does not need to do so explicitly. Indeed, a major mode 1169It normally does not need to do so explicitly. Indeed, a major mode
1164function should normally run its mode hook with @code{run-mode-hooks} 1170function should normally run its mode hook with @code{run-mode-hooks}
1165as the very last thing it does and @code{run-mode-hooks} runs 1171as the very last thing it does, and the last thing
1166@code{after-change-major-mode-hook} at its very end. 1172@code{run-mode-hooks} does is run @code{after-change-major-mode-hook}.
1167@end defvar 1173@end defvar
1168 1174
1169@node Minor Modes 1175@node Minor Modes