comparison src/abbrev.c @ 14059:1303d585443b

(Fdefine_global_abbrev, Fdefine_mode_abbrev, Fabbrev_symbol, Finsert_abbrev_table_description, Fdefine_abbrev_table): Harmonize arguments with documentation.
author Erik Naggum <erik@naggum.no>
date Tue, 09 Jan 1996 00:18:22 +0000
parents 406c11301eed
children aa682cae5c89
comparison
equal deleted inserted replaced
14058:be8c739308f7 14059:1303d585443b
140 } 140 }
141 141
142 DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, 2, 142 DEFUN ("define-global-abbrev", Fdefine_global_abbrev, Sdefine_global_abbrev, 2, 2,
143 "sDefine global abbrev: \nsExpansion for %s: ", 143 "sDefine global abbrev: \nsExpansion for %s: ",
144 "Define ABBREV as a global abbreviation for EXPANSION.") 144 "Define ABBREV as a global abbreviation for EXPANSION.")
145 (name, expansion) 145 (abbrev, expansion)
146 Lisp_Object name, expansion; 146 Lisp_Object abbrev, expansion;
147 { 147 {
148 Fdefine_abbrev (Vglobal_abbrev_table, Fdowncase (name), 148 Fdefine_abbrev (Vglobal_abbrev_table, Fdowncase (abbrev),
149 expansion, Qnil, make_number (0)); 149 expansion, Qnil, make_number (0));
150 return name; 150 return abbrev;
151 } 151 }
152 152
153 DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2, 153 DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev, Sdefine_mode_abbrev, 2, 2,
154 "sDefine mode abbrev: \nsExpansion for %s: ", 154 "sDefine mode abbrev: \nsExpansion for %s: ",
155 "Define ABBREV as a mode-specific abbreviation for EXPANSION.") 155 "Define ABBREV as a mode-specific abbreviation for EXPANSION.")
156 (name, expansion) 156 (abbrev, expansion)
157 Lisp_Object name, expansion; 157 Lisp_Object abbrev, expansion;
158 { 158 {
159 if (NILP (current_buffer->abbrev_table)) 159 if (NILP (current_buffer->abbrev_table))
160 error ("Major mode has no abbrev table"); 160 error ("Major mode has no abbrev table");
161 161
162 Fdefine_abbrev (current_buffer->abbrev_table, Fdowncase (name), 162 Fdefine_abbrev (current_buffer->abbrev_table, Fdowncase (abbrev),
163 expansion, Qnil, make_number (0)); 163 expansion, Qnil, make_number (0));
164 return name; 164 return abbrev;
165 } 165 }
166 166
167 DEFUN ("abbrev-symbol", Fabbrev_symbol, Sabbrev_symbol, 1, 2, 0, 167 DEFUN ("abbrev-symbol", Fabbrev_symbol, Sabbrev_symbol, 1, 2, 0,
168 "Return the symbol representing abbrev named ABBREV.\n\ 168 "Return the symbol representing abbrev named ABBREV.\n\
169 This symbol's name is ABBREV, but it is not the canonical symbol of that name;\n\ 169 This symbol's name is ABBREV, but it is not the canonical symbol of that name;\n\
419 DEFUN ("insert-abbrev-table-description", 419 DEFUN ("insert-abbrev-table-description",
420 Finsert_abbrev_table_description, Sinsert_abbrev_table_description, 420 Finsert_abbrev_table_description, Sinsert_abbrev_table_description,
421 1, 2, 0, 421 1, 2, 0,
422 "Insert before point a full description of abbrev table named NAME.\n\ 422 "Insert before point a full description of abbrev table named NAME.\n\
423 NAME is a symbol whose value is an abbrev table.\n\ 423 NAME is a symbol whose value is an abbrev table.\n\
424 If optional 2nd arg HUMAN is non-nil, a human-readable description is inserted.\n\ 424 If optional 2nd arg READABLE is non-nil, a human-readable description\n\
425 Otherwise the description is an expression,\n\ 425 is inserted. Otherwise the description is an expression,\n\
426 a call to `define-abbrev-table', which would\n\ 426 a call to `define-abbrev-table', which would\n\
427 define the abbrev table NAME exactly as it is currently defined.") 427 define the abbrev table NAME exactly as it is currently defined.")
428 (name, readable) 428 (name, readable)
429 Lisp_Object name, readable; 429 Lisp_Object name, readable;
430 { 430 {
457 return Qnil; 457 return Qnil;
458 } 458 }
459 459
460 DEFUN ("define-abbrev-table", Fdefine_abbrev_table, Sdefine_abbrev_table, 460 DEFUN ("define-abbrev-table", Fdefine_abbrev_table, Sdefine_abbrev_table,
461 2, 2, 0, 461 2, 2, 0,
462 "Define TABNAME (a symbol) as an abbrev table name.\n\ 462 "Define TABLENAME (a symbol) as an abbrev table name.\n\
463 Define abbrevs in it according to DEFINITIONS, which is a list of elements\n\ 463 Define abbrevs in it according to DEFINITIONS, which is a list of elements\n\
464 of the form (ABBREVNAME EXPANSION HOOK USECOUNT).") 464 of the form (ABBREVNAME EXPANSION HOOK USECOUNT).")
465 (tabname, defns) 465 (tablename, defns)
466 Lisp_Object tabname, defns; 466 Lisp_Object tablename, defns;
467 { 467 {
468 Lisp_Object name, exp, hook, count; 468 Lisp_Object name, exp, hook, count;
469 Lisp_Object table, elt; 469 Lisp_Object table, elt;
470 470
471 CHECK_SYMBOL (tabname, 0); 471 CHECK_SYMBOL (tablename, 0);
472 table = Fboundp (tabname); 472 table = Fboundp (tablename);
473 if (NILP (table) || (table = Fsymbol_value (tabname), NILP (table))) 473 if (NILP (table) || (table = Fsymbol_value (tablename), NILP (table)))
474 { 474 {
475 table = Fmake_abbrev_table (); 475 table = Fmake_abbrev_table ();
476 Fset (tabname, table); 476 Fset (tablename, table);
477 Vabbrev_table_name_list = 477 Vabbrev_table_name_list =
478 Fcons (tabname, Vabbrev_table_name_list); 478 Fcons (tablename, Vabbrev_table_name_list);
479 } 479 }
480 CHECK_VECTOR (table, 0); 480 CHECK_VECTOR (table, 0);
481 481
482 for (;!NILP (defns); defns = Fcdr (defns)) 482 for (;!NILP (definitions); definitions = Fcdr (definitions))
483 { 483 {
484 elt = Fcar (defns); 484 elt = Fcar (definitions);
485 name = Fcar (elt); elt = Fcdr (elt); 485 name = Fcar (elt); elt = Fcdr (elt);
486 exp = Fcar (elt); elt = Fcdr (elt); 486 exp = Fcar (elt); elt = Fcdr (elt);
487 hook = Fcar (elt); elt = Fcdr (elt); 487 hook = Fcar (elt); elt = Fcdr (elt);
488 count = Fcar (elt); 488 count = Fcar (elt);
489 Fdefine_abbrev (table, name, exp, hook, count); 489 Fdefine_abbrev (table, name, exp, hook, count);