diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-10 18:41:15 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-10 18:41:15 -0700 |
commit | 16a97296c05ec9d5bb4ffeae9dce90fc63f578ed (patch) | |
tree | 0801b434f760fd8dded7204501ffcdb82460720c /src/keymap.c | |
parent | 785bbd422461295890087ced24bfd87504032d0c (diff) | |
download | emacs-16a97296c05ec9d5bb4ffeae9dce90fc63f578ed.tar.gz |
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/keymap.c')
-rw-r--r-- | src/keymap.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/keymap.c b/src/keymap.c index 10000b935aa..9adf2898736 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -70,6 +70,7 @@ static Lisp_Object where_is_cache; /* Which keymaps are reverse-stored in the cache. */ static Lisp_Object where_is_cache_keymaps; +INFUN (Flookup_key, 3); static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object); static void fix_submap_inheritance (Lisp_Object, Lisp_Object, Lisp_Object); @@ -108,7 +109,7 @@ in case you use it as a menu with `x-popup-menu'. */) Fcons (Fmake_char_table (Qkeymap, Qnil), tail)); } -DEFUN ("make-sparse-keymap", Fmake_sparse_keymap, Smake_sparse_keymap, 0, 1, 0, +DEFUE ("make-sparse-keymap", Fmake_sparse_keymap, Smake_sparse_keymap, 0, 1, 0, doc: /* Construct and return a new sparse keymap. Its car is `keymap' and its cdr is an alist of (CHAR . DEFINITION), which binds the character CHAR to DEFINITION, or (SYMBOL . DEFINITION), @@ -160,7 +161,7 @@ is also allowed as an element. */) return (KEYMAPP (object) ? Qt : Qnil); } -DEFUN ("keymap-prompt", Fkeymap_prompt, Skeymap_prompt, 1, 1, 0, +DEFUE ("keymap-prompt", Fkeymap_prompt, Skeymap_prompt, 1, 1, 0, doc: /* Return the prompt-string of a keymap MAP. If non-nil, the prompt is shown in the echo-area when reading a key-sequence to be looked-up in this keymap. */) @@ -291,7 +292,7 @@ keymap_memberp (Lisp_Object map, Lisp_Object maps) /* Set the parent keymap of MAP to PARENT. */ -DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, +DEFUE ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, doc: /* Modify KEYMAP to set its parent map to PARENT. Return PARENT. PARENT should be nil or another keymap. */) (Lisp_Object keymap, Lisp_Object parent) @@ -955,7 +956,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def) return def; } -EXFUN (Fcopy_keymap, 1); +INFUN (Fcopy_keymap, 1); static Lisp_Object copy_keymap_item (Lisp_Object elt) @@ -1079,7 +1080,7 @@ is not copied. */) /* GC is possible in this function if it autoloads a keymap. */ -DEFUN ("define-key", Fdefine_key, Sdefine_key, 3, 3, 0, +DEFUE ("define-key", Fdefine_key, Sdefine_key, 3, 3, 0, doc: /* In KEYMAP, define key sequence KEY as DEF. KEYMAP is a keymap. @@ -1210,7 +1211,7 @@ binding KEY to DEF is added at the front of KEYMAP. */) /* This function may GC (it calls Fkey_binding). */ -DEFUN ("command-remapping", Fcommand_remapping, Scommand_remapping, 1, 3, 0, +DEFUE ("command-remapping", Fcommand_remapping, Scommand_remapping, 1, 3, 0, doc: /* Return the remapping for command COMMAND. Returns nil if COMMAND is not remapped (or not a symbol). @@ -1518,7 +1519,7 @@ current_minor_maps (Lisp_Object **modeptr, Lisp_Object **mapptr) return i; } -DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, +DEFUE ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, 0, 2, 0, doc: /* Return a list of the currently active keymaps. OLP if non-nil indicates that we should obey `overriding-local-map' and @@ -1661,7 +1662,7 @@ like in the respective argument of `key-binding'. */) /* GC is possible in this function if it autoloads a keymap. */ -DEFUN ("key-binding", Fkey_binding, Skey_binding, 1, 4, 0, +DEFUE ("key-binding", Fkey_binding, Skey_binding, 1, 4, 0, doc: /* Return the binding for command KEY in current keymaps. KEY is a string or vector, a sequence of keystrokes. The binding is probably a symbol with a function definition. @@ -2178,7 +2179,7 @@ Lisp_Object Qsingle_key_description, Qkey_description; /* This function cannot GC. */ -DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0, +DEFUE ("key-description", Fkey_description, Skey_description, 1, 2, 0, doc: /* Return a pretty description of key-sequence KEYS. Optional arg PREFIX is the sequence of keys leading up to KEYS. Control characters turn into "C-foo" sequences, meta into "M-foo", @@ -2397,7 +2398,7 @@ push_key_description (register unsigned int c, register char *p, int force_multi /* This function cannot GC. */ -DEFUN ("single-key-description", Fsingle_key_description, +DEFUE ("single-key-description", Fsingle_key_description, Ssingle_key_description, 1, 2, 0, doc: /* Return a pretty description of command character KEY. Control characters turn into C-whatever, etc. @@ -2675,7 +2676,7 @@ where_is_internal (Lisp_Object definition, Lisp_Object keymaps, /* This function can GC if Flookup_key autoloads any keymaps. */ -DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 5, 0, +DEFUE ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 5, 0, doc: /* Return list of keys that invoke DEFINITION. If KEYMAP is a keymap, search only KEYMAP and the global keymap. If KEYMAP is nil, search all the currently active keymaps. |