Mercurial > emacs
comparison src/lread.c @ 109179:8cfee7d2955f
Convert DEFUNs to standard C.
* src/alloc.c: Convert DEFUNs to standard C.
* src/buffer.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/dosfns.c:
* src/editfns.c:
* src/emacs.c:
* src/eval.c:
* src/fileio.c:
* src/filelock.c:
* src/floatfns.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/image.c:
* src/indent.c:
* src/insdel.c:
* src/keyboard.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/menu.c:
* src/minibuf.c:
* src/msdos.c:
* src/nsfns.m:
* src/nsmenu.m:
* src/nsselect.m:
* src/print.c:
* src/process.c:
* src/search.c:
* src/sound.c:
* src/syntax.c:
* src/term.c:
* src/terminal.c:
* src/textprop.c:
* src/undo.c:
* src/w16select.c:
* src/w32console.c:
* src/w32fns.c:
* src/w32font.c:
* src/w32menu.c:
* src/w32proc.c:
* src/w32select.c:
* src/window.c:
* src/xdisp.c:
* src/xfaces.c:
* src/xfns.c:
* src/xmenu.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c: Likewise.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Thu, 08 Jul 2010 14:25:08 -0700 |
parents | 750db9f3e6d8 |
children | 60516122d066 |
comparison
equal
deleted
inserted
replaced
109178:53f8ebcd9a97 | 109179:8cfee7d2955f |
---|---|
777 is used for reading a character. | 777 is used for reading a character. |
778 If the optional argument SECONDS is non-nil, it should be a number | 778 If the optional argument SECONDS is non-nil, it should be a number |
779 specifying the maximum number of seconds to wait for input. If no | 779 specifying the maximum number of seconds to wait for input. If no |
780 input arrives in that time, return nil. SECONDS may be a | 780 input arrives in that time, return nil. SECONDS may be a |
781 floating-point value. */) | 781 floating-point value. */) |
782 (prompt, inherit_input_method, seconds) | 782 (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds) |
783 Lisp_Object prompt, inherit_input_method, seconds; | |
784 { | 783 { |
785 Lisp_Object val; | 784 Lisp_Object val; |
786 | 785 |
787 if (! NILP (prompt)) | 786 if (! NILP (prompt)) |
788 message_with_string ("%s", prompt, 0); | 787 message_with_string ("%s", prompt, 0); |
800 is used for reading a character. | 799 is used for reading a character. |
801 If the optional argument SECONDS is non-nil, it should be a number | 800 If the optional argument SECONDS is non-nil, it should be a number |
802 specifying the maximum number of seconds to wait for input. If no | 801 specifying the maximum number of seconds to wait for input. If no |
803 input arrives in that time, return nil. SECONDS may be a | 802 input arrives in that time, return nil. SECONDS may be a |
804 floating-point value. */) | 803 floating-point value. */) |
805 (prompt, inherit_input_method, seconds) | 804 (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds) |
806 Lisp_Object prompt, inherit_input_method, seconds; | |
807 { | 805 { |
808 if (! NILP (prompt)) | 806 if (! NILP (prompt)) |
809 message_with_string ("%s", prompt, 0); | 807 message_with_string ("%s", prompt, 0); |
810 return read_filtered_event (0, 0, 0, ! NILP (inherit_input_method), seconds); | 808 return read_filtered_event (0, 0, 0, ! NILP (inherit_input_method), seconds); |
811 } | 809 } |
822 is used for reading a character. | 820 is used for reading a character. |
823 If the optional argument SECONDS is non-nil, it should be a number | 821 If the optional argument SECONDS is non-nil, it should be a number |
824 specifying the maximum number of seconds to wait for input. If no | 822 specifying the maximum number of seconds to wait for input. If no |
825 input arrives in that time, return nil. SECONDS may be a | 823 input arrives in that time, return nil. SECONDS may be a |
826 floating-point value. */) | 824 floating-point value. */) |
827 (prompt, inherit_input_method, seconds) | 825 (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds) |
828 Lisp_Object prompt, inherit_input_method, seconds; | |
829 { | 826 { |
830 Lisp_Object val; | 827 Lisp_Object val; |
831 | 828 |
832 if (! NILP (prompt)) | 829 if (! NILP (prompt)) |
833 message_with_string ("%s", prompt, 0); | 830 message_with_string ("%s", prompt, 0); |
838 : make_number (char_resolve_modifier_mask (XINT (val)))); | 835 : make_number (char_resolve_modifier_mask (XINT (val)))); |
839 } | 836 } |
840 | 837 |
841 DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, | 838 DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, |
842 doc: /* Don't use this yourself. */) | 839 doc: /* Don't use this yourself. */) |
843 () | 840 (void) |
844 { | 841 { |
845 register Lisp_Object val; | 842 register Lisp_Object val; |
846 BLOCK_INPUT; | 843 BLOCK_INPUT; |
847 XSETINT (val, getc (instream)); | 844 XSETINT (val, getc (instream)); |
848 UNBLOCK_INPUT; | 845 UNBLOCK_INPUT; |
923 | 920 |
924 DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, | 921 DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, |
925 doc: /* Return the suffixes that `load' should try if a suffix is \ | 922 doc: /* Return the suffixes that `load' should try if a suffix is \ |
926 required. | 923 required. |
927 This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) | 924 This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) |
928 () | 925 (void) |
929 { | 926 { |
930 Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix, ext; | 927 Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix, ext; |
931 while (CONSP (suffixes)) | 928 while (CONSP (suffixes)) |
932 { | 929 { |
933 Lisp_Object exts = Vload_file_rep_suffixes; | 930 Lisp_Object exts = Vload_file_rep_suffixes; |
978 Loading a file records its definitions, and its `provide' and | 975 Loading a file records its definitions, and its `provide' and |
979 `require' calls, in an element of `load-history' whose | 976 `require' calls, in an element of `load-history' whose |
980 car is the file name loaded. See `load-history'. | 977 car is the file name loaded. See `load-history'. |
981 | 978 |
982 Return t if the file exists and loads successfully. */) | 979 Return t if the file exists and loads successfully. */) |
983 (file, noerror, nomessage, nosuffix, must_suffix) | 980 (Lisp_Object file, Lisp_Object noerror, Lisp_Object nomessage, Lisp_Object nosuffix, Lisp_Object must_suffix) |
984 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; | |
985 { | 981 { |
986 register FILE *stream; | 982 register FILE *stream; |
987 register int fd = -1; | 983 register int fd = -1; |
988 int count = SPECPDL_INDEX (); | 984 int count = SPECPDL_INDEX (); |
989 struct gcpro gcpro1, gcpro2, gcpro3; | 985 struct gcpro gcpro1, gcpro2, gcpro3; |
1329 If SUFFIXES is non-nil, it should be a list of suffixes to append to | 1325 If SUFFIXES is non-nil, it should be a list of suffixes to append to |
1330 file name when searching. | 1326 file name when searching. |
1331 If non-nil, PREDICATE is used instead of `file-readable-p'. | 1327 If non-nil, PREDICATE is used instead of `file-readable-p'. |
1332 PREDICATE can also be an integer to pass to the access(2) function, | 1328 PREDICATE can also be an integer to pass to the access(2) function, |
1333 in which case file-name-handlers are ignored. */) | 1329 in which case file-name-handlers are ignored. */) |
1334 (filename, path, suffixes, predicate) | 1330 (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Object predicate) |
1335 Lisp_Object filename, path, suffixes, predicate; | |
1336 { | 1331 { |
1337 Lisp_Object file; | 1332 Lisp_Object file; |
1338 int fd = openp (path, filename, suffixes, &file, predicate); | 1333 int fd = openp (path, filename, suffixes, &file, predicate); |
1339 if (NILP (predicate) && fd > 0) | 1334 if (NILP (predicate) && fd > 0) |
1340 close (fd); | 1335 close (fd); |
1783 invocation. | 1778 invocation. |
1784 DO-ALLOW-PRINT, if non-nil, specifies that `print' and related | 1779 DO-ALLOW-PRINT, if non-nil, specifies that `print' and related |
1785 functions should work normally even if PRINTFLAG is nil. | 1780 functions should work normally even if PRINTFLAG is nil. |
1786 | 1781 |
1787 This function preserves the position of point. */) | 1782 This function preserves the position of point. */) |
1788 (buffer, printflag, filename, unibyte, do_allow_print) | 1783 (Lisp_Object buffer, Lisp_Object printflag, Lisp_Object filename, Lisp_Object unibyte, Lisp_Object do_allow_print) |
1789 Lisp_Object buffer, printflag, filename, unibyte, do_allow_print; | |
1790 { | 1784 { |
1791 int count = SPECPDL_INDEX (); | 1785 int count = SPECPDL_INDEX (); |
1792 Lisp_Object tem, buf; | 1786 Lisp_Object tem, buf; |
1793 | 1787 |
1794 if (NILP (buffer)) | 1788 if (NILP (buffer)) |
1827 Also the fourth argument READ-FUNCTION, if non-nil, is used | 1821 Also the fourth argument READ-FUNCTION, if non-nil, is used |
1828 instead of `read' to read each expression. It gets one argument | 1822 instead of `read' to read each expression. It gets one argument |
1829 which is the input stream for reading characters. | 1823 which is the input stream for reading characters. |
1830 | 1824 |
1831 This function does not move point. */) | 1825 This function does not move point. */) |
1832 (start, end, printflag, read_function) | 1826 (Lisp_Object start, Lisp_Object end, Lisp_Object printflag, Lisp_Object read_function) |
1833 Lisp_Object start, end, printflag, read_function; | |
1834 { | 1827 { |
1835 int count = SPECPDL_INDEX (); | 1828 int count = SPECPDL_INDEX (); |
1836 Lisp_Object tem, cbuf; | 1829 Lisp_Object tem, cbuf; |
1837 | 1830 |
1838 cbuf = Fcurrent_buffer (); | 1831 cbuf = Fcurrent_buffer (); |
1862 a function (call it with no arguments for each character, | 1855 a function (call it with no arguments for each character, |
1863 call it with a char as argument to push a char back) | 1856 call it with a char as argument to push a char back) |
1864 a string (takes text from string, starting at the beginning) | 1857 a string (takes text from string, starting at the beginning) |
1865 t (read text line using minibuffer and use it, or read from | 1858 t (read text line using minibuffer and use it, or read from |
1866 standard input in batch mode). */) | 1859 standard input in batch mode). */) |
1867 (stream) | 1860 (Lisp_Object stream) |
1868 Lisp_Object stream; | |
1869 { | 1861 { |
1870 if (NILP (stream)) | 1862 if (NILP (stream)) |
1871 stream = Vstandard_input; | 1863 stream = Vstandard_input; |
1872 if (EQ (stream, Qt)) | 1864 if (EQ (stream, Qt)) |
1873 stream = Qread_char; | 1865 stream = Qread_char; |
1880 DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0, | 1872 DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0, |
1881 doc: /* Read one Lisp expression which is represented as text by STRING. | 1873 doc: /* Read one Lisp expression which is represented as text by STRING. |
1882 Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). | 1874 Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). |
1883 START and END optionally delimit a substring of STRING from which to read; | 1875 START and END optionally delimit a substring of STRING from which to read; |
1884 they default to 0 and (length STRING) respectively. */) | 1876 they default to 0 and (length STRING) respectively. */) |
1885 (string, start, end) | 1877 (Lisp_Object string, Lisp_Object start, Lisp_Object end) |
1886 Lisp_Object string, start, end; | |
1887 { | 1878 { |
1888 Lisp_Object ret; | 1879 Lisp_Object ret; |
1889 CHECK_STRING (string); | 1880 CHECK_STRING (string); |
1890 /* read_internal_start sets read_from_string_index. */ | 1881 /* read_internal_start sets read_from_string_index. */ |
1891 ret = read_internal_start (string, start, end); | 1882 ret = read_internal_start (string, start, end); |
3607 DEFUN ("intern", Fintern, Sintern, 1, 2, 0, | 3598 DEFUN ("intern", Fintern, Sintern, 1, 2, 0, |
3608 doc: /* Return the canonical symbol whose name is STRING. | 3599 doc: /* Return the canonical symbol whose name is STRING. |
3609 If there is none, one is created by this function and returned. | 3600 If there is none, one is created by this function and returned. |
3610 A second optional argument specifies the obarray to use; | 3601 A second optional argument specifies the obarray to use; |
3611 it defaults to the value of `obarray'. */) | 3602 it defaults to the value of `obarray'. */) |
3612 (string, obarray) | 3603 (Lisp_Object string, Lisp_Object obarray) |
3613 Lisp_Object string, obarray; | |
3614 { | 3604 { |
3615 register Lisp_Object tem, sym, *ptr; | 3605 register Lisp_Object tem, sym, *ptr; |
3616 | 3606 |
3617 if (NILP (obarray)) obarray = Vobarray; | 3607 if (NILP (obarray)) obarray = Vobarray; |
3618 obarray = check_obarray (obarray); | 3608 obarray = check_obarray (obarray); |
3655 doc: /* Return the canonical symbol named NAME, or nil if none exists. | 3645 doc: /* Return the canonical symbol named NAME, or nil if none exists. |
3656 NAME may be a string or a symbol. If it is a symbol, that exact | 3646 NAME may be a string or a symbol. If it is a symbol, that exact |
3657 symbol is searched for. | 3647 symbol is searched for. |
3658 A second optional argument specifies the obarray to use; | 3648 A second optional argument specifies the obarray to use; |
3659 it defaults to the value of `obarray'. */) | 3649 it defaults to the value of `obarray'. */) |
3660 (name, obarray) | 3650 (Lisp_Object name, Lisp_Object obarray) |
3661 Lisp_Object name, obarray; | |
3662 { | 3651 { |
3663 register Lisp_Object tem, string; | 3652 register Lisp_Object tem, string; |
3664 | 3653 |
3665 if (NILP (obarray)) obarray = Vobarray; | 3654 if (NILP (obarray)) obarray = Vobarray; |
3666 obarray = check_obarray (obarray); | 3655 obarray = check_obarray (obarray); |
3684 doc: /* Delete the symbol named NAME, if any, from OBARRAY. | 3673 doc: /* Delete the symbol named NAME, if any, from OBARRAY. |
3685 The value is t if a symbol was found and deleted, nil otherwise. | 3674 The value is t if a symbol was found and deleted, nil otherwise. |
3686 NAME may be a string or a symbol. If it is a symbol, that symbol | 3675 NAME may be a string or a symbol. If it is a symbol, that symbol |
3687 is deleted, if it belongs to OBARRAY--no other symbol is deleted. | 3676 is deleted, if it belongs to OBARRAY--no other symbol is deleted. |
3688 OBARRAY defaults to the value of the variable `obarray'. */) | 3677 OBARRAY defaults to the value of the variable `obarray'. */) |
3689 (name, obarray) | 3678 (Lisp_Object name, Lisp_Object obarray) |
3690 Lisp_Object name, obarray; | |
3691 { | 3679 { |
3692 register Lisp_Object string, tem; | 3680 register Lisp_Object string, tem; |
3693 int hash; | 3681 int hash; |
3694 | 3682 |
3695 if (NILP (obarray)) obarray = Vobarray; | 3683 if (NILP (obarray)) obarray = Vobarray; |
3837 } | 3825 } |
3838 | 3826 |
3839 DEFUN ("mapatoms", Fmapatoms, Smapatoms, 1, 2, 0, | 3827 DEFUN ("mapatoms", Fmapatoms, Smapatoms, 1, 2, 0, |
3840 doc: /* Call FUNCTION on every symbol in OBARRAY. | 3828 doc: /* Call FUNCTION on every symbol in OBARRAY. |
3841 OBARRAY defaults to the value of `obarray'. */) | 3829 OBARRAY defaults to the value of `obarray'. */) |
3842 (function, obarray) | 3830 (Lisp_Object function, Lisp_Object obarray) |
3843 Lisp_Object function, obarray; | |
3844 { | 3831 { |
3845 if (NILP (obarray)) obarray = Vobarray; | 3832 if (NILP (obarray)) obarray = Vobarray; |
3846 obarray = check_obarray (obarray); | 3833 obarray = check_obarray (obarray); |
3847 | 3834 |
3848 map_obarray (obarray, mapatoms_1, function); | 3835 map_obarray (obarray, mapatoms_1, function); |