aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.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/editfns.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/editfns.c')
-rw-r--r--src/editfns.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 85b30de6975..0c34a95b949 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -108,7 +108,7 @@ static void transpose_markers (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
108 EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT); 108 EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT);
109 109
110Lisp_Object Qbuffer_access_fontify_functions; 110Lisp_Object Qbuffer_access_fontify_functions;
111Lisp_Object Fuser_full_name (Lisp_Object); 111INFUN (Fuser_full_name, 1);
112 112
113/* Symbol for the text property used to mark fields. */ 113/* Symbol for the text property used to mark fields. */
114 114
@@ -185,7 +185,7 @@ init_editfns (void)
185#endif 185#endif
186} 186}
187 187
188DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0, 188DEFUE ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0,
189 doc: /* Convert arg CHAR to a string containing that character. 189 doc: /* Convert arg CHAR to a string containing that character.
190usage: (char-to-string CHAR) */) 190usage: (char-to-string CHAR) */)
191 (Lisp_Object character) 191 (Lisp_Object character)
@@ -239,7 +239,7 @@ buildmark (EMACS_INT charpos, EMACS_INT bytepos)
239 return mark; 239 return mark;
240} 240}
241 241
242DEFUN ("point", Fpoint, Spoint, 0, 0, 0, 242DEFUE ("point", Fpoint, Spoint, 0, 0, 0,
243 doc: /* Return value of point, as an integer. 243 doc: /* Return value of point, as an integer.
244Beginning of buffer is position (point-min). */) 244Beginning of buffer is position (point-min). */)
245 (void) 245 (void)
@@ -249,7 +249,7 @@ Beginning of buffer is position (point-min). */)
249 return temp; 249 return temp;
250} 250}
251 251
252DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0, 252DEFUE ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0,
253 doc: /* Return value of point, as a marker object. */) 253 doc: /* Return value of point, as a marker object. */)
254 (void) 254 (void)
255{ 255{
@@ -267,7 +267,7 @@ clip_to_bounds (EMACS_INT lower, EMACS_INT num, EMACS_INT upper)
267 return num; 267 return num;
268} 268}
269 269
270DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ", 270DEFUE ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ",
271 doc: /* Set point to POSITION, a number or marker. 271 doc: /* Set point to POSITION, a number or marker.
272Beginning of buffer is position (point-min), end is (point-max). 272Beginning of buffer is position (point-min), end is (point-max).
273 273
@@ -663,7 +663,7 @@ is before LIMIT, then LIMIT will be returned instead. */)
663 return make_number (beg); 663 return make_number (beg);
664} 664}
665 665
666DEFUN ("field-end", Ffield_end, Sfield_end, 0, 3, 0, 666DEFUE ("field-end", Ffield_end, Sfield_end, 0, 3, 0,
667 doc: /* Return the end of the field surrounding POS. 667 doc: /* Return the end of the field surrounding POS.
668A field is a region of text with the same `field' property. 668A field is a region of text with the same `field' property.
669If POS is nil, the value of point is used for POS. 669If POS is nil, the value of point is used for POS.
@@ -678,7 +678,7 @@ is after LIMIT, then LIMIT will be returned instead. */)
678 return make_number (end); 678 return make_number (end);
679} 679}
680 680
681DEFUN ("constrain-to-field", Fconstrain_to_field, Sconstrain_to_field, 2, 5, 0, 681DEFUE ("constrain-to-field", Fconstrain_to_field, Sconstrain_to_field, 2, 5, 0,
682 doc: /* Return the position closest to NEW-POS that is in the same field as OLD-POS. 682 doc: /* Return the position closest to NEW-POS that is in the same field as OLD-POS.
683 683
684A field is a region of text with the same `field' property. 684A field is a region of text with the same `field' property.
@@ -787,7 +787,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
787} 787}
788 788
789 789
790DEFUN ("line-beginning-position", 790DEFUE ("line-beginning-position",
791 Fline_beginning_position, Sline_beginning_position, 0, 1, 0, 791 Fline_beginning_position, Sline_beginning_position, 0, 1, 0,
792 doc: /* Return the character position of the first character on the current line. 792 doc: /* Return the character position of the first character on the current line.
793With argument N not nil or 1, move forward N - 1 lines first. 793With argument N not nil or 1, move forward N - 1 lines first.
@@ -829,7 +829,7 @@ This function does not move point. */)
829 Qt, Qnil); 829 Qt, Qnil);
830} 830}
831 831
832DEFUN ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0, 832DEFUE ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0,
833 doc: /* Return the character position of the last character on the current line. 833 doc: /* Return the character position of the last character on the current line.
834With argument N not nil or 1, move forward N - 1 lines first. 834With argument N not nil or 1, move forward N - 1 lines first.
835If scan reaches end of buffer, return that position. 835If scan reaches end of buffer, return that position.
@@ -1048,7 +1048,7 @@ is in effect, in which case it is less. */)
1048 return temp; 1048 return temp;
1049} 1049}
1050 1050
1051DEFUN ("point-max-marker", Fpoint_max_marker, Spoint_max_marker, 0, 0, 0, 1051DEFUE ("point-max-marker", Fpoint_max_marker, Spoint_max_marker, 0, 0, 0,
1052 doc: /* Return a marker to the maximum permissible value of point in this buffer. 1052 doc: /* Return a marker to the maximum permissible value of point in this buffer.
1053This is (1+ (buffer-size)), unless narrowing (a buffer restriction) 1053This is (1+ (buffer-size)), unless narrowing (a buffer restriction)
1054is in effect, in which case it is less. */) 1054is in effect, in which case it is less. */)
@@ -1099,7 +1099,7 @@ If BYTEPOS is out of range, the value is nil. */)
1099 return make_number (BYTE_TO_CHAR (XINT (bytepos))); 1099 return make_number (BYTE_TO_CHAR (XINT (bytepos)));
1100} 1100}
1101 1101
1102DEFUN ("following-char", Ffollowing_char, Sfollowing_char, 0, 0, 0, 1102DEFUE ("following-char", Ffollowing_char, Sfollowing_char, 0, 0, 0,
1103 doc: /* Return the character following point, as a number. 1103 doc: /* Return the character following point, as a number.
1104At the end of the buffer or accessible region, return 0. */) 1104At the end of the buffer or accessible region, return 0. */)
1105 (void) 1105 (void)
@@ -1112,7 +1112,7 @@ At the end of the buffer or accessible region, return 0. */)
1112 return temp; 1112 return temp;
1113} 1113}
1114 1114
1115DEFUN ("preceding-char", Fprevious_char, Sprevious_char, 0, 0, 0, 1115DEFUE ("preceding-char", Fprevious_char, Sprevious_char, 0, 0, 0,
1116 doc: /* Return the character preceding point, as a number. 1116 doc: /* Return the character preceding point, as a number.
1117At the beginning of the buffer or accessible region, return 0. */) 1117At the beginning of the buffer or accessible region, return 0. */)
1118 (void) 1118 (void)
@@ -1131,7 +1131,7 @@ At the beginning of the buffer or accessible region, return 0. */)
1131 return temp; 1131 return temp;
1132} 1132}
1133 1133
1134DEFUN ("bobp", Fbobp, Sbobp, 0, 0, 0, 1134DEFUE ("bobp", Fbobp, Sbobp, 0, 0, 0,
1135 doc: /* Return t if point is at the beginning of the buffer. 1135 doc: /* Return t if point is at the beginning of the buffer.
1136If the buffer is narrowed, this means the beginning of the narrowed part. */) 1136If the buffer is narrowed, this means the beginning of the narrowed part. */)
1137 (void) 1137 (void)
@@ -1141,7 +1141,7 @@ If the buffer is narrowed, this means the beginning of the narrowed part. */)
1141 return Qnil; 1141 return Qnil;
1142} 1142}
1143 1143
1144DEFUN ("eobp", Feobp, Seobp, 0, 0, 0, 1144DEFUE ("eobp", Feobp, Seobp, 0, 0, 0,
1145 doc: /* Return t if point is at the end of the buffer. 1145 doc: /* Return t if point is at the end of the buffer.
1146If the buffer is narrowed, this means the end of the narrowed part. */) 1146If the buffer is narrowed, this means the end of the narrowed part. */)
1147 (void) 1147 (void)
@@ -1151,7 +1151,7 @@ If the buffer is narrowed, this means the end of the narrowed part. */)
1151 return Qnil; 1151 return Qnil;
1152} 1152}
1153 1153
1154DEFUN ("bolp", Fbolp, Sbolp, 0, 0, 0, 1154DEFUE ("bolp", Fbolp, Sbolp, 0, 0, 0,
1155 doc: /* Return t if point is at the beginning of a line. */) 1155 doc: /* Return t if point is at the beginning of a line. */)
1156 (void) 1156 (void)
1157{ 1157{
@@ -1160,7 +1160,7 @@ DEFUN ("bolp", Fbolp, Sbolp, 0, 0, 0,
1160 return Qnil; 1160 return Qnil;
1161} 1161}
1162 1162
1163DEFUN ("eolp", Feolp, Seolp, 0, 0, 0, 1163DEFUE ("eolp", Feolp, Seolp, 0, 0, 0,
1164 doc: /* Return t if point is at the end of a line. 1164 doc: /* Return t if point is at the end of a line.
1165`End of a line' includes point being at the end of the buffer. */) 1165`End of a line' includes point being at the end of the buffer. */)
1166 (void) 1166 (void)
@@ -1170,7 +1170,7 @@ DEFUN ("eolp", Feolp, Seolp, 0, 0, 0,
1170 return Qnil; 1170 return Qnil;
1171} 1171}
1172 1172
1173DEFUN ("char-after", Fchar_after, Schar_after, 0, 1, 0, 1173DEFUE ("char-after", Fchar_after, Schar_after, 0, 1, 0,
1174 doc: /* Return character in current buffer at position POS. 1174 doc: /* Return character in current buffer at position POS.
1175POS is an integer or a marker and defaults to point. 1175POS is an integer or a marker and defaults to point.
1176If POS is out of range, the value is nil. */) 1176If POS is out of range, the value is nil. */)
@@ -1247,7 +1247,7 @@ If POS is out of range, the value is nil. */)
1247 return val; 1247 return val;
1248} 1248}
1249 1249
1250DEFUN ("user-login-name", Fuser_login_name, Suser_login_name, 0, 1, 0, 1250DEFUE ("user-login-name", Fuser_login_name, Suser_login_name, 0, 1, 0,
1251 doc: /* Return the name under which the user logged in, as a string. 1251 doc: /* Return the name under which the user logged in, as a string.
1252This is based on the effective uid, not the real uid. 1252This is based on the effective uid, not the real uid.
1253Also, if the environment variables LOGNAME or USER are set, 1253Also, if the environment variables LOGNAME or USER are set,
@@ -1387,7 +1387,7 @@ name, or nil if there is no such user. */)
1387 return full; 1387 return full;
1388} 1388}
1389 1389
1390DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0, 1390DEFUE ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
1391 doc: /* Return the host name of the machine you are running on, as a string. */) 1391 doc: /* Return the host name of the machine you are running on, as a string. */)
1392 (void) 1392 (void)
1393{ 1393{
@@ -1462,7 +1462,7 @@ lo_time (time_t t)
1462 return t & ((1 << 16) - 1); 1462 return t & ((1 << 16) - 1);
1463} 1463}
1464 1464
1465DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0, 1465DEFUE ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0,
1466 doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00. 1466 doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00.
1467The time is returned as a list of three integers. The first has the 1467The time is returned as a list of three integers. The first has the
1468most significant 16 bits of the seconds, while the second has the 1468most significant 16 bits of the seconds, while the second has the
@@ -1481,7 +1481,7 @@ resolution finer than a second. */)
1481 make_number (EMACS_USECS (t))); 1481 make_number (EMACS_USECS (t)));
1482} 1482}
1483 1483
1484DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time, 1484DEFUE ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time,
1485 0, 0, 0, 1485 0, 0, 0,
1486 doc: /* Return the current run time used by Emacs. 1486 doc: /* Return the current run time used by Emacs.
1487The time is returned as a list of three integers. The first has the 1487The time is returned as a list of three integers. The first has the
@@ -2255,7 +2255,7 @@ insert1 (Lisp_Object arg)
2255 not be used after calling insert or insert_from_string, so 2255 not be used after calling insert or insert_from_string, so
2256 we don't care if it gets trashed. */ 2256 we don't care if it gets trashed. */
2257 2257
2258DEFUN ("insert", Finsert, Sinsert, 0, MANY, 0, 2258DEFUE ("insert", Finsert, Sinsert, 0, MANY, 0,
2259 doc: /* Insert the arguments, either strings or characters, at point. 2259 doc: /* Insert the arguments, either strings or characters, at point.
2260Point and before-insertion markers move forward to end up 2260Point and before-insertion markers move forward to end up
2261 after the inserted text. 2261 after the inserted text.
@@ -2335,7 +2335,7 @@ usage: (insert-before-markers-and-inherit &rest ARGS) */)
2335 return Qnil; 2335 return Qnil;
2336} 2336}
2337 2337
2338DEFUN ("insert-char", Finsert_char, Sinsert_char, 2, 3, 0, 2338DEFUE ("insert-char", Finsert_char, Sinsert_char, 2, 3, 0,
2339 doc: /* Insert COUNT copies of CHARACTER. 2339 doc: /* Insert COUNT copies of CHARACTER.
2340Point, and before-insertion markers, are relocated as in the function `insert'. 2340Point, and before-insertion markers, are relocated as in the function `insert'.
2341The optional third arg INHERIT, if non-nil, says to inherit text properties 2341The optional third arg INHERIT, if non-nil, says to inherit text properties
@@ -2509,7 +2509,7 @@ update_buffer_properties (EMACS_INT start, EMACS_INT end)
2509 } 2509 }
2510} 2510}
2511 2511
2512DEFUN ("buffer-substring", Fbuffer_substring, Sbuffer_substring, 2, 2, 0, 2512DEFUE ("buffer-substring", Fbuffer_substring, Sbuffer_substring, 2, 2, 0,
2513 doc: /* Return the contents of part of the current buffer as a string. 2513 doc: /* Return the contents of part of the current buffer as a string.
2514The two arguments START and END are character positions; 2514The two arguments START and END are character positions;
2515they can be in either order. 2515they can be in either order.
@@ -2545,7 +2545,7 @@ they can be in either order. */)
2545 return make_buffer_string (b, e, 0); 2545 return make_buffer_string (b, e, 0);
2546} 2546}
2547 2547
2548DEFUN ("buffer-string", Fbuffer_string, Sbuffer_string, 0, 0, 0, 2548DEFUE ("buffer-string", Fbuffer_string, Sbuffer_string, 0, 0, 0,
2549 doc: /* Return the contents of the current buffer as a string. 2549 doc: /* Return the contents of the current buffer as a string.
2550If narrowing is in effect, this function returns only the visible part 2550If narrowing is in effect, this function returns only the visible part
2551of the buffer. */) 2551of the buffer. */)
@@ -3183,7 +3183,7 @@ It returns the number of characters changed. */)
3183 return make_number (cnt); 3183 return make_number (cnt);
3184} 3184}
3185 3185
3186DEFUN ("delete-region", Fdelete_region, Sdelete_region, 2, 2, "r", 3186DEFUE ("delete-region", Fdelete_region, Sdelete_region, 2, 2, "r",
3187 doc: /* Delete the text between point and mark. 3187 doc: /* Delete the text between point and mark.
3188 3188
3189When called from a program, expects two arguments, 3189When called from a program, expects two arguments,
@@ -3206,7 +3206,7 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
3206 return del_range_1 (XINT (start), XINT (end), 1, 1); 3206 return del_range_1 (XINT (start), XINT (end), 1, 1);
3207} 3207}
3208 3208
3209DEFUN ("widen", Fwiden, Swiden, 0, 0, "", 3209DEFUE ("widen", Fwiden, Swiden, 0, 0, "",
3210 doc: /* Remove restrictions (narrowing) from current buffer. 3210 doc: /* Remove restrictions (narrowing) from current buffer.
3211This allows the buffer's full text to be seen and edited. */) 3211This allows the buffer's full text to be seen and edited. */)
3212 (void) 3212 (void)
@@ -3221,7 +3221,7 @@ This allows the buffer's full text to be seen and edited. */)
3221 return Qnil; 3221 return Qnil;
3222} 3222}
3223 3223
3224DEFUN ("narrow-to-region", Fnarrow_to_region, Snarrow_to_region, 2, 2, "r", 3224DEFUE ("narrow-to-region", Fnarrow_to_region, Snarrow_to_region, 2, 2, "r",
3225 doc: /* Restrict editing in this buffer to the current region. 3225 doc: /* Restrict editing in this buffer to the current region.
3226The rest of the text becomes temporarily invisible and untouchable 3226The rest of the text becomes temporarily invisible and untouchable
3227but is not deleted; if you save the buffer in a file, the invisible 3227but is not deleted; if you save the buffer in a file, the invisible
@@ -3382,7 +3382,7 @@ static char *message_text;
3382/* Allocated length of that buffer. */ 3382/* Allocated length of that buffer. */
3383static int message_length; 3383static int message_length;
3384 3384
3385DEFUN ("message", Fmessage, Smessage, 1, MANY, 0, 3385DEFUE ("message", Fmessage, Smessage, 1, MANY, 0,
3386 doc: /* Display a message at the bottom of the screen. 3386 doc: /* Display a message at the bottom of the screen.
3387The message also goes into the `*Messages*' buffer. 3387The message also goes into the `*Messages*' buffer.
3388\(In keyboard macros, that's all it does.) 3388\(In keyboard macros, that's all it does.)
@@ -3494,7 +3494,7 @@ usage: (message-or-box FORMAT-STRING &rest ARGS) */)
3494 return Fmessage (nargs, args); 3494 return Fmessage (nargs, args);
3495} 3495}
3496 3496
3497DEFUN ("current-message", Fcurrent_message, Scurrent_message, 0, 0, 0, 3497DEFUE ("current-message", Fcurrent_message, Scurrent_message, 0, 0, 0,
3498 doc: /* Return the string currently displayed in the echo area, or nil if none. */) 3498 doc: /* Return the string currently displayed in the echo area, or nil if none. */)
3499 (void) 3499 (void)
3500{ 3500{
@@ -3543,7 +3543,7 @@ usage: (propertize STRING &rest PROPERTIES) */)
3543 ? count_size_as_multibyte (SDATA (STRING), SBYTES (STRING)) \ 3543 ? count_size_as_multibyte (SDATA (STRING), SBYTES (STRING)) \
3544 : SBYTES (STRING)) 3544 : SBYTES (STRING))
3545 3545
3546DEFUN ("format", Fformat, Sformat, 1, MANY, 0, 3546DEFUE ("format", Fformat, Sformat, 1, MANY, 0,
3547 doc: /* Format a string out of a format-string and arguments. 3547 doc: /* Format a string out of a format-string and arguments.
3548The first argument is a format control string. 3548The first argument is a format control string.
3549The other arguments are substituted into it to make the result, a string. 3549The other arguments are substituted into it to make the result, a string.