comparison src/symbols.c @ 20:859a2309aef8 r19-15b93

Import from CVS: tag r19-15b93
author cvs
date Mon, 13 Aug 2007 08:50:05 +0200
parents 0293115a14e9
children 4103f0995bd7
comparison
equal deleted inserted replaced
19:ac1f612d5250 20:859a2309aef8
162 ? make_pure_pname ((CONST Bufbyte *) str, len, 0) 162 ? make_pure_pname ((CONST Bufbyte *) str, len, 0)
163 : make_string ((CONST Bufbyte *) str, len)), 163 : make_string ((CONST Bufbyte *) str, len)),
164 obarray); 164 obarray);
165 } 165 }
166 166
167 DEFUN ("intern", Fintern, Sintern, 1, 2, 0 /* 167 DEFUN ("intern", Fintern, 1, 2, 0, /*
168 Return the canonical symbol whose name is STRING. 168 Return the canonical symbol whose name is STRING.
169 If there is none, one is created by this function and returned. 169 If there is none, one is created by this function and returned.
170 A second optional argument specifies the obarray to use; 170 A second optional argument specifies the obarray to use;
171 it defaults to the value of `obarray'. 171 it defaults to the value of `obarray'.
172 */ ) 172 */
173 (str, obarray) 173 (str, obarray))
174 Lisp_Object str, obarray;
175 { 174 {
176 Lisp_Object sym, *ptr; 175 Lisp_Object sym, *ptr;
177 Bytecount len; 176 Bytecount len;
178 177
179 if (NILP (obarray)) obarray = Vobarray; 178 if (NILP (obarray)) obarray = Vobarray;
199 symbol_next (XSYMBOL (sym)) = 0; 198 symbol_next (XSYMBOL (sym)) = 0;
200 *ptr = sym; 199 *ptr = sym;
201 return sym; 200 return sym;
202 } 201 }
203 202
204 DEFUN ("intern-soft", Fintern_soft, Sintern_soft, 1, 2, 0 /* 203 DEFUN ("intern-soft", Fintern_soft, 1, 2, 0, /*
205 Return the canonical symbol whose name is STRING, or nil if none exists. 204 Return the canonical symbol whose name is STRING, or nil if none exists.
206 A second optional argument specifies the obarray to use; 205 A second optional argument specifies the obarray to use;
207 it defaults to the value of `obarray'. 206 it defaults to the value of `obarray'.
208 */ ) 207 */
209 (str, obarray) 208 (str, obarray))
210 Lisp_Object str, obarray;
211 { 209 {
212 Lisp_Object tem; 210 Lisp_Object tem;
213 211
214 if (NILP (obarray)) obarray = Vobarray; 212 if (NILP (obarray)) obarray = Vobarray;
215 obarray = check_obarray (obarray); 213 obarray = check_obarray (obarray);
220 if (!INTP (tem)) 218 if (!INTP (tem))
221 return tem; 219 return tem;
222 return Qnil; 220 return Qnil;
223 } 221 }
224 222
225 DEFUN ("unintern", Funintern, Sunintern, 1, 2, 0 /* 223 DEFUN ("unintern", Funintern, 1, 2, 0, /*
226 Delete the symbol named NAME, if any, from OBARRAY. 224 Delete the symbol named NAME, if any, from OBARRAY.
227 The value is t if a symbol was found and deleted, nil otherwise. 225 The value is t if a symbol was found and deleted, nil otherwise.
228 NAME may be a string or a symbol. If it is a symbol, that symbol 226 NAME may be a string or a symbol. If it is a symbol, that symbol
229 is deleted, if it belongs to OBARRAY--no other symbol is deleted. 227 is deleted, if it belongs to OBARRAY--no other symbol is deleted.
230 OBARRAY defaults to the value of the variable `obarray' 228 OBARRAY defaults to the value of the variable `obarray'
231 */ ) 229 */
232 (name, obarray) 230 (name, obarray))
233 Lisp_Object name, obarray;
234 { 231 {
235 Lisp_Object string, tem; 232 Lisp_Object string, tem;
236 int hash; 233 int hash;
237 234
238 if (NILP (obarray)) obarray = Vobarray; 235 if (NILP (obarray)) obarray = Vobarray;
376 mapatoms_1 (Lisp_Object sym, Lisp_Object function) 373 mapatoms_1 (Lisp_Object sym, Lisp_Object function)
377 { 374 {
378 call1 (function, sym); 375 call1 (function, sym);
379 } 376 }
380 377
381 DEFUN ("mapatoms", Fmapatoms, Smapatoms, 1, 2, 0 /* 378 DEFUN ("mapatoms", Fmapatoms, 1, 2, 0, /*
382 Call FUNCTION on every symbol in OBARRAY. 379 Call FUNCTION on every symbol in OBARRAY.
383 OBARRAY defaults to the value of `obarray'. 380 OBARRAY defaults to the value of `obarray'.
384 */ ) 381 */
385 (function, obarray) 382 (function, obarray))
386 Lisp_Object function, obarray;
387 { 383 {
388 if (NILP (obarray)) 384 if (NILP (obarray))
389 obarray = Vobarray; 385 obarray = Vobarray;
390 obarray = check_obarray (obarray); 386 obarray = check_obarray (obarray);
391 387
413 tem = call1 (predicate, symbol); 409 tem = call1 (predicate, symbol);
414 if (!NILP (tem)) 410 if (!NILP (tem))
415 *accumulation = Fcons (symbol, *accumulation); 411 *accumulation = Fcons (symbol, *accumulation);
416 } 412 }
417 413
418 DEFUN ("apropos-internal", Fapropos_internal, Sapropos_internal, 1, 2, 0 /* 414 DEFUN ("apropos-internal", Fapropos_internal, 1, 2, 0, /*
419 Show all symbols whose names contain match for REGEXP. 415 Show all symbols whose names contain match for REGEXP.
420 If optional 2nd arg PRED is non-nil, (funcall PRED SYM) is done 416 If optional 2nd arg PRED is non-nil, (funcall PRED SYM) is done
421 for each symbol and a symbol is mentioned only if that returns non-nil. 417 for each symbol and a symbol is mentioned only if that returns non-nil.
422 Return list of symbols found. 418 Return list of symbols found.
423 */ ) 419 */
424 (string, pred) 420 (string, pred))
425 Lisp_Object string, pred;
426 { 421 {
427 struct gcpro gcpro1; 422 struct gcpro gcpro1;
428 Lisp_Object accumulation; 423 Lisp_Object accumulation;
429 424
430 CHECK_STRING (string); 425 CHECK_STRING (string);
443 struct symbol_value_buffer_local *bfwd, 438 struct symbol_value_buffer_local *bfwd,
444 struct buffer *buf, 439 struct buffer *buf,
445 Lisp_Object new_alist_el, 440 Lisp_Object new_alist_el,
446 int set_it_p); 441 int set_it_p);
447 442
448 DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0 /* 443 DEFUN ("boundp", Fboundp, 1, 1, 0, /*
449 T if SYMBOL's value is not void. 444 T if SYMBOL's value is not void.
450 */ ) 445 */
451 (sym) 446 (sym))
452 Lisp_Object sym;
453 { 447 {
454 CHECK_SYMBOL (sym); 448 CHECK_SYMBOL (sym);
455 return (UNBOUNDP (find_symbol_value (sym)) ? Qnil : Qt); 449 return (UNBOUNDP (find_symbol_value (sym)) ? Qnil : Qt);
456 } 450 }
457 451
458 DEFUN ("globally-boundp", Fglobally_boundp, Sglobally_boundp, 1, 1, 0 /* 452 DEFUN ("globally-boundp", Fglobally_boundp, 1, 1, 0, /*
459 T if SYMBOL has a global (non-bound) value. 453 T if SYMBOL has a global (non-bound) value.
460 This is for the byte-compiler; you really shouldn't be using this. 454 This is for the byte-compiler; you really shouldn't be using this.
461 */ ) 455 */
462 (sym) 456 (sym))
463 Lisp_Object sym;
464 { 457 {
465 CHECK_SYMBOL (sym); 458 CHECK_SYMBOL (sym);
466 return (UNBOUNDP (top_level_value (sym)) ? Qnil : Qt); 459 return (UNBOUNDP (top_level_value (sym)) ? Qnil : Qt);
467 } 460 }
468 461
469 DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0 /* 462 DEFUN ("fboundp", Ffboundp, 1, 1, 0, /*
470 T if SYMBOL's function definition is not void. 463 T if SYMBOL's function definition is not void.
471 */ ) 464 */
472 (sym) 465 (sym))
473 Lisp_Object sym;
474 { 466 {
475 CHECK_SYMBOL (sym); 467 CHECK_SYMBOL (sym);
476 return ((UNBOUNDP (XSYMBOL (sym)->function)) ? Qnil : Qt); 468 return ((UNBOUNDP (XSYMBOL (sym)->function)) ? Qnil : Qt);
477 } 469 }
478 470
557 signal_error (Qerror, 549 signal_error (Qerror,
558 list2 (build_string ("Symbol may not be buffer-local"), 550 list2 (build_string ("Symbol may not be buffer-local"),
559 sym)); 551 sym));
560 } 552 }
561 553
562 DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0 /* 554 DEFUN ("makunbound", Fmakunbound, 1, 1, 0, /*
563 Make SYMBOL's value be void. 555 Make SYMBOL's value be void.
564 */ ) 556 */
565 (sym) 557 (sym))
566 Lisp_Object sym;
567 { 558 {
568 Fset (sym, Qunbound); 559 Fset (sym, Qunbound);
569 return sym; 560 return sym;
570 } 561 }
571 562
572 DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0 /* 563 DEFUN ("fmakunbound", Ffmakunbound, 1, 1, 0, /*
573 Make SYMBOL's function definition be void. 564 Make SYMBOL's function definition be void.
574 */ ) 565 */
575 (sym) 566 (sym))
576 Lisp_Object sym;
577 { 567 {
578 CHECK_SYMBOL (sym); 568 CHECK_SYMBOL (sym);
579 reject_constant_symbols (sym, Qunbound, 1, Qt); 569 reject_constant_symbols (sym, Qunbound, 1, Qt);
580 XSYMBOL (sym)->function = Qunbound; 570 XSYMBOL (sym)->function = Qunbound;
581 return sym; 571 return sym;
582 } 572 }
583 573
584 DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0 /* 574 DEFUN ("symbol-function", Fsymbol_function, 1, 1, 0, /*
585 Return SYMBOL's function definition. Error if that is void. 575 Return SYMBOL's function definition. Error if that is void.
586 */ ) 576 */
587 (symbol) 577 (symbol))
588 Lisp_Object symbol;
589 { 578 {
590 CHECK_SYMBOL (symbol); 579 CHECK_SYMBOL (symbol);
591 if (UNBOUNDP (XSYMBOL (symbol)->function)) 580 if (UNBOUNDP (XSYMBOL (symbol)->function))
592 return Fsignal (Qvoid_function, list1 (symbol)); 581 return Fsignal (Qvoid_function, list1 (symbol));
593 return XSYMBOL (symbol)->function; 582 return XSYMBOL (symbol)->function;
594 } 583 }
595 584
596 DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0 /* 585 DEFUN ("symbol-plist", Fsymbol_plist, 1, 1, 0, /*
597 Return SYMBOL's property list. 586 Return SYMBOL's property list.
598 */ ) 587 */
599 (sym) 588 (sym))
600 Lisp_Object sym;
601 { 589 {
602 CHECK_SYMBOL (sym); 590 CHECK_SYMBOL (sym);
603 return XSYMBOL (sym)->plist; 591 return XSYMBOL (sym)->plist;
604 } 592 }
605 593
606 DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0 /* 594 DEFUN ("symbol-name", Fsymbol_name, 1, 1, 0, /*
607 Return SYMBOL's name, a string. 595 Return SYMBOL's name, a string.
608 */ ) 596 */
609 (sym) 597 (sym))
610 Lisp_Object sym;
611 { 598 {
612 Lisp_Object name; 599 Lisp_Object name;
613 600
614 CHECK_SYMBOL (sym); 601 CHECK_SYMBOL (sym);
615 XSETSTRING (name, XSYMBOL (sym)->name); 602 XSETSTRING (name, XSYMBOL (sym)->name);
616 return name; 603 return name;
617 } 604 }
618 605
619 DEFUN ("fset", Ffset, Sfset, 2, 2, 0 /* 606 DEFUN ("fset", Ffset, 2, 2, 0, /*
620 Set SYMBOL's function definition to NEWVAL, and return NEWVAL. 607 Set SYMBOL's function definition to NEWVAL, and return NEWVAL.
621 */ ) 608 */
622 (sym, newdef) 609 (sym, newdef))
623 Lisp_Object sym, newdef;
624 { 610 {
625 /* This function can GC */ 611 /* This function can GC */
626 CHECK_SYMBOL (sym); 612 CHECK_SYMBOL (sym);
627 reject_constant_symbols (sym, newdef, 1, Qt); 613 reject_constant_symbols (sym, newdef, 1, Qt);
628 if (!NILP (Vautoload_queue) && !UNBOUNDP (XSYMBOL (sym)->function)) 614 if (!NILP (Vautoload_queue) && !UNBOUNDP (XSYMBOL (sym)->function))
638 } 624 }
639 return newdef; 625 return newdef;
640 } 626 }
641 627
642 /* FSFmacs */ 628 /* FSFmacs */
643 DEFUN ("define-function", Fdefine_function, Sdefine_function, 2, 2, 0 /* 629 DEFUN ("define-function", Fdefine_function, 2, 2, 0, /*
644 Set SYMBOL's function definition to NEWVAL, and return NEWVAL. 630 Set SYMBOL's function definition to NEWVAL, and return NEWVAL.
645 Associates the function with the current load file, if any. 631 Associates the function with the current load file, if any.
646 */ ) 632 */
647 (sym, newdef) 633 (sym, newdef))
648 Lisp_Object sym, newdef;
649 { 634 {
650 /* This function can GC */ 635 /* This function can GC */
651 CHECK_SYMBOL (sym); 636 CHECK_SYMBOL (sym);
652 Ffset (sym, newdef); 637 Ffset (sym, newdef);
653 LOADHIST_ATTACH (sym); 638 LOADHIST_ATTACH (sym);
654 return newdef; 639 return newdef;
655 } 640 }
656 641
657 642
658 DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0 /* 643 DEFUN ("setplist", Fsetplist, 2, 2, 0, /*
659 Set SYMBOL's property list to NEWVAL, and return NEWVAL. 644 Set SYMBOL's property list to NEWVAL, and return NEWVAL.
660 */ ) 645 */
661 (sym, newplist) 646 (sym, newplist))
662 Lisp_Object sym, newplist;
663 { 647 {
664 CHECK_SYMBOL (sym); 648 CHECK_SYMBOL (sym);
665 XSYMBOL (sym)->plist = newplist; 649 XSYMBOL (sym)->plist = newplist;
666 return newplist; 650 return newplist;
667 } 651 }
1557 return find_symbol_value_1 (sym, current_buffer, dev, 1, 1541 return find_symbol_value_1 (sym, current_buffer, dev, 1,
1558 find_it_p ? symbol_cons : Qnil, 1542 find_it_p ? symbol_cons : Qnil,
1559 find_it_p); 1543 find_it_p);
1560 } 1544 }
1561 1545
1562 DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0 /* 1546 DEFUN ("symbol-value", Fsymbol_value, 1, 1, 0, /*
1563 Return SYMBOL's value. Error if that is void. 1547 Return SYMBOL's value. Error if that is void.
1564 */ ) 1548 */
1565 (sym) 1549 (sym))
1566 Lisp_Object sym;
1567 { 1550 {
1568 Lisp_Object val = find_symbol_value (sym); 1551 Lisp_Object val = find_symbol_value (sym);
1569 1552
1570 if (UNBOUNDP (val)) 1553 if (UNBOUNDP (val))
1571 return Fsignal (Qvoid_variable, list1 (sym)); 1554 return Fsignal (Qvoid_variable, list1 (sym));
1572 else 1555 else
1573 return val; 1556 return val;
1574 } 1557 }
1575 1558
1576 DEFUN ("set", Fset, Sset, 2, 2, 0 /* 1559 DEFUN ("set", Fset, 2, 2, 0, /*
1577 Set SYMBOL's value to NEWVAL, and return NEWVAL. 1560 Set SYMBOL's value to NEWVAL, and return NEWVAL.
1578 */ ) 1561 */
1579 (sym, newval) 1562 (sym, newval))
1580 Lisp_Object sym, newval;
1581 { 1563 {
1582 REGISTER Lisp_Object valcontents; 1564 REGISTER Lisp_Object valcontents;
1583 /* remember, we're called by Fmakunbound() as well */ 1565 /* remember, we're called by Fmakunbound() as well */
1584 1566
1585 CHECK_SYMBOL (sym); 1567 CHECK_SYMBOL (sym);
1822 } 1804 }
1823 1805
1824 RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */ 1806 RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */
1825 } 1807 }
1826 1808
1827 DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0 /* 1809 DEFUN ("default-boundp", Fdefault_boundp, 1, 1, 0, /*
1828 Return T if SYMBOL has a non-void default value. 1810 Return T if SYMBOL has a non-void default value.
1829 This is the value that is seen in buffers that do not have their own values 1811 This is the value that is seen in buffers that do not have their own values
1830 for this variable. 1812 for this variable.
1831 */ ) 1813 */
1832 (sym) 1814 (sym))
1833 Lisp_Object sym;
1834 { 1815 {
1835 Lisp_Object value; 1816 Lisp_Object value;
1836 1817
1837 value = default_value (sym); 1818 value = default_value (sym);
1838 return (UNBOUNDP (value) ? Qnil : Qt); 1819 return (UNBOUNDP (value) ? Qnil : Qt);
1839 } 1820 }
1840 1821
1841 DEFUN ("default-value", Fdefault_value, Sdefault_value, 1, 1, 0 /* 1822 DEFUN ("default-value", Fdefault_value, 1, 1, 0, /*
1842 Return SYMBOL's default value. 1823 Return SYMBOL's default value.
1843 This is the value that is seen in buffers that do not have their own values 1824 This is the value that is seen in buffers that do not have their own values
1844 for this variable. The default value is meaningful for variables with 1825 for this variable. The default value is meaningful for variables with
1845 local bindings in certain buffers. 1826 local bindings in certain buffers.
1846 */ ) 1827 */
1847 (sym) 1828 (sym))
1848 Lisp_Object sym;
1849 { 1829 {
1850 Lisp_Object value; 1830 Lisp_Object value;
1851 1831
1852 value = default_value (sym); 1832 value = default_value (sym);
1853 if (UNBOUNDP (value)) 1833 if (UNBOUNDP (value))
1854 return Fsignal (Qvoid_variable, list1 (sym)); 1834 return Fsignal (Qvoid_variable, list1 (sym));
1855 return value; 1835 return value;
1856 } 1836 }
1857 1837
1858 DEFUN ("set-default", Fset_default, Sset_default, 2, 2, 0 /* 1838 DEFUN ("set-default", Fset_default, 2, 2, 0, /*
1859 Set SYMBOL's default value to VAL. SYMBOL and VAL are evaluated. 1839 Set SYMBOL's default value to VAL. SYMBOL and VAL are evaluated.
1860 The default value is seen in buffers that do not have their own values 1840 The default value is seen in buffers that do not have their own values
1861 for this variable. 1841 for this variable.
1862 */ ) 1842 */
1863 (sym, value) 1843 (sym, value))
1864 Lisp_Object sym, value;
1865 { 1844 {
1866 Lisp_Object valcontents; 1845 Lisp_Object valcontents;
1867 1846
1868 CHECK_SYMBOL (sym); 1847 CHECK_SYMBOL (sym);
1869 1848
1915 return Fset (sym, value); 1894 return Fset (sym, value);
1916 } 1895 }
1917 RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */ 1896 RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */
1918 } 1897 }
1919 1898
1920 DEFUN ("setq-default", Fsetq_default, Ssetq_default, 2, UNEVALLED, 0 /* 1899 DEFUN ("setq-default", Fsetq_default, 2, UNEVALLED, 0, /*
1921 Set the default value of variable VAR to VALUE. 1900 Set the default value of variable VAR to VALUE.
1922 VAR, the variable name, is literal (not evaluated); 1901 VAR, the variable name, is literal (not evaluated);
1923 VALUE is an expression and it is evaluated. 1902 VALUE is an expression and it is evaluated.
1924 The default value of a variable is seen in buffers 1903 The default value of a variable is seen in buffers
1925 that do not have their own values for the variable. 1904 that do not have their own values for the variable.
1927 More generally, you can use multiple variables and values, as in 1906 More generally, you can use multiple variables and values, as in
1928 (setq-default SYM VALUE SYM VALUE...) 1907 (setq-default SYM VALUE SYM VALUE...)
1929 This sets each SYM's default value to the corresponding VALUE. 1908 This sets each SYM's default value to the corresponding VALUE.
1930 The VALUE for the Nth SYM can refer to the new default values 1909 The VALUE for the Nth SYM can refer to the new default values
1931 of previous SYMs. 1910 of previous SYMs.
1932 */ ) 1911 */
1933 (args) 1912 (args))
1934 Lisp_Object args;
1935 { 1913 {
1936 /* This function can GC */ 1914 /* This function can GC */
1937 Lisp_Object args_left; 1915 Lisp_Object args_left;
1938 Lisp_Object val, sym; 1916 Lisp_Object val, sym;
1939 struct gcpro gcpro1; 1917 struct gcpro gcpro1;
1957 return val; 1935 return val;
1958 } 1936 }
1959 1937
1960 /* Lisp functions for creating and removing buffer-local variables. */ 1938 /* Lisp functions for creating and removing buffer-local variables. */
1961 1939
1962 DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, 1940 DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, 1, 1,
1963 Smake_variable_buffer_local, 1941 "vMake Variable Buffer Local: ", /*
1964 1, 1, "vMake Variable Buffer Local: " /*
1965 Make VARIABLE have a separate value for each buffer. 1942 Make VARIABLE have a separate value for each buffer.
1966 At any time, the value for the current buffer is in effect. 1943 At any time, the value for the current buffer is in effect.
1967 There is also a default value which is seen in any buffer which has not yet 1944 There is also a default value which is seen in any buffer which has not yet
1968 set its own value. 1945 set its own value.
1969 Using `set' or `setq' to set the variable causes it to have a separate value 1946 Using `set' or `setq' to set the variable causes it to have a separate value
1970 for the current buffer if it was previously using the default value. 1947 for the current buffer if it was previously using the default value.
1971 The function `default-value' gets the default value and `set-default' 1948 The function `default-value' gets the default value and `set-default'
1972 sets it. 1949 sets it.
1973 */ ) 1950 */
1974 (variable) 1951 (variable))
1975 Lisp_Object variable;
1976 { 1952 {
1977 Lisp_Object valcontents; 1953 Lisp_Object valcontents;
1978 1954
1979 CHECK_SYMBOL (variable); 1955 CHECK_SYMBOL (variable);
1980 1956
2055 #endif 2031 #endif
2056 return (variable); 2032 return (variable);
2057 } 2033 }
2058 } 2034 }
2059 2035
2060 DEFUN ("make-local-variable", Fmake_local_variable, Smake_local_variable, 2036 DEFUN ("make-local-variable", Fmake_local_variable, 1, 1, "vMake Local Variable: ", /*
2061 1, 1, "vMake Local Variable: " /*
2062 Make VARIABLE have a separate value in the current buffer. 2037 Make VARIABLE have a separate value in the current buffer.
2063 Other buffers will continue to share a common default value. 2038 Other buffers will continue to share a common default value.
2064 \(The buffer-local value of VARIABLE starts out as the same value 2039 \(The buffer-local value of VARIABLE starts out as the same value
2065 VARIABLE previously had. If VARIABLE was void, it remains void.) 2040 VARIABLE previously had. If VARIABLE was void, it remains void.)
2066 See also `make-variable-buffer-local'. 2041 See also `make-variable-buffer-local'.
2069 this function causes a local value to exist for this buffer, 2044 this function causes a local value to exist for this buffer,
2070 just as setting the variable would do. 2045 just as setting the variable would do.
2071 2046
2072 Do not use `make-local-variable' to make a hook variable buffer-local. 2047 Do not use `make-local-variable' to make a hook variable buffer-local.
2073 Use `make-local-hook' instead. 2048 Use `make-local-hook' instead.
2074 */ ) 2049 */
2075 (variable) 2050 (variable))
2076 Lisp_Object variable;
2077 { 2051 {
2078 Lisp_Object valcontents; 2052 Lisp_Object valcontents;
2079 struct symbol_value_buffer_local *bfwd; 2053 struct symbol_value_buffer_local *bfwd;
2080 2054
2081 CHECK_SYMBOL (variable); 2055 CHECK_SYMBOL (variable);
2209 } 2183 }
2210 2184
2211 return (variable); 2185 return (variable);
2212 } 2186 }
2213 2187
2214 DEFUN ("kill-local-variable", Fkill_local_variable, Skill_local_variable, 2188 DEFUN ("kill-local-variable", Fkill_local_variable, 1, 1, "vKill Local Variable: ", /*
2215 1, 1, "vKill Local Variable: " /*
2216 Make VARIABLE no longer have a separate value in the current buffer. 2189 Make VARIABLE no longer have a separate value in the current buffer.
2217 From now on the default value will apply in this buffer. 2190 From now on the default value will apply in this buffer.
2218 */ ) 2191 */
2219 (variable) 2192 (variable))
2220 Lisp_Object variable;
2221 { 2193 {
2222 Lisp_Object valcontents; 2194 Lisp_Object valcontents;
2223 2195
2224 CHECK_SYMBOL (variable); 2196 CHECK_SYMBOL (variable);
2225 2197
2303 } 2275 }
2304 RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */ 2276 RETURN_NOT_REACHED(Qnil) /* suppress compiler warning */
2305 } 2277 }
2306 2278
2307 2279
2308 DEFUN ("kill-console-local-variable", Fkill_console_local_variable, 2280 DEFUN ("kill-console-local-variable", Fkill_console_local_variable, 1, 1, "vKill Console Local Variable: ", /*
2309 Skill_console_local_variable,
2310 1, 1, "vKill Console Local Variable: " /*
2311 Make VARIABLE no longer have a separate value in the selected console. 2281 Make VARIABLE no longer have a separate value in the selected console.
2312 From now on the default value will apply in this console. 2282 From now on the default value will apply in this console.
2313 */ ) 2283 */
2314 (variable) 2284 (variable))
2315 Lisp_Object variable;
2316 { 2285 {
2317 Lisp_Object valcontents; 2286 Lisp_Object valcontents;
2318 2287
2319 CHECK_SYMBOL (variable); 2288 CHECK_SYMBOL (variable);
2320 2289
2433 } 2402 }
2434 return (0); 2403 return (0);
2435 } 2404 }
2436 2405
2437 2406
2438 DEFUN ("symbol-value-in-buffer", Fsymbol_value_in_buffer, 2407 DEFUN ("symbol-value-in-buffer", Fsymbol_value_in_buffer, 2, 3, 0, /*
2439 Ssymbol_value_in_buffer, 2, 3, 0 /*
2440 Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound. 2408 Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound.
2441 */ ) 2409 */
2442 (symbol, buffer, unbound_value) 2410 (symbol, buffer, unbound_value))
2443 Lisp_Object symbol, buffer, unbound_value;
2444 { 2411 {
2445 Lisp_Object value; 2412 Lisp_Object value;
2446 CHECK_SYMBOL (symbol); 2413 CHECK_SYMBOL (symbol);
2447 CHECK_BUFFER (buffer); 2414 CHECK_BUFFER (buffer);
2448 value = symbol_value_in_buffer (symbol, buffer); 2415 value = symbol_value_in_buffer (symbol, buffer);
2450 return (unbound_value); 2417 return (unbound_value);
2451 else 2418 else
2452 return (value); 2419 return (value);
2453 } 2420 }
2454 2421
2455 DEFUN ("symbol-value-in-console", Fsymbol_value_in_console, 2422 DEFUN ("symbol-value-in-console", Fsymbol_value_in_console, 2, 3, 0, /*
2456 Ssymbol_value_in_console, 2, 3, 0 /*
2457 Return the value of SYMBOL in CONSOLE, or UNBOUND-VALUE if it is unbound. 2423 Return the value of SYMBOL in CONSOLE, or UNBOUND-VALUE if it is unbound.
2458 */ ) 2424 */
2459 (symbol, console, unbound_value) 2425 (symbol, console, unbound_value))
2460 Lisp_Object symbol, console, unbound_value;
2461 { 2426 {
2462 Lisp_Object value; 2427 Lisp_Object value;
2463 CHECK_SYMBOL (symbol); 2428 CHECK_SYMBOL (symbol);
2464 CHECK_CONSOLE (console); 2429 CHECK_CONSOLE (console);
2465 value = symbol_value_in_console (symbol, console); 2430 value = symbol_value_in_console (symbol, console);
2467 return (unbound_value); 2432 return (unbound_value);
2468 else 2433 else
2469 return (value); 2434 return (value);
2470 } 2435 }
2471 2436
2472 DEFUN ("built-in-variable-type", Fbuilt_in_variable_type, 2437 DEFUN ("built-in-variable-type", Fbuilt_in_variable_type, 1, 1, 0, /*
2473 Sbuilt_in_variable_type, 1, 1, 0 /*
2474 If SYM is a built-in variable, return info about this; else return nil. 2438 If SYM is a built-in variable, return info about this; else return nil.
2475 The returned info will be a symbol, one of 2439 The returned info will be a symbol, one of
2476 2440
2477 `object' A simple built-in variable. 2441 `object' A simple built-in variable.
2478 `const-object' Same, but cannot be set. 2442 `const-object' Same, but cannot be set.
2487 buffer-local variable. 2451 buffer-local variable.
2488 `selected-console' A built-in console-local variable. 2452 `selected-console' A built-in console-local variable.
2489 `const-selected-console' Same, but cannot be set. 2453 `const-selected-console' Same, but cannot be set.
2490 `default-console' Forwards to the default value of a built-in 2454 `default-console' Forwards to the default value of a built-in
2491 console-local variable. 2455 console-local variable.
2492 */ ) 2456 */
2493 (sym) 2457 (sym))
2494 Lisp_Object sym;
2495 { 2458 {
2496 REGISTER Lisp_Object valcontents; 2459 REGISTER Lisp_Object valcontents;
2497 2460
2498 CHECK_SYMBOL (sym); 2461 CHECK_SYMBOL (sym);
2499 2462
2571 2534
2572 return Qnil; 2535 return Qnil;
2573 } 2536 }
2574 2537
2575 2538
2576 DEFUN ("local-variable-p", Flocal_variable_p, Slocal_variable_p, 2, 3, 0 /* 2539 DEFUN ("local-variable-p", Flocal_variable_p, 2, 3, 0, /*
2577 Return t if SYMBOL's value is local to BUFFER. 2540 Return t if SYMBOL's value is local to BUFFER.
2578 If optional third arg AFTER-SET is true, return t if SYMBOL would be 2541 If optional third arg AFTER-SET is true, return t if SYMBOL would be
2579 buffer-local after it is set, regardless of whether it is so presently. 2542 buffer-local after it is set, regardless of whether it is so presently.
2580 A nil value for BUFFER is *not* the same as (current-buffer), but means 2543 A nil value for BUFFER is *not* the same as (current-buffer), but means
2581 "no buffer". Specifically: 2544 "no buffer". Specifically:
2585 buffer-local. (This includes `buffer-file-name', `buffer-read-only', 2548 buffer-local. (This includes `buffer-file-name', `buffer-read-only',
2586 `buffer-undo-list', and others.) 2549 `buffer-undo-list', and others.)
2587 2550
2588 -- If BUFFER is nil and AFTER-SET is t, a return value of t indicates that 2551 -- If BUFFER is nil and AFTER-SET is t, a return value of t indicates that
2589 the variable has had `make-variable-buffer-local' applied to it. 2552 the variable has had `make-variable-buffer-local' applied to it.
2590 */ ) 2553 */
2591 (symbol, buffer, after_set) 2554 (symbol, buffer, after_set))
2592 Lisp_Object symbol, buffer, after_set;
2593 { 2555 {
2594 int local_info; 2556 int local_info;
2595 2557
2596 CHECK_SYMBOL (symbol); 2558 CHECK_SYMBOL (symbol);
2597 if (!NILP (buffer)) 2559 if (!NILP (buffer))
2881 return call5 (bfwd->handler[htype], sym, Flist (nargs, args), funsym, 2843 return call5 (bfwd->handler[htype], sym, Flist (nargs, args), funsym,
2882 bfwd->harg[htype], Qnil); 2844 bfwd->harg[htype], Qnil);
2883 } 2845 }
2884 2846
2885 DEFUN ("dontusethis-set-symbol-value-handler", 2847 DEFUN ("dontusethis-set-symbol-value-handler",
2886 Fdontusethis_set_symbol_value_handler, 2848 Fdontusethis_set_symbol_value_handler, 3, 5, 0, /*
2887 Sdontusethis_set_symbol_value_handler, 3, 5, 0 /*
2888 Don't you dare use this. 2849 Don't you dare use this.
2889 If you do, suffer the wrath of Ben, who is likely to rename 2850 If you do, suffer the wrath of Ben, who is likely to rename
2890 this function (or change the semantics of its arguments) without 2851 this function (or change the semantics of its arguments) without
2891 pity, thereby invalidating your code. 2852 pity, thereby invalidating your code.
2892 */ ) 2853 */
2893 (variable, handler_type, handler, harg, keep_existing) 2854 (variable, handler_type, handler, harg, keep_existing))
2894 Lisp_Object variable, handler_type, handler, harg, keep_existing;
2895 { 2855 {
2896 Lisp_Object valcontents; 2856 Lisp_Object valcontents;
2897 struct symbol_value_lisp_magic *bfwd; 2857 struct symbol_value_lisp_magic *bfwd;
2898 enum lisp_magic_handler htype; 2858 enum lisp_magic_handler htype;
2899 int i; 2859 int i;
3000 } 2960 }
3001 2961
3002 return hare; 2962 return hare;
3003 } 2963 }
3004 2964
3005 DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 2, 0 /* 2965 DEFUN ("defvaralias", Fdefvaralias, 2, 2, 0, /*
3006 Define a variable as an alias for another variable. 2966 Define a variable as an alias for another variable.
3007 Thenceforth, any operations performed on VARIABLE will actually be 2967 Thenceforth, any operations performed on VARIABLE will actually be
3008 performed on ALIAS. Both VARIABLE and ALIAS should be symbols. 2968 performed on ALIAS. Both VARIABLE and ALIAS should be symbols.
3009 If ALIAS is nil, remove any aliases for VARIABLE. 2969 If ALIAS is nil, remove any aliases for VARIABLE.
3010 ALIAS can itself be aliased, and the chain of variable aliases 2970 ALIAS can itself be aliased, and the chain of variable aliases
3012 If VARIABLE already has a value, this value will be shadowed 2972 If VARIABLE already has a value, this value will be shadowed
3013 until the alias is removed, at which point it will be restored. 2973 until the alias is removed, at which point it will be restored.
3014 Currently VARIABLE cannot be a built-in variable, a variable that 2974 Currently VARIABLE cannot be a built-in variable, a variable that
3015 has a buffer-local value in any buffer, or the symbols nil or t. 2975 has a buffer-local value in any buffer, or the symbols nil or t.
3016 (ALIAS, however, can be any type of variable.) 2976 (ALIAS, however, can be any type of variable.)
3017 */ ) 2977 */
3018 (variable, alias) 2978 (variable, alias))
3019 Lisp_Object variable, alias;
3020 { 2979 {
3021 struct symbol_value_varalias *bfwd; 2980 struct symbol_value_varalias *bfwd;
3022 Lisp_Object valcontents; 2981 Lisp_Object valcontents;
3023 2982
3024 CHECK_SYMBOL (variable); 2983 CHECK_SYMBOL (variable);
3059 XSETSYMBOL_VALUE_MAGIC (valcontents, bfwd); 3018 XSETSYMBOL_VALUE_MAGIC (valcontents, bfwd);
3060 XSYMBOL (variable)->value = valcontents; 3019 XSYMBOL (variable)->value = valcontents;
3061 return Qnil; 3020 return Qnil;
3062 } 3021 }
3063 3022
3064 DEFUN ("variable-alias", Fvariable_alias, Svariable_alias, 1, 2, 0 /* 3023 DEFUN ("variable-alias", Fvariable_alias, 1, 2, 0, /*
3065 If VARIABLE is aliased to another variable, return that variable. 3024 If VARIABLE is aliased to another variable, return that variable.
3066 VARIABLE should be a symbol. If VARIABLE is not aliased, return nil. 3025 VARIABLE should be a symbol. If VARIABLE is not aliased, return nil.
3067 Variable aliases are created with `defvaralias'. See also 3026 Variable aliases are created with `defvaralias'. See also
3068 `indirect-variable'. 3027 `indirect-variable'.
3069 */ ) 3028 */
3070 (variable, follow_past_lisp_magic) 3029 (variable, follow_past_lisp_magic))
3071 Lisp_Object variable, follow_past_lisp_magic;
3072 { 3030 {
3073 Lisp_Object valcontents; 3031 Lisp_Object valcontents;
3074 3032
3075 CHECK_SYMBOL (variable); 3033 CHECK_SYMBOL (variable);
3076 if (!NILP (follow_past_lisp_magic) && !EQ (follow_past_lisp_magic, Qt)) 3034 if (!NILP (follow_past_lisp_magic) && !EQ (follow_past_lisp_magic, Qt))
3087 (XSYMBOL_VALUE_VARALIAS (valcontents)); 3045 (XSYMBOL_VALUE_VARALIAS (valcontents));
3088 else 3046 else
3089 return Qnil; 3047 return Qnil;
3090 } 3048 }
3091 3049
3092 DEFUN ("indirect-variable", Findirect_variable, Sindirect_variable, 1, 2, 0 /* 3050 DEFUN ("indirect-variable", Findirect_variable, 1, 2, 0, /*
3093 Return the variable at the end of OBJECT's variable-alias chain. 3051 Return the variable at the end of OBJECT's variable-alias chain.
3094 If OBJECT is a symbol, follow all variable aliases and return 3052 If OBJECT is a symbol, follow all variable aliases and return
3095 the final (non-aliased) symbol. Variable aliases are created with 3053 the final (non-aliased) symbol. Variable aliases are created with
3096 the function `defvaralias'. 3054 the function `defvaralias'.
3097 If OBJECT is not a symbol, just return it. 3055 If OBJECT is not a symbol, just return it.
3098 Signal a cyclic-variable-indirection error if there is a loop in the 3056 Signal a cyclic-variable-indirection error if there is a loop in the
3099 variable chain of symbols. 3057 variable chain of symbols.
3100 */ ) 3058 */
3101 (object, follow_past_lisp_magic) 3059 (object, follow_past_lisp_magic))
3102 Lisp_Object object, follow_past_lisp_magic;
3103 { 3060 {
3104 if (!SYMBOLP (object)) 3061 if (!SYMBOLP (object))
3105 return object; 3062 return object;
3106 if (!NILP (follow_past_lisp_magic) && !EQ (follow_past_lisp_magic, Qt)) 3063 if (!NILP (follow_past_lisp_magic) && !EQ (follow_past_lisp_magic, Qt))
3107 { 3064 {
3281 defsymbol (&Qconst_current_buffer, "const-current-buffer"); 3238 defsymbol (&Qconst_current_buffer, "const-current-buffer");
3282 defsymbol (&Qdefault_console, "default-console"); 3239 defsymbol (&Qdefault_console, "default-console");
3283 defsymbol (&Qselected_console, "selected-console"); 3240 defsymbol (&Qselected_console, "selected-console");
3284 defsymbol (&Qconst_selected_console, "const-selected-console"); 3241 defsymbol (&Qconst_selected_console, "const-selected-console");
3285 3242
3286 defsubr (&Sintern); 3243 DEFSUBR (Fintern);
3287 defsubr (&Sintern_soft); 3244 DEFSUBR (Fintern_soft);
3288 defsubr (&Sunintern); 3245 DEFSUBR (Funintern);
3289 defsubr (&Smapatoms); 3246 DEFSUBR (Fmapatoms);
3290 defsubr (&Sapropos_internal); 3247 DEFSUBR (Fapropos_internal);
3291 3248
3292 defsubr (&Ssymbol_function); 3249 DEFSUBR (Fsymbol_function);
3293 defsubr (&Ssymbol_plist); 3250 DEFSUBR (Fsymbol_plist);
3294 defsubr (&Ssymbol_name); 3251 DEFSUBR (Fsymbol_name);
3295 defsubr (&Smakunbound); 3252 DEFSUBR (Fmakunbound);
3296 defsubr (&Sfmakunbound); 3253 DEFSUBR (Ffmakunbound);
3297 defsubr (&Sboundp); 3254 DEFSUBR (Fboundp);
3298 defsubr (&Sglobally_boundp); 3255 DEFSUBR (Fglobally_boundp);
3299 defsubr (&Sfboundp); 3256 DEFSUBR (Ffboundp);
3300 defsubr (&Sfset); 3257 DEFSUBR (Ffset);
3301 defsubr (&Sdefine_function); 3258 DEFSUBR (Fdefine_function);
3302 defsubr (&Ssetplist); 3259 DEFSUBR (Fsetplist);
3303 defsubr (&Ssymbol_value_in_buffer); 3260 DEFSUBR (Fsymbol_value_in_buffer);
3304 defsubr (&Ssymbol_value_in_console); 3261 DEFSUBR (Fsymbol_value_in_console);
3305 defsubr (&Sbuilt_in_variable_type); 3262 DEFSUBR (Fbuilt_in_variable_type);
3306 defsubr (&Ssymbol_value); 3263 DEFSUBR (Fsymbol_value);
3307 defsubr (&Sset); 3264 DEFSUBR (Fset);
3308 defsubr (&Sdefault_boundp); 3265 DEFSUBR (Fdefault_boundp);
3309 defsubr (&Sdefault_value); 3266 DEFSUBR (Fdefault_value);
3310 defsubr (&Sset_default); 3267 DEFSUBR (Fset_default);
3311 defsubr (&Ssetq_default); 3268 DEFSUBR (Fsetq_default);
3312 defsubr (&Smake_variable_buffer_local); 3269 DEFSUBR (Fmake_variable_buffer_local);
3313 defsubr (&Smake_local_variable); 3270 DEFSUBR (Fmake_local_variable);
3314 defsubr (&Skill_local_variable); 3271 DEFSUBR (Fkill_local_variable);
3315 defsubr (&Skill_console_local_variable); 3272 DEFSUBR (Fkill_console_local_variable);
3316 defsubr (&Slocal_variable_p); 3273 DEFSUBR (Flocal_variable_p);
3317 defsubr (&Sdefvaralias); 3274 DEFSUBR (Fdefvaralias);
3318 defsubr (&Svariable_alias); 3275 DEFSUBR (Fvariable_alias);
3319 defsubr (&Sindirect_variable); 3276 DEFSUBR (Findirect_variable);
3320 defsubr (&Sdontusethis_set_symbol_value_handler); 3277 DEFSUBR (Fdontusethis_set_symbol_value_handler);
3321 } 3278 }
3322 3279
3323 /* Create and initialize a variable whose value is forwarded to C data */ 3280 /* Create and initialize a variable whose value is forwarded to C data */
3324 void 3281 void
3325 defvar_mumble (CONST char *namestring, 3282 defvar_mumble (CONST char *namestring,