diff options
| author | Paul Eggert | 2011-04-10 18:41:15 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-10 18:41:15 -0700 |
| commit | 16a97296c05ec9d5bb4ffeae9dce90fc63f578ed (patch) | |
| tree | 0801b434f760fd8dded7204501ffcdb82460720c /src/lread.c | |
| parent | 785bbd422461295890087ced24bfd87504032d0c (diff) | |
| download | emacs-16a97296c05ec9d5bb4ffeae9dce90fc63f578ed.tar.gz emacs-16a97296c05ec9d5bb4ffeae9dce90fc63f578ed.zip | |
Make Emacs functions such as Fatom 'static' by default.
This makes it easier for human readers (and static analyzers)
to see whether these functions can be called from other modules.
DEFUN now defines a static function. To make the function external
so that it can be used in other C modules, use the new macro DEFUE.
* lisp.h (DEFINE_FUNC): New macro, with the old contents of DEFUN.
(DEFUN): Rewrite in terms of DEFINE_FUNC. It now generates a
static function definition. Use DEFUE if you want an extern one.
(DEFUE, INFUN): New macros.
(Funibyte_char_to_multibyte, Fsyntax_table_p, Finit_image_library):
(Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
(Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
(Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
Remove decls, since these functions are now static.
(Funintern, Fget_internal_run_time): New decls, since these functions
were already external.
* alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
* ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
* doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
* fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
* keyboard.c, keymap.c, lread.c:
* macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
* syntax.c, term.c, terminal.c, textprop.c, undo.c:
* window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
Mark functions with DEFUE instead of DEFUN,
if they are used in other modules.
* buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
decls for now-static functions.
* buffer.h (Fdelete_overlay): Remove decl.
* callproc.c (Fgetenv_internal): Mark as internal.
* composite.c (Fremove_list_of_text_properties): Remove decl.
(Fcomposition_get_gstring): New forward static decl.
* composite.h (Fcomposite_get_gstring): Remove decl.
* dired.c (Ffile_attributes): New forward static decl.
* doc.c (Fdocumntation_property): New forward static decl.
* eval.c (Ffetch_bytecode): New forward static decl.
(Funintern): Remove extern decl; now in .h file where it belongs.
* fileio.c (Fmake_symbolic_link): New forward static decl.
* image.c (Finit_image_library): New forward static decl.
* insdel.c (Fcombine_after_change_execute): Make forward decl static.
* intervals.h (Fprevious_property_change):
(Fremove_list_of_text_properties): Remove decls.
* keyboard.c (Fthis_command_keys): Remove decl.
(Fcommand_execute): New forward static decl.
* keymap.c (Flookup_key): New forward static decl.
(Fcopy_keymap): Now static.
* keymap.h (Flookup_key): Remove decl.
* process.c (Fget_process): New forward static decl.
(Fprocess_datagram_address): Mark as internal.
* syntax.c (Fsyntax_table_p): New forward static decl.
(skip_chars): Remove duplicate decl.
* textprop.c (Fprevious_property_change): New forward static decl.
* window.c (Fset_window_fringes, Fset_window_scroll_bars):
Now internal.
(Fset_window_margins, Fset_window_vscroll): New forward static decls.
* window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lread.c b/src/lread.c index 8777bc34545..7d12f5a85d3 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -681,7 +681,7 @@ read_filtered_event (int no_switch_frame, int ascii_required, | |||
| 681 | return val; | 681 | return val; |
| 682 | } | 682 | } |
| 683 | 683 | ||
| 684 | DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, | 684 | DEFUE ("read-char", Fread_char, Sread_char, 0, 3, 0, |
| 685 | doc: /* Read a character from the command input (keyboard or macro). | 685 | doc: /* Read a character from the command input (keyboard or macro). |
| 686 | It is returned as a number. | 686 | It is returned as a number. |
| 687 | If the character has modifiers, they are resolved and reflected to the | 687 | If the character has modifiers, they are resolved and reflected to the |
| @@ -714,7 +714,7 @@ floating-point value. */) | |||
| 714 | : make_number (char_resolve_modifier_mask (XINT (val)))); | 714 | : make_number (char_resolve_modifier_mask (XINT (val)))); |
| 715 | } | 715 | } |
| 716 | 716 | ||
| 717 | DEFUN ("read-event", Fread_event, Sread_event, 0, 3, 0, | 717 | DEFUE ("read-event", Fread_event, Sread_event, 0, 3, 0, |
| 718 | doc: /* Read an event object from the input stream. | 718 | doc: /* Read an event object from the input stream. |
| 719 | If the optional argument PROMPT is non-nil, display that as a prompt. | 719 | If the optional argument PROMPT is non-nil, display that as a prompt. |
| 720 | If the optional argument INHERIT-INPUT-METHOD is non-nil and some | 720 | If the optional argument INHERIT-INPUT-METHOD is non-nil and some |
| @@ -950,7 +950,7 @@ load_warn_old_style_backquotes (Lisp_Object file) | |||
| 950 | return Qnil; | 950 | return Qnil; |
| 951 | } | 951 | } |
| 952 | 952 | ||
| 953 | DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, | 953 | DEFUE ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, |
| 954 | doc: /* Return the suffixes that `load' should try if a suffix is \ | 954 | doc: /* Return the suffixes that `load' should try if a suffix is \ |
| 955 | required. | 955 | required. |
| 956 | This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) | 956 | This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) |
| @@ -972,7 +972,7 @@ This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) | |||
| 972 | return Fnreverse (lst); | 972 | return Fnreverse (lst); |
| 973 | } | 973 | } |
| 974 | 974 | ||
| 975 | DEFUN ("load", Fload, Sload, 1, 5, 0, | 975 | DEFUE ("load", Fload, Sload, 1, 5, 0, |
| 976 | doc: /* Execute a file of Lisp code named FILE. | 976 | doc: /* Execute a file of Lisp code named FILE. |
| 977 | First try FILE with `.elc' appended, then try with `.el', | 977 | First try FILE with `.elc' appended, then try with `.el', |
| 978 | then try FILE unmodified (the exact suffixes in the exact order are | 978 | then try FILE unmodified (the exact suffixes in the exact order are |
| @@ -1906,7 +1906,7 @@ This function does not move point. */) | |||
| 1906 | } | 1906 | } |
| 1907 | 1907 | ||
| 1908 | 1908 | ||
| 1909 | DEFUN ("read", Fread, Sread, 0, 1, 0, | 1909 | DEFUE ("read", Fread, Sread, 0, 1, 0, |
| 1910 | doc: /* Read one Lisp expression as text from STREAM, return as Lisp object. | 1910 | doc: /* Read one Lisp expression as text from STREAM, return as Lisp object. |
| 1911 | If STREAM is nil, use the value of `standard-input' (which see). | 1911 | If STREAM is nil, use the value of `standard-input' (which see). |
| 1912 | STREAM or the value of `standard-input' may be: | 1912 | STREAM or the value of `standard-input' may be: |
| @@ -1929,7 +1929,7 @@ STREAM or the value of `standard-input' may be: | |||
| 1929 | return read_internal_start (stream, Qnil, Qnil); | 1929 | return read_internal_start (stream, Qnil, Qnil); |
| 1930 | } | 1930 | } |
| 1931 | 1931 | ||
| 1932 | DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0, | 1932 | DEFUE ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0, |
| 1933 | doc: /* Read one Lisp expression which is represented as text by STRING. | 1933 | doc: /* Read one Lisp expression which is represented as text by STRING. |
| 1934 | Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). | 1934 | Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). |
| 1935 | START and END optionally delimit a substring of STRING from which to read; | 1935 | START and END optionally delimit a substring of STRING from which to read; |
| @@ -3654,7 +3654,7 @@ make_symbol (const char *str) | |||
| 3654 | : make_string (str, len)); | 3654 | : make_string (str, len)); |
| 3655 | } | 3655 | } |
| 3656 | 3656 | ||
| 3657 | DEFUN ("intern", Fintern, Sintern, 1, 2, 0, | 3657 | DEFUE ("intern", Fintern, Sintern, 1, 2, 0, |
| 3658 | doc: /* Return the canonical symbol whose name is STRING. | 3658 | doc: /* Return the canonical symbol whose name is STRING. |
| 3659 | If there is none, one is created by this function and returned. | 3659 | If there is none, one is created by this function and returned. |
| 3660 | A second optional argument specifies the obarray to use; | 3660 | A second optional argument specifies the obarray to use; |
| @@ -3700,7 +3700,7 @@ it defaults to the value of `obarray'. */) | |||
| 3700 | return sym; | 3700 | return sym; |
| 3701 | } | 3701 | } |
| 3702 | 3702 | ||
| 3703 | DEFUN ("intern-soft", Fintern_soft, Sintern_soft, 1, 2, 0, | 3703 | DEFUE ("intern-soft", Fintern_soft, Sintern_soft, 1, 2, 0, |
| 3704 | doc: /* Return the canonical symbol named NAME, or nil if none exists. | 3704 | doc: /* Return the canonical symbol named NAME, or nil if none exists. |
| 3705 | NAME may be a string or a symbol. If it is a symbol, that exact | 3705 | NAME may be a string or a symbol. If it is a symbol, that exact |
| 3706 | symbol is searched for. | 3706 | symbol is searched for. |
| @@ -3728,7 +3728,7 @@ it defaults to the value of `obarray'. */) | |||
| 3728 | return tem; | 3728 | return tem; |
| 3729 | } | 3729 | } |
| 3730 | 3730 | ||
| 3731 | DEFUN ("unintern", Funintern, Sunintern, 1, 2, 0, | 3731 | DEFUE ("unintern", Funintern, Sunintern, 1, 2, 0, |
| 3732 | doc: /* Delete the symbol named NAME, if any, from OBARRAY. | 3732 | doc: /* Delete the symbol named NAME, if any, from OBARRAY. |
| 3733 | The value is t if a symbol was found and deleted, nil otherwise. | 3733 | The value is t if a symbol was found and deleted, nil otherwise. |
| 3734 | NAME may be a string or a symbol. If it is a symbol, that symbol | 3734 | NAME may be a string or a symbol. If it is a symbol, that symbol |