aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPavel Janík2001-10-15 13:38:04 +0000
committerPavel Janík2001-10-15 13:38:04 +0000
commitb39fb64b26ba9a81715ca8b57abb4208a22d7e78 (patch)
tree6abdbe33b1dbd3be1dba7b3a615d72121e9ab4c2 /src
parentaa601ad023cf2548ef8e107475ea5ac1d3f8e9ef (diff)
downloademacs-b39fb64b26ba9a81715ca8b57abb4208a22d7e78.tar.gz
emacs-b39fb64b26ba9a81715ca8b57abb4208a22d7e78.zip
Put doc strings in comments.
Diffstat (limited to 'src')
-rw-r--r--src/abbrev.c171
1 files changed, 86 insertions, 85 deletions
diff --git a/src/abbrev.c b/src/abbrev.c
index 06bb1f98e5e..b36613ddd91 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */
22 22
23#include <config.h> 23#include <config.h>
24#include <stdio.h> 24#include <stdio.h>
25#define DOC_STRINGS_IN_COMMENTS
25#include "lisp.h" 26#include "lisp.h"
26#include "commands.h" 27#include "commands.h"
27#include "buffer.h" 28#include "buffer.h"
@@ -83,15 +84,15 @@ int last_abbrev_point;
83Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook; 84Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;
84 85
85DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0, 86DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0,
86 "Create a new, empty abbrev table object.") 87 /* Create a new, empty abbrev table object. */
87 () 88 ())
88{ 89{
89 return Fmake_vector (make_number (59), make_number (0)); 90 return Fmake_vector (make_number (59), make_number (0));
90} 91}
91 92
92DEFUN ("clear-abbrev-table", Fclear_abbrev_table, Sclear_abbrev_table, 1, 1, 0, 93DEFUN ("clear-abbrev-table", Fclear_abbrev_table, Sclear_abbrev_table, 1, 1, 0,
93 "Undefine all abbrevs in abbrev table TABLE, leaving it empty.") 94 /* Undefine all abbrevs in abbrev table TABLE, leaving it empty. */
94 (table) 95 (table))
95 Lisp_Object table; 96 Lisp_Object table;
96{ 97{
97 int i, size; 98 int i, size;
@@ -105,17 +106,17 @@ DEFUN ("clear-abbrev-table", Fclear_abbrev_table, Sclear_abbrev_table, 1, 1, 0,
105} 106}
106 107
107DEFUN ("define-abbrev", Fdefine_abbrev, Sdefine_abbrev, 3, 5, 0, 108DEFUN ("define-abbrev", Fdefine_abbrev, Sdefine_abbrev, 3, 5, 0,
108 "Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK.\n\ 109 /* Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK.
109NAME must be a string.\n\ 110NAME must be a string.
110EXPANSION should usually be a string.\n\ 111EXPANSION should usually be a string.
111To undefine an abbrev, define it with EXPANSION = nil.\n\ 112To undefine an abbrev, define it with EXPANSION = nil.
112If HOOK is non-nil, it should be a function of no arguments;\n\ 113If HOOK is non-nil, it should be a function of no arguments;
113it is called after EXPANSION is inserted.\n\ 114it is called after EXPANSION is inserted.
114If EXPANSION is not a string, the abbrev is a special one,\n\ 115If EXPANSION is not a string, the abbrev is a special one,
115 which does not expand in the usual way but only runs HOOK.\n\ 116 which does not expand in the usual way but only runs HOOK.
116COUNT, if specified, initializes the abbrev's usage-count\n\ 117COUNT, if specified, initializes the abbrev's usage-count
117which is incremented each time the abbrev is used.") 118which is incremented each time the abbrev is used. */
118 (table, name, expansion, hook, count) 119 (table, name, expansion, hook, count))
119 Lisp_Object table, name, expansion, hook, count; 120 Lisp_Object table, name, expansion, hook, count;
120{ 121{
121 Lisp_Object sym, oexp, ohook, tem; 122 Lisp_Object sym, oexp, ohook, tem;
@@ -147,9 +148,9 @@ which is incremented each time the abbrev is used.")
147} 148}
148 149
149DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, 2, 150DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, 2,
150 "sDefine global abbrev: \nsExpansion for %s: ", 151 "sDefine global abbrev: \nsExpansion for %s: ",
151 "Define ABBREV as a global abbreviation for EXPANSION.") 152 /* Define ABBREV as a global abbreviation for EXPANSION. */
152 (abbrev, expansion) 153 (abbrev, expansion))
153 Lisp_Object abbrev, expansion; 154 Lisp_Object abbrev, expansion;
154{ 155{
155 Fdefine_abbrev (Vglobal_abbrev_table, Fdowncase (abbrev), 156 Fdefine_abbrev (Vglobal_abbrev_table, Fdowncase (abbrev),
@@ -158,9 +159,9 @@ DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2,
158} 159}
159 160
160DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2, 161DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2,
161 "sDefine mode abbrev: \nsExpansion for %s: ", 162 "sDefine mode abbrev: \nsExpansion for %s: ",
162 "Define ABBREV as a mode-specific abbreviation for EXPANSION.") 163 /* Define ABBREV as a mode-specific abbreviation for EXPANSION. */
163 (abbrev, expansion) 164 (abbrev, expansion))
164 Lisp_Object abbrev, expansion; 165 Lisp_Object abbrev, expansion;
165{ 166{
166 if (NILP (current_buffer->abbrev_table)) 167 if (NILP (current_buffer->abbrev_table))
@@ -172,13 +173,13 @@ DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2,
172} 173}
173 174
174DEFUN ("abbrev-symbol", Fabbrev_symbol, Sabbrev_symbol, 1, 2, 0, 175DEFUN ("abbrev-symbol", Fabbrev_symbol, Sabbrev_symbol, 1, 2, 0,
175 "Return the symbol representing abbrev named ABBREV.\n\ 176 /* Return the symbol representing abbrev named ABBREV.
176This symbol's name is ABBREV, but it is not the canonical symbol of that name;\n\ 177This symbol's name is ABBREV, but it is not the canonical symbol of that name;
177it is interned in an abbrev-table rather than the normal obarray.\n\ 178it is interned in an abbrev-table rather than the normal obarray.
178The value is nil if that abbrev is not defined.\n\ 179The value is nil if that abbrev is not defined.
179Optional second arg TABLE is abbrev table to look it up in.\n\ 180Optional second arg TABLE is abbrev table to look it up in.
180The default is to try buffer's mode-specific abbrev table, then global table.") 181The default is to try buffer's mode-specific abbrev table, then global table. */
181 (abbrev, table) 182 (abbrev, table))
182 Lisp_Object abbrev, table; 183 Lisp_Object abbrev, table;
183{ 184{
184 Lisp_Object sym; 185 Lisp_Object sym;
@@ -201,10 +202,10 @@ The default is to try buffer's mode-specific abbrev table, then global table.")
201} 202}
202 203
203DEFUN ("abbrev-expansion", Fabbrev_expansion, Sabbrev_expansion, 1, 2, 0, 204DEFUN ("abbrev-expansion", Fabbrev_expansion, Sabbrev_expansion, 1, 2, 0,
204 "Return the string that ABBREV expands into in the current buffer.\n\ 205 /* Return the string that ABBREV expands into in the current buffer.
205Optionally specify an abbrev table as second arg;\n\ 206Optionally specify an abbrev table as second arg;
206then ABBREV is looked up in that table only.") 207then ABBREV is looked up in that table only. */
207 (abbrev, table) 208 (abbrev, table))
208 Lisp_Object abbrev, table; 209 Lisp_Object abbrev, table;
209{ 210{
210 Lisp_Object sym; 211 Lisp_Object sym;
@@ -217,10 +218,10 @@ then ABBREV is looked up in that table only.")
217 Returns 1 if an expansion is done. */ 218 Returns 1 if an expansion is done. */
218 219
219DEFUN ("expand-abbrev", Fexpand_abbrev, Sexpand_abbrev, 0, 0, "", 220DEFUN ("expand-abbrev", Fexpand_abbrev, Sexpand_abbrev, 0, 0, "",
220 "Expand the abbrev before point, if there is an abbrev there.\n\ 221 /* Expand the abbrev before point, if there is an abbrev there.
221Effective when explicitly called even when `abbrev-mode' is nil.\n\ 222Effective when explicitly called even when `abbrev-mode' is nil.
222Returns the abbrev symbol, if expansion took place.") 223Returns the abbrev symbol, if expansion took place. */
223 () 224 ())
224{ 225{
225 register char *buffer, *p; 226 register char *buffer, *p;
226 int wordstart, wordend; 227 int wordstart, wordend;
@@ -388,10 +389,10 @@ Returns the abbrev symbol, if expansion took place.")
388} 389}
389 390
390DEFUN ("unexpand-abbrev", Funexpand_abbrev, Sunexpand_abbrev, 0, 0, "", 391DEFUN ("unexpand-abbrev", Funexpand_abbrev, Sunexpand_abbrev, 0, 0, "",
391 "Undo the expansion of the last abbrev that expanded.\n\ 392 /* Undo the expansion of the last abbrev that expanded.
392This differs from ordinary undo in that other editing done since then\n\ 393This differs from ordinary undo in that other editing done since then
393is not undone.") 394is not undone. */
394 () 395 ())
395{ 396{
396 int opoint = PT; 397 int opoint = PT;
397 int adjust = 0; 398 int adjust = 0;
@@ -466,13 +467,13 @@ describe_abbrev (sym, stream)
466 467
467DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description, 468DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,
468 Sinsert_abbrev_table_description, 1, 2, 0, 469 Sinsert_abbrev_table_description, 1, 2, 0,
469 "Insert before point a full description of abbrev table named NAME.\n\ 470 /* Insert before point a full description of abbrev table named NAME.
470NAME is a symbol whose value is an abbrev table.\n\ 471NAME is a symbol whose value is an abbrev table.
471If optional 2nd arg READABLE is non-nil, a human-readable description\n\ 472If optional 2nd arg READABLE is non-nil, a human-readable description
472is inserted. Otherwise the description is an expression,\n\ 473is inserted. Otherwise the description is an expression,
473a call to `define-abbrev-table', which would\n\ 474a call to `define-abbrev-table', which would
474define the abbrev table NAME exactly as it is currently defined.") 475define the abbrev table NAME exactly as it is currently defined. */
475 (name, readable) 476 (name, readable))
476 Lisp_Object name, readable; 477 Lisp_Object name, readable;
477{ 478{
478 Lisp_Object table; 479 Lisp_Object table;
@@ -506,10 +507,10 @@ define the abbrev table NAME exactly as it is currently defined.")
506 507
507DEFUN ("define-abbrev-table", Fdefine_abbrev_table, Sdefine_abbrev_table, 508DEFUN ("define-abbrev-table", Fdefine_abbrev_table, Sdefine_abbrev_table,
508 2, 2, 0, 509 2, 2, 0,
509 "Define TABLENAME (a symbol) as an abbrev table name.\n\ 510 /* Define TABLENAME (a symbol) as an abbrev table name.
510Define abbrevs in it according to DEFINITIONS, which is a list of elements\n\ 511Define abbrevs in it according to DEFINITIONS, which is a list of elements
511of the form (ABBREVNAME EXPANSION HOOK USECOUNT).") 512of the form (ABBREVNAME EXPANSION HOOK USECOUNT). */
512 (tablename, definitions) 513 (tablename, definitions))
513 Lisp_Object tablename, definitions; 514 Lisp_Object tablename, definitions;
514{ 515{
515 Lisp_Object name, exp, hook, count; 516 Lisp_Object name, exp, hook, count;
@@ -540,66 +541,66 @@ of the form (ABBREVNAME EXPANSION HOOK USECOUNT).")
540void 541void
541syms_of_abbrev () 542syms_of_abbrev ()
542{ 543{
543 DEFVAR_LISP ("abbrev-table-name-list", &Vabbrev_table_name_list, 544 DEFVAR_LISP ("abbrev-table-name-list", &Vabbrev_table_name_list
544 "List of symbols whose values are abbrev tables."); 545 /* List of symbols whose values are abbrev tables. */);
545 Vabbrev_table_name_list = Fcons (intern ("fundamental-mode-abbrev-table"), 546 Vabbrev_table_name_list = Fcons (intern ("fundamental-mode-abbrev-table"),
546 Fcons (intern ("global-abbrev-table"), 547 Fcons (intern ("global-abbrev-table"),
547 Qnil)); 548 Qnil));
548 549
549 DEFVAR_LISP ("global-abbrev-table", &Vglobal_abbrev_table, 550 DEFVAR_LISP ("global-abbrev-table", &Vglobal_abbrev_table
550 "The abbrev table whose abbrevs affect all buffers.\n\ 551 /* The abbrev table whose abbrevs affect all buffers.
551Each buffer may also have a local abbrev table.\n\ 552Each buffer may also have a local abbrev table.
552If it does, the local table overrides the global one\n\ 553If it does, the local table overrides the global one
553for any particular abbrev defined in both."); 554for any particular abbrev defined in both. */);
554 Vglobal_abbrev_table = Fmake_abbrev_table (); 555 Vglobal_abbrev_table = Fmake_abbrev_table ();
555 556
556 DEFVAR_LISP ("fundamental-mode-abbrev-table", &Vfundamental_mode_abbrev_table, 557 DEFVAR_LISP ("fundamental-mode-abbrev-table", &Vfundamental_mode_abbrev_table
557 "The abbrev table of mode-specific abbrevs for Fundamental Mode."); 558 /* The abbrev table of mode-specific abbrevs for Fundamental Mode. */);
558 Vfundamental_mode_abbrev_table = Fmake_abbrev_table (); 559 Vfundamental_mode_abbrev_table = Fmake_abbrev_table ();
559 current_buffer->abbrev_table = Vfundamental_mode_abbrev_table; 560 current_buffer->abbrev_table = Vfundamental_mode_abbrev_table;
560 buffer_defaults.abbrev_table = Vfundamental_mode_abbrev_table; 561 buffer_defaults.abbrev_table = Vfundamental_mode_abbrev_table;
561 562
562 DEFVAR_LISP ("last-abbrev", &Vlast_abbrev, 563 DEFVAR_LISP ("last-abbrev", &Vlast_abbrev
563 "The abbrev-symbol of the last abbrev expanded. See `abbrev-symbol'."); 564 /* The abbrev-symbol of the last abbrev expanded. See `abbrev-symbol'. */);
564 565
565 DEFVAR_LISP ("last-abbrev-text", &Vlast_abbrev_text, 566 DEFVAR_LISP ("last-abbrev-text", &Vlast_abbrev_text
566 "The exact text of the last abbrev expanded.\n\ 567 /* The exact text of the last abbrev expanded.
567nil if the abbrev has already been unexpanded."); 568nil if the abbrev has already been unexpanded. */);
568 569
569 DEFVAR_INT ("last-abbrev-location", &last_abbrev_point, 570 DEFVAR_INT ("last-abbrev-location", &last_abbrev_point
570 "The location of the start of the last abbrev expanded."); 571 /* The location of the start of the last abbrev expanded. */);
571 572
572 Vlast_abbrev = Qnil; 573 Vlast_abbrev = Qnil;
573 Vlast_abbrev_text = Qnil; 574 Vlast_abbrev_text = Qnil;
574 last_abbrev_point = 0; 575 last_abbrev_point = 0;
575 576
576 DEFVAR_LISP ("abbrev-start-location", &Vabbrev_start_location, 577 DEFVAR_LISP ("abbrev-start-location", &Vabbrev_start_location
577 "Buffer position for `expand-abbrev' to use as the start of the abbrev.\n\ 578 /* Buffer position for `expand-abbrev' to use as the start of the abbrev.
578nil means use the word before point as the abbrev.\n\ 579nil means use the word before point as the abbrev.
579Calling `expand-abbrev' sets this to nil."); 580Calling `expand-abbrev' sets this to nil. */);
580 Vabbrev_start_location = Qnil; 581 Vabbrev_start_location = Qnil;
581 582
582 DEFVAR_LISP ("abbrev-start-location-buffer", &Vabbrev_start_location_buffer, 583 DEFVAR_LISP ("abbrev-start-location-buffer", &Vabbrev_start_location_buffer
583 "Buffer that `abbrev-start-location' has been set for.\n\ 584 /* Buffer that `abbrev-start-location' has been set for.
584Trying to expand an abbrev in any other buffer clears `abbrev-start-location'."); 585Trying to expand an abbrev in any other buffer clears `abbrev-start-location'. */);
585 Vabbrev_start_location_buffer = Qnil; 586 Vabbrev_start_location_buffer = Qnil;
586 587
587 DEFVAR_PER_BUFFER ("local-abbrev-table", &current_buffer->abbrev_table, Qnil, 588 DEFVAR_PER_BUFFER ("local-abbrev-table", &current_buffer->abbrev_table, Qnil
588 "Local (mode-specific) abbrev table of current buffer."); 589 /* Local (mode-specific) abbrev table of current buffer. */);
589 590
590 DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed, 591 DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed
591 "Set non-nil by defining or altering any word abbrevs.\n\ 592 /* Set non-nil by defining or altering any word abbrevs.
592This causes `save-some-buffers' to offer to save the abbrevs."); 593This causes `save-some-buffers' to offer to save the abbrevs. */);
593 abbrevs_changed = 0; 594 abbrevs_changed = 0;
594 595
595 DEFVAR_BOOL ("abbrev-all-caps", &abbrev_all_caps, 596 DEFVAR_BOOL ("abbrev-all-caps", &abbrev_all_caps
596 "*Set non-nil means expand multi-word abbrevs all caps if abbrev was so."); 597 /* *Set non-nil means expand multi-word abbrevs all caps if abbrev was so. */);
597 abbrev_all_caps = 0; 598 abbrev_all_caps = 0;
598 599
599 DEFVAR_LISP ("pre-abbrev-expand-hook", &Vpre_abbrev_expand_hook, 600 DEFVAR_LISP ("pre-abbrev-expand-hook", &Vpre_abbrev_expand_hook
600 "Function or functions to be called before abbrev expansion is done.\n\ 601 /* Function or functions to be called before abbrev expansion is done.
601This is the first thing that `expand-abbrev' does, and so this may change\n\ 602This is the first thing that `expand-abbrev' does, and so this may change
602the current abbrev table before abbrev lookup happens."); 603the current abbrev table before abbrev lookup happens. */);
603 Vpre_abbrev_expand_hook = Qnil; 604 Vpre_abbrev_expand_hook = Qnil;
604 Qpre_abbrev_expand_hook = intern ("pre-abbrev-expand-hook"); 605 Qpre_abbrev_expand_hook = intern ("pre-abbrev-expand-hook");
605 staticpro (&Qpre_abbrev_expand_hook); 606 staticpro (&Qpre_abbrev_expand_hook);