aboutsummaryrefslogtreecommitdiffstats
path: root/src/callint.c
diff options
context:
space:
mode:
authorPavel Janík2001-10-20 20:56:10 +0000
committerPavel Janík2001-10-20 20:56:10 +0000
commitfdb82f93376a6b495c573a6c788b807acffdbfa9 (patch)
tree107b731b733908446a3902f6ce0e4f2d23dcd8f9 /src/callint.c
parentc0a53abba1d89bb487e3a38a0e7336bdce46fd1d (diff)
downloademacs-fdb82f93376a6b495c573a6c788b807acffdbfa9.tar.gz
emacs-fdb82f93376a6b495c573a6c788b807acffdbfa9.zip
Change doc-string comments to `new style' [w/`doc:' keyword].
Diffstat (limited to 'src/callint.c')
-rw-r--r--src/callint.c217
1 files changed, 106 insertions, 111 deletions
diff --git a/src/callint.c b/src/callint.c
index 329911cda6e..1299a82f6c6 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA. */
21 21
22 22
23#include <config.h> 23#include <config.h>
24
24#include "lisp.h" 25#include "lisp.h"
25#include "buffer.h" 26#include "buffer.h"
26#include "commands.h" 27#include "commands.h"
@@ -62,72 +63,66 @@ static char *callint_message;
62/* Allocated length of that buffer. */ 63/* Allocated length of that buffer. */
63static int callint_message_size; 64static int callint_message_size;
64 65
65/* This comment supplies the doc string for interactive,
66 for make-docfile to see. We cannot put this in the real DEFUN
67 due to limits in the Unix cpp.
68
69DEFUN ("interactive", Ffoo, Sfoo, 0, 0, 0,
70 "Specify a way of parsing arguments for interactive use of a function.\n\
71For example, write\n\
72 (defun foo (arg) \"Doc string\" (interactive \"p\") ...use arg...)\n\
73to make ARG be the prefix argument when `foo' is called as a command.\n\
74The \"call\" to `interactive' is actually a declaration rather than a function;\n\
75 it tells `call-interactively' how to read arguments\n\
76 to pass to the function.\n\
77When actually called, `interactive' just returns nil.\n\
78\n\
79The argument of `interactive' is usually a string containing a code letter\n\
80 followed by a prompt. (Some code letters do not use I/O to get\n\
81 the argument and do not need prompts.) To prompt for multiple arguments,\n\
82 give a code letter, its prompt, a newline, and another code letter, etc.\n\
83 Prompts are passed to format, and may use % escapes to print the\n\
84 arguments that have already been read.\n\
85If the argument is not a string, it is evaluated to get a list of\n\
86 arguments to pass to the function.\n\
87Just `(interactive)' means pass no args when calling interactively.\n\
88\nCode letters available are:\n\
89a -- Function name: symbol with a function definition.\n\
90b -- Name of existing buffer.\n\
91B -- Name of buffer, possibly nonexistent.\n\
92c -- Character (no input method is used).\n\
93C -- Command name: symbol with interactive function definition.\n\
94d -- Value of point as number. Does not do I/O.\n\
95D -- Directory name.\n\
96e -- Parametrized event (i.e., one that's a list) that invoked this command.\n\
97 If used more than once, the Nth `e' returns the Nth parameterized event.\n\
98 This skips events that are integers or symbols.\n\
99f -- Existing file name.\n\
100F -- Possibly nonexistent file name.\n\
101i -- Ignored, i.e. always nil. Does not do I/O.\n\
102k -- Key sequence (downcase the last event if needed to get a definition).\n\
103K -- Key sequence to be redefined (do not downcase the last event).\n\
104m -- Value of mark as number. Does not do I/O.\n\
105M -- Any string. Inherits the current input method.\n\
106n -- Number read using minibuffer.\n\
107N -- Raw prefix arg, or if none, do like code `n'.\n\
108p -- Prefix arg converted to number. Does not do I/O.\n\
109P -- Prefix arg in raw form. Does not do I/O.\n\
110r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O.\n\
111s -- Any string. Does not inherit the current input method.\n\
112S -- Any symbol.\n\
113v -- Variable name: symbol that is user-variable-p.\n\
114x -- Lisp expression read but not evaluated.\n\
115X -- Lisp expression read and evaluated.\n\
116z -- Coding system.\n\
117Z -- Coding system, nil if no prefix arg.\n\
118In addition, if the string begins with `*'\n\
119 then an error is signaled if the buffer is read-only.\n\
120 This happens before reading any arguments.\n\
121If the string begins with `@', then Emacs searches the key sequence\n\
122 which invoked the command for its first mouse click (or any other\n\
123 event which specifies a window), and selects that window before\n\
124 reading any arguments. You may use both `@' and `*'; they are\n\
125 processed in the order that they appear." */
126
127/* ARGSUSED */ 66/* ARGSUSED */
128DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, 67DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0,
129 0 /* See immediately above */) 68 doc: /* Specify a way of parsing arguments for interactive use of a function.
130 (args) 69For example, write
70 (defun foo (arg) "Doc string" (interactive "p") ...use arg...)
71to make ARG be the prefix argument when `foo' is called as a command.
72The "call" to `interactive' is actually a declaration rather than a function;
73 it tells `call-interactively' how to read arguments
74 to pass to the function.
75When actually called, `interactive' just returns nil.
76
77The argument of `interactive' is usually a string containing a code letter
78 followed by a prompt. (Some code letters do not use I/O to get
79 the argument and do not need prompts.) To prompt for multiple arguments,
80 give a code letter, its prompt, a newline, and another code letter, etc.
81 Prompts are passed to format, and may use % escapes to print the
82 arguments that have already been read.
83If the argument is not a string, it is evaluated to get a list of
84 arguments to pass to the function.
85Just `(interactive)' means pass no args when calling interactively.
86
87Code letters available are:
88a -- Function name: symbol with a function definition.
89b -- Name of existing buffer.
90B -- Name of buffer, possibly nonexistent.
91c -- Character (no input method is used).
92C -- Command name: symbol with interactive function definition.
93d -- Value of point as number. Does not do I/O.
94D -- Directory name.
95e -- Parametrized event (i.e., one that's a list) that invoked this command.
96 If used more than once, the Nth `e' returns the Nth parameterized event.
97 This skips events that are integers or symbols.
98f -- Existing file name.
99F -- Possibly nonexistent file name.
100i -- Ignored, i.e. always nil. Does not do I/O.
101k -- Key sequence (downcase the last event if needed to get a definition).
102K -- Key sequence to be redefined (do not downcase the last event).
103m -- Value of mark as number. Does not do I/O.
104M -- Any string. Inherits the current input method.
105n -- Number read using minibuffer.
106N -- Raw prefix arg, or if none, do like code `n'.
107p -- Prefix arg converted to number. Does not do I/O.
108P -- Prefix arg in raw form. Does not do I/O.
109r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O.
110s -- Any string. Does not inherit the current input method.
111S -- Any symbol.
112v -- Variable name: symbol that is user-variable-p.
113x -- Lisp expression read but not evaluated.
114X -- Lisp expression read and evaluated.
115z -- Coding system.
116Z -- Coding system, nil if no prefix arg.
117In addition, if the string begins with `*'
118 then an error is signaled if the buffer is read-only.
119 This happens before reading any arguments.
120If the string begins with `@', then Emacs searches the key sequence
121 which invoked the command for its first mouse click (or any other
122 event which specifies a window), and selects that window before
123 reading any arguments. You may use both `@' and `*'; they are
124 processed in the order that they appear. */)
125 (args)
131 Lisp_Object args; 126 Lisp_Object args;
132{ 127{
133 return Qnil; 128 return Qnil;
@@ -178,19 +173,19 @@ check_mark ()
178 173
179 174
180DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0, 175DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0,
181 "Call FUNCTION, reading args according to its interactive calling specs.\n\ 176 doc: /* Call FUNCTION, reading args according to its interactive calling specs.
182Return the value FUNCTION returns.\n\ 177Return the value FUNCTION returns.
183The function contains a specification of how to do the argument reading.\n\ 178The function contains a specification of how to do the argument reading.
184In the case of user-defined functions, this is specified by placing a call\n\ 179In the case of user-defined functions, this is specified by placing a call
185to the function `interactive' at the top level of the function body.\n\ 180to the function `interactive' at the top level of the function body.
186See `interactive'.\n\ 181See `interactive'.
187\n\ 182
188Optional second arg RECORD-FLAG non-nil\n\ 183Optional second arg RECORD-FLAG non-nil
189means unconditionally put this command in the command-history.\n\ 184means unconditionally put this command in the command-history.
190Otherwise, this is done only if an arg is read using the minibuffer.\n\ 185Otherwise, this is done only if an arg is read using the minibuffer.
191Optional third arg KEYS, if given, specifies the sequence of events to\n\ 186Optional third arg KEYS, if given, specifies the sequence of events to
192supply if the command inquires which events were used to invoke it.") 187supply if the command inquires which events were used to invoke it. */)
193 (function, record_flag, keys) 188 (function, record_flag, keys)
194 Lisp_Object function, record_flag, keys; 189 Lisp_Object function, record_flag, keys;
195{ 190{
196 Lisp_Object *args, *visargs; 191 Lisp_Object *args, *visargs;
@@ -799,11 +794,11 @@ supply if the command inquires which events were used to invoke it.")
799} 794}
800 795
801DEFUN ("prefix-numeric-value", Fprefix_numeric_value, Sprefix_numeric_value, 796DEFUN ("prefix-numeric-value", Fprefix_numeric_value, Sprefix_numeric_value,
802 1, 1, 0, 797 1, 1, 0,
803 "Return numeric meaning of raw prefix argument RAW.\n\ 798 doc: /* Return numeric meaning of raw prefix argument RAW.
804A raw prefix argument is what you get from `(interactive \"P\")'.\n\ 799A raw prefix argument is what you get from `(interactive "P")'.
805Its numeric meaning is what you would get from `(interactive \"p\")'.") 800Its numeric meaning is what you would get from `(interactive "p")'. */)
806 (raw) 801 (raw)
807 Lisp_Object raw; 802 Lisp_Object raw;
808{ 803{
809 Lisp_Object val; 804 Lisp_Object val;
@@ -866,51 +861,51 @@ syms_of_callint ()
866 861
867 862
868 DEFVAR_KBOARD ("prefix-arg", Vprefix_arg, 863 DEFVAR_KBOARD ("prefix-arg", Vprefix_arg,
869 "The value of the prefix argument for the next editing command.\n\ 864 doc: /* The value of the prefix argument for the next editing command.
870It may be a number, or the symbol `-' for just a minus sign as arg,\n\ 865It may be a number, or the symbol `-' for just a minus sign as arg,
871or a list whose car is a number for just one or more C-u's\n\ 866or a list whose car is a number for just one or more C-u's
872or nil if no argument has been specified.\n\ 867or nil if no argument has been specified.
873\n\ 868
874You cannot examine this variable to find the argument for this command\n\ 869You cannot examine this variable to find the argument for this command
875since it has been set to nil by the time you can look.\n\ 870since it has been set to nil by the time you can look.
876Instead, you should use the variable `current-prefix-arg', although\n\ 871Instead, you should use the variable `current-prefix-arg', although
877normally commands can get this prefix argument with (interactive \"P\")."); 872normally commands can get this prefix argument with (interactive "P"). */);
878 873
879 DEFVAR_KBOARD ("last-prefix-arg", Vlast_prefix_arg, 874 DEFVAR_KBOARD ("last-prefix-arg", Vlast_prefix_arg,
880 "The value of the prefix argument for the previous editing command.\n\ 875 doc: /* The value of the prefix argument for the previous editing command.
881See `prefix-arg' for the meaning of the value."); 876See `prefix-arg' for the meaning of the value. */);
882 877
883 DEFVAR_LISP ("current-prefix-arg", &Vcurrent_prefix_arg, 878 DEFVAR_LISP ("current-prefix-arg", &Vcurrent_prefix_arg,
884 "The value of the prefix argument for this editing command.\n\ 879 doc: /* The value of the prefix argument for this editing command.
885It may be a number, or the symbol `-' for just a minus sign as arg,\n\ 880It may be a number, or the symbol `-' for just a minus sign as arg,
886or a list whose car is a number for just one or more C-u's\n\ 881or a list whose car is a number for just one or more C-u's
887or nil if no argument has been specified.\n\ 882or nil if no argument has been specified.
888This is what `(interactive \"P\")' returns."); 883This is what `(interactive \"P\")' returns. */);
889 Vcurrent_prefix_arg = Qnil; 884 Vcurrent_prefix_arg = Qnil;
890 885
891 DEFVAR_LISP ("command-history", &Vcommand_history, 886 DEFVAR_LISP ("command-history", &Vcommand_history,
892 "List of recent commands that read arguments from terminal.\n\ 887 doc: /* List of recent commands that read arguments from terminal.
893Each command is represented as a form to evaluate."); 888Each command is represented as a form to evaluate. */);
894 Vcommand_history = Qnil; 889 Vcommand_history = Qnil;
895 890
896 DEFVAR_LISP ("command-debug-status", &Vcommand_debug_status, 891 DEFVAR_LISP ("command-debug-status", &Vcommand_debug_status,
897 "Debugging status of current interactive command.\n\ 892 doc: /* Debugging status of current interactive command.
898Bound each time `call-interactively' is called;\n\ 893Bound each time `call-interactively' is called;
899may be set by the debugger as a reminder for itself."); 894may be set by the debugger as a reminder for itself. */);
900 Vcommand_debug_status = Qnil; 895 Vcommand_debug_status = Qnil;
901 896
902 DEFVAR_LISP ("mark-even-if-inactive", &Vmark_even_if_inactive, 897 DEFVAR_LISP ("mark-even-if-inactive", &Vmark_even_if_inactive,
903 "*Non-nil means you can use the mark even when inactive.\n\ 898 doc: /* *Non-nil means you can use the mark even when inactive.
904This option makes a difference in Transient Mark mode.\n\ 899This option makes a difference in Transient Mark mode.
905When the option is non-nil, deactivation of the mark\n\ 900When the option is non-nil, deactivation of the mark
906turns off region highlighting, but commands that use the mark\n\ 901turns off region highlighting, but commands that use the mark
907behave as if the mark were still active."); 902behave as if the mark were still active. */);
908 Vmark_even_if_inactive = Qnil; 903 Vmark_even_if_inactive = Qnil;
909 904
910 DEFVAR_LISP ("mouse-leave-buffer-hook", &Vmouse_leave_buffer_hook, 905 DEFVAR_LISP ("mouse-leave-buffer-hook", &Vmouse_leave_buffer_hook,
911 "Hook to run when about to switch windows with a mouse command.\n\ 906 doc: /* Hook to run when about to switch windows with a mouse command.
912Its purpose is to give temporary modes such as Isearch mode\n\ 907Its purpose is to give temporary modes such as Isearch mode
913a way to turn themselves off when a mouse command switches windows."); 908a way to turn themselves off when a mouse command switches windows. */);
914 Vmouse_leave_buffer_hook = Qnil; 909 Vmouse_leave_buffer_hook = Qnil;
915 910
916 defsubr (&Sinteractive); 911 defsubr (&Sinteractive);