aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorPaul Eggert2011-04-10 18:41:15 -0700
committerPaul Eggert2011-04-10 18:41:15 -0700
commit16a97296c05ec9d5bb4ffeae9dce90fc63f578ed (patch)
tree0801b434f760fd8dded7204501ffcdb82460720c /src/syntax.c
parent785bbd422461295890087ced24bfd87504032d0c (diff)
downloademacs-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/syntax.c')
-rw-r--r--src/syntax.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 1301c0689ad..819a7542a7b 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -138,6 +138,7 @@ static EMACS_INT find_start_begv;
138static int find_start_modiff; 138static int find_start_modiff;
139 139
140 140
141INFUN (Fsyntax_table_p, 1);
141static Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int); 142static Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int);
142static Lisp_Object skip_syntaxes (int, Lisp_Object, Lisp_Object); 143static Lisp_Object skip_syntaxes (int, Lisp_Object, Lisp_Object);
143static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, int); 144static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, int);
@@ -1337,7 +1338,7 @@ scan_words (register EMACS_INT from, register EMACS_INT count)
1337 return from; 1338 return from;
1338} 1339}
1339 1340
1340DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 1, "^p", 1341DEFUE ("forward-word", Fforward_word, Sforward_word, 0, 1, "^p",
1341 doc: /* Move point forward ARG words (backward if ARG is negative). 1342 doc: /* Move point forward ARG words (backward if ARG is negative).
1342Normally returns t. 1343Normally returns t.
1343If an edge of the buffer or a field boundary is reached, point is left there 1344If an edge of the buffer or a field boundary is reached, point is left there
@@ -1366,9 +1367,7 @@ and the function returns nil. Field boundaries are not noticed if
1366 return val == orig_val ? Qt : Qnil; 1367 return val == orig_val ? Qt : Qnil;
1367} 1368}
1368 1369
1369Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int); 1370DEFUE ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0,
1370
1371DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0,
1372 doc: /* Move point forward, stopping before a char not in STRING, or at pos LIM. 1371 doc: /* Move point forward, stopping before a char not in STRING, or at pos LIM.
1373STRING is like the inside of a `[...]' in a regular expression 1372STRING is like the inside of a `[...]' in a regular expression
1374except that `]' is never special and `\\' quotes `^', `-' or `\\' 1373except that `]' is never special and `\\' quotes `^', `-' or `\\'
@@ -1383,7 +1382,7 @@ Returns the distance traveled, either zero or positive. */)
1383 return skip_chars (1, string, lim, 1); 1382 return skip_chars (1, string, lim, 1);
1384} 1383}
1385 1384
1386DEFUN ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2, 0, 1385DEFUE ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2, 0,
1387 doc: /* Move point backward, stopping after a char not in STRING, or at pos LIM. 1386 doc: /* Move point backward, stopping after a char not in STRING, or at pos LIM.
1388See `skip-chars-forward' for details. 1387See `skip-chars-forward' for details.
1389Returns the distance traveled, either zero or negative. */) 1388Returns the distance traveled, either zero or negative. */)