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/textprop.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/textprop.c')
| -rw-r--r-- | src/textprop.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/textprop.c b/src/textprop.c index 53f92ec936b..8cd9d580c4c 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -73,6 +73,7 @@ Lisp_Object interval_insert_behind_hooks; | |||
| 73 | Lisp_Object interval_insert_in_front_hooks; | 73 | Lisp_Object interval_insert_in_front_hooks; |
| 74 | 74 | ||
| 75 | static void text_read_only (Lisp_Object) NO_RETURN; | 75 | static void text_read_only (Lisp_Object) NO_RETURN; |
| 76 | INFUN (Fprevious_property_change, 3); | ||
| 76 | 77 | ||
| 77 | 78 | ||
| 78 | /* Signal a `text-read-only' error. This function makes it easier | 79 | /* Signal a `text-read-only' error. This function makes it easier |
| @@ -544,7 +545,7 @@ interval_of (int position, Lisp_Object object) | |||
| 544 | return find_interval (i, position); | 545 | return find_interval (i, position); |
| 545 | } | 546 | } |
| 546 | 547 | ||
| 547 | DEFUN ("text-properties-at", Ftext_properties_at, | 548 | DEFUE ("text-properties-at", Ftext_properties_at, |
| 548 | Stext_properties_at, 1, 2, 0, | 549 | Stext_properties_at, 1, 2, 0, |
| 549 | doc: /* Return the list of properties of the character at POSITION in OBJECT. | 550 | doc: /* Return the list of properties of the character at POSITION in OBJECT. |
| 550 | If the optional second argument OBJECT is a buffer (or nil, which means | 551 | If the optional second argument OBJECT is a buffer (or nil, which means |
| @@ -571,7 +572,7 @@ If POSITION is at the end of OBJECT, the value is nil. */) | |||
| 571 | return i->plist; | 572 | return i->plist; |
| 572 | } | 573 | } |
| 573 | 574 | ||
| 574 | DEFUN ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0, | 575 | DEFUE ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0, |
| 575 | doc: /* Return the value of POSITION's property PROP, in OBJECT. | 576 | doc: /* Return the value of POSITION's property PROP, in OBJECT. |
| 576 | OBJECT is optional and defaults to the current buffer. | 577 | OBJECT is optional and defaults to the current buffer. |
| 577 | If POSITION is at the end of OBJECT, the value is nil. */) | 578 | If POSITION is at the end of OBJECT, the value is nil. */) |
| @@ -646,7 +647,7 @@ get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop, | |||
| 646 | return Fget_text_property (position, prop, object); | 647 | return Fget_text_property (position, prop, object); |
| 647 | } | 648 | } |
| 648 | 649 | ||
| 649 | DEFUN ("get-char-property", Fget_char_property, Sget_char_property, 2, 3, 0, | 650 | DEFUE ("get-char-property", Fget_char_property, Sget_char_property, 2, 3, 0, |
| 650 | doc: /* Return the value of POSITION's property PROP, in OBJECT. | 651 | doc: /* Return the value of POSITION's property PROP, in OBJECT. |
| 651 | Both overlay properties and text properties are checked. | 652 | Both overlay properties and text properties are checked. |
| 652 | OBJECT is optional and defaults to the current buffer. | 653 | OBJECT is optional and defaults to the current buffer. |
| @@ -683,7 +684,7 @@ POSITION is at the end of OBJECT, both car and cdr are nil. */) | |||
| 683 | } | 684 | } |
| 684 | 685 | ||
| 685 | 686 | ||
| 686 | DEFUN ("next-char-property-change", Fnext_char_property_change, | 687 | DEFUE ("next-char-property-change", Fnext_char_property_change, |
| 687 | Snext_char_property_change, 1, 2, 0, | 688 | Snext_char_property_change, 1, 2, 0, |
| 688 | doc: /* Return the position of next text property or overlay change. | 689 | doc: /* Return the position of next text property or overlay change. |
| 689 | This scans characters forward in the current buffer from POSITION till | 690 | This scans characters forward in the current buffer from POSITION till |
| @@ -708,7 +709,7 @@ LIMIT is a no-op if it is greater than (point-max). */) | |||
| 708 | return Fnext_property_change (position, Qnil, temp); | 709 | return Fnext_property_change (position, Qnil, temp); |
| 709 | } | 710 | } |
| 710 | 711 | ||
| 711 | DEFUN ("previous-char-property-change", Fprevious_char_property_change, | 712 | DEFUE ("previous-char-property-change", Fprevious_char_property_change, |
| 712 | Sprevious_char_property_change, 1, 2, 0, | 713 | Sprevious_char_property_change, 1, 2, 0, |
| 713 | doc: /* Return the position of previous text property or overlay change. | 714 | doc: /* Return the position of previous text property or overlay change. |
| 714 | Scans characters backward in the current buffer from POSITION till it | 715 | Scans characters backward in the current buffer from POSITION till it |
| @@ -734,7 +735,7 @@ LIMIT is a no-op if it is less than (point-min). */) | |||
| 734 | } | 735 | } |
| 735 | 736 | ||
| 736 | 737 | ||
| 737 | DEFUN ("next-single-char-property-change", Fnext_single_char_property_change, | 738 | DEFUE ("next-single-char-property-change", Fnext_single_char_property_change, |
| 738 | Snext_single_char_property_change, 2, 4, 0, | 739 | Snext_single_char_property_change, 2, 4, 0, |
| 739 | doc: /* Return the position of next text property or overlay change for a specific property. | 740 | doc: /* Return the position of next text property or overlay change for a specific property. |
| 740 | Scans characters forward from POSITION till it finds | 741 | Scans characters forward from POSITION till it finds |
| @@ -817,7 +818,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 817 | return position; | 818 | return position; |
| 818 | } | 819 | } |
| 819 | 820 | ||
| 820 | DEFUN ("previous-single-char-property-change", | 821 | DEFUE ("previous-single-char-property-change", |
| 821 | Fprevious_single_char_property_change, | 822 | Fprevious_single_char_property_change, |
| 822 | Sprevious_single_char_property_change, 2, 4, 0, | 823 | Sprevious_single_char_property_change, 2, 4, 0, |
| 823 | doc: /* Return the position of previous text property or overlay change for a specific property. | 824 | doc: /* Return the position of previous text property or overlay change for a specific property. |
| @@ -910,7 +911,7 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 910 | return position; | 911 | return position; |
| 911 | } | 912 | } |
| 912 | 913 | ||
| 913 | DEFUN ("next-property-change", Fnext_property_change, | 914 | DEFUE ("next-property-change", Fnext_property_change, |
| 914 | Snext_property_change, 1, 3, 0, | 915 | Snext_property_change, 1, 3, 0, |
| 915 | doc: /* Return the position of next property change. | 916 | doc: /* Return the position of next property change. |
| 916 | Scans characters forward from POSITION in OBJECT till it finds | 917 | Scans characters forward from POSITION in OBJECT till it finds |
| @@ -974,7 +975,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 974 | return make_number (next->position); | 975 | return make_number (next->position); |
| 975 | } | 976 | } |
| 976 | 977 | ||
| 977 | DEFUN ("next-single-property-change", Fnext_single_property_change, | 978 | DEFUE ("next-single-property-change", Fnext_single_property_change, |
| 978 | Snext_single_property_change, 2, 4, 0, | 979 | Snext_single_property_change, 2, 4, 0, |
| 979 | doc: /* Return the position of next property change for a specific property. | 980 | doc: /* Return the position of next property change for a specific property. |
| 980 | Scans characters forward from POSITION till it finds | 981 | Scans characters forward from POSITION till it finds |
| @@ -1022,7 +1023,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 1022 | return make_number (next->position); | 1023 | return make_number (next->position); |
| 1023 | } | 1024 | } |
| 1024 | 1025 | ||
| 1025 | DEFUN ("previous-property-change", Fprevious_property_change, | 1026 | DEFUE ("previous-property-change", Fprevious_property_change, |
| 1026 | Sprevious_property_change, 1, 3, 0, | 1027 | Sprevious_property_change, 1, 3, 0, |
| 1027 | doc: /* Return the position of previous property change. | 1028 | doc: /* Return the position of previous property change. |
| 1028 | Scans characters backwards from POSITION in OBJECT till it finds | 1029 | Scans characters backwards from POSITION in OBJECT till it finds |
| @@ -1069,7 +1070,7 @@ back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) | |||
| 1069 | return make_number (previous->position + LENGTH (previous)); | 1070 | return make_number (previous->position + LENGTH (previous)); |
| 1070 | } | 1071 | } |
| 1071 | 1072 | ||
| 1072 | DEFUN ("previous-single-property-change", Fprevious_single_property_change, | 1073 | DEFUE ("previous-single-property-change", Fprevious_single_property_change, |
| 1073 | Sprevious_single_property_change, 2, 4, 0, | 1074 | Sprevious_single_property_change, 2, 4, 0, |
| 1074 | doc: /* Return the position of previous property change for a specific property. | 1075 | doc: /* Return the position of previous property change for a specific property. |
| 1075 | Scans characters backward from POSITION till it finds | 1076 | Scans characters backward from POSITION till it finds |
| @@ -1123,7 +1124,7 @@ back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) | |||
| 1123 | 1124 | ||
| 1124 | /* Callers note, this can GC when OBJECT is a buffer (or nil). */ | 1125 | /* Callers note, this can GC when OBJECT is a buffer (or nil). */ |
| 1125 | 1126 | ||
| 1126 | DEFUN ("add-text-properties", Fadd_text_properties, | 1127 | DEFUE ("add-text-properties", Fadd_text_properties, |
| 1127 | Sadd_text_properties, 3, 4, 0, | 1128 | Sadd_text_properties, 3, 4, 0, |
| 1128 | doc: /* Add properties to the text from START to END. | 1129 | doc: /* Add properties to the text from START to END. |
| 1129 | The third argument PROPERTIES is a property list | 1130 | The third argument PROPERTIES is a property list |
| @@ -1232,7 +1233,7 @@ Return t if any property value actually changed, nil otherwise. */) | |||
| 1232 | 1233 | ||
| 1233 | /* Callers note, this can GC when OBJECT is a buffer (or nil). */ | 1234 | /* Callers note, this can GC when OBJECT is a buffer (or nil). */ |
| 1234 | 1235 | ||
| 1235 | DEFUN ("put-text-property", Fput_text_property, | 1236 | DEFUE ("put-text-property", Fput_text_property, |
| 1236 | Sput_text_property, 4, 5, 0, | 1237 | Sput_text_property, 4, 5, 0, |
| 1237 | doc: /* Set one property of the text from START to END. | 1238 | doc: /* Set one property of the text from START to END. |
| 1238 | The third and fourth arguments PROPERTY and VALUE | 1239 | The third and fourth arguments PROPERTY and VALUE |
| @@ -1248,7 +1249,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */ | |||
| 1248 | return Qnil; | 1249 | return Qnil; |
| 1249 | } | 1250 | } |
| 1250 | 1251 | ||
| 1251 | DEFUN ("set-text-properties", Fset_text_properties, | 1252 | DEFUE ("set-text-properties", Fset_text_properties, |
| 1252 | Sset_text_properties, 3, 4, 0, | 1253 | Sset_text_properties, 3, 4, 0, |
| 1253 | doc: /* Completely replace properties of text from START to END. | 1254 | doc: /* Completely replace properties of text from START to END. |
| 1254 | The third argument PROPERTIES is the new property list. | 1255 | The third argument PROPERTIES is the new property list. |
| @@ -1415,7 +1416,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie | |||
| 1415 | while (len > 0); | 1416 | while (len > 0); |
| 1416 | } | 1417 | } |
| 1417 | 1418 | ||
| 1418 | DEFUN ("remove-text-properties", Fremove_text_properties, | 1419 | DEFUE ("remove-text-properties", Fremove_text_properties, |
| 1419 | Sremove_text_properties, 3, 4, 0, | 1420 | Sremove_text_properties, 3, 4, 0, |
| 1420 | doc: /* Remove some properties from text from START to END. | 1421 | doc: /* Remove some properties from text from START to END. |
| 1421 | The third argument PROPERTIES is a property list | 1422 | The third argument PROPERTIES is a property list |
| @@ -1505,7 +1506,7 @@ Use `set-text-properties' if you want to remove all text properties. */) | |||
| 1505 | } | 1506 | } |
| 1506 | } | 1507 | } |
| 1507 | 1508 | ||
| 1508 | DEFUN ("remove-list-of-text-properties", Fremove_list_of_text_properties, | 1509 | DEFUE ("remove-list-of-text-properties", Fremove_list_of_text_properties, |
| 1509 | Sremove_list_of_text_properties, 3, 4, 0, | 1510 | Sremove_list_of_text_properties, 3, 4, 0, |
| 1510 | doc: /* Remove some properties from text from START to END. | 1511 | doc: /* Remove some properties from text from START to END. |
| 1511 | The third argument LIST-OF-PROPERTIES is a list of property names to remove. | 1512 | The third argument LIST-OF-PROPERTIES is a list of property names to remove. |
| @@ -1615,7 +1616,7 @@ Return t if any property was actually removed, nil otherwise. */) | |||
| 1615 | } | 1616 | } |
| 1616 | } | 1617 | } |
| 1617 | 1618 | ||
| 1618 | DEFUN ("text-property-any", Ftext_property_any, | 1619 | DEFUE ("text-property-any", Ftext_property_any, |
| 1619 | Stext_property_any, 4, 5, 0, | 1620 | Stext_property_any, 4, 5, 0, |
| 1620 | doc: /* Check text from START to END for property PROPERTY equalling VALUE. | 1621 | doc: /* Check text from START to END for property PROPERTY equalling VALUE. |
| 1621 | If so, return the position of the first character whose property PROPERTY | 1622 | If so, return the position of the first character whose property PROPERTY |