aboutsummaryrefslogtreecommitdiffstats
path: root/src/textprop.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/textprop.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/textprop.c')
-rw-r--r--src/textprop.c35
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;
73Lisp_Object interval_insert_in_front_hooks; 73Lisp_Object interval_insert_in_front_hooks;
74 74
75static void text_read_only (Lisp_Object) NO_RETURN; 75static void text_read_only (Lisp_Object) NO_RETURN;
76INFUN (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
547DEFUN ("text-properties-at", Ftext_properties_at, 548DEFUE ("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.
550If the optional second argument OBJECT is a buffer (or nil, which means 551If 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
574DEFUN ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0, 575DEFUE ("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.
576OBJECT is optional and defaults to the current buffer. 577OBJECT is optional and defaults to the current buffer.
577If POSITION is at the end of OBJECT, the value is nil. */) 578If 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
649DEFUN ("get-char-property", Fget_char_property, Sget_char_property, 2, 3, 0, 650DEFUE ("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.
651Both overlay properties and text properties are checked. 652Both overlay properties and text properties are checked.
652OBJECT is optional and defaults to the current buffer. 653OBJECT 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
686DEFUN ("next-char-property-change", Fnext_char_property_change, 687DEFUE ("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.
689This scans characters forward in the current buffer from POSITION till 690This 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
711DEFUN ("previous-char-property-change", Fprevious_char_property_change, 712DEFUE ("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.
714Scans characters backward in the current buffer from POSITION till it 715Scans 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
737DEFUN ("next-single-char-property-change", Fnext_single_char_property_change, 738DEFUE ("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.
740Scans characters forward from POSITION till it finds 741Scans 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
820DEFUN ("previous-single-char-property-change", 821DEFUE ("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
913DEFUN ("next-property-change", Fnext_property_change, 914DEFUE ("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.
916Scans characters forward from POSITION in OBJECT till it finds 917Scans 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
977DEFUN ("next-single-property-change", Fnext_single_property_change, 978DEFUE ("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.
980Scans characters forward from POSITION till it finds 981Scans 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
1025DEFUN ("previous-property-change", Fprevious_property_change, 1026DEFUE ("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.
1028Scans characters backwards from POSITION in OBJECT till it finds 1029Scans 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
1072DEFUN ("previous-single-property-change", Fprevious_single_property_change, 1073DEFUE ("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.
1075Scans characters backward from POSITION till it finds 1076Scans 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
1126DEFUN ("add-text-properties", Fadd_text_properties, 1127DEFUE ("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.
1129The third argument PROPERTIES is a property list 1130The 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
1235DEFUN ("put-text-property", Fput_text_property, 1236DEFUE ("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.
1238The third and fourth arguments PROPERTY and VALUE 1239The 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
1251DEFUN ("set-text-properties", Fset_text_properties, 1252DEFUE ("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.
1254The third argument PROPERTIES is the new property list. 1255The 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
1418DEFUN ("remove-text-properties", Fremove_text_properties, 1419DEFUE ("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.
1421The third argument PROPERTIES is a property list 1422The 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
1508DEFUN ("remove-list-of-text-properties", Fremove_list_of_text_properties, 1509DEFUE ("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.
1511The third argument LIST-OF-PROPERTIES is a list of property names to remove. 1512The 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
1618DEFUN ("text-property-any", Ftext_property_any, 1619DEFUE ("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.
1621If so, return the position of the first character whose property PROPERTY 1622If so, return the position of the first character whose property PROPERTY