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/window.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/window.c')
| -rw-r--r-- | src/window.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/window.c b/src/window.c index a8a6fceaaee..72ab2a3ea10 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -216,7 +216,7 @@ make_window (void) | |||
| 216 | return val; | 216 | return val; |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0, | 219 | DEFUE ("selected-window", Fselected_window, Sselected_window, 0, 0, 0, |
| 220 | doc: /* Return the window that the cursor now appears in and commands apply to. */) | 220 | doc: /* Return the window that the cursor now appears in and commands apply to. */) |
| 221 | (void) | 221 | (void) |
| 222 | { | 222 | { |
| @@ -235,7 +235,8 @@ used by that frame. */) | |||
| 235 | return FRAME_MINIBUF_WINDOW (XFRAME (frame)); | 235 | return FRAME_MINIBUF_WINDOW (XFRAME (frame)); |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 1, 0, | 238 | DEFUE ("window-minibuffer-p", Fwindow_minibuffer_p, |
| 239 | Swindow_minibuffer_p, 0, 1, 0, | ||
| 239 | doc: /* Return non-nil if WINDOW is a minibuffer window. | 240 | doc: /* Return non-nil if WINDOW is a minibuffer window. |
| 240 | WINDOW defaults to the selected window. */) | 241 | WINDOW defaults to the selected window. */) |
| 241 | (Lisp_Object window) | 242 | (Lisp_Object window) |
| @@ -245,7 +246,7 @@ WINDOW defaults to the selected window. */) | |||
| 245 | } | 246 | } |
| 246 | 247 | ||
| 247 | 248 | ||
| 248 | DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, | 249 | DEFUE ("pos-visible-in-window-p", Fpos_visible_in_window_p, |
| 249 | Spos_visible_in_window_p, 0, 3, 0, | 250 | Spos_visible_in_window_p, 0, 3, 0, |
| 250 | doc: /* Return non-nil if position POS is currently on the frame in WINDOW. | 251 | doc: /* Return non-nil if position POS is currently on the frame in WINDOW. |
| 251 | Return nil if that position is scrolled vertically out of view. | 252 | Return nil if that position is scrolled vertically out of view. |
| @@ -442,7 +443,7 @@ decode_any_window (register Lisp_Object window) | |||
| 442 | return XWINDOW (window); | 443 | return XWINDOW (window); |
| 443 | } | 444 | } |
| 444 | 445 | ||
| 445 | DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, | 446 | DEFUE ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, |
| 446 | doc: /* Return the buffer that WINDOW is displaying. | 447 | doc: /* Return the buffer that WINDOW is displaying. |
| 447 | WINDOW defaults to the selected window. */) | 448 | WINDOW defaults to the selected window. */) |
| 448 | (Lisp_Object window) | 449 | (Lisp_Object window) |
| @@ -1196,7 +1197,7 @@ if it isn't already recorded. */) | |||
| 1196 | return value; | 1197 | return value; |
| 1197 | } | 1198 | } |
| 1198 | 1199 | ||
| 1199 | DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, | 1200 | DEFUE ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0, |
| 1200 | doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. | 1201 | doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer. |
| 1201 | Return POS. */) | 1202 | Return POS. */) |
| 1202 | (Lisp_Object window, Lisp_Object pos) | 1203 | (Lisp_Object window, Lisp_Object pos) |
| @@ -1243,7 +1244,7 @@ overriding motion of point in order to display at this exact start. */) | |||
| 1243 | } | 1244 | } |
| 1244 | 1245 | ||
| 1245 | 1246 | ||
| 1246 | DEFUN ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p, | 1247 | DEFUE ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p, |
| 1247 | 0, 1, 0, | 1248 | 0, 1, 0, |
| 1248 | doc: /* Return non-nil when WINDOW is dedicated to its buffer. | 1249 | doc: /* Return non-nil when WINDOW is dedicated to its buffer. |
| 1249 | More precisely, return the value assigned by the last call of | 1250 | More precisely, return the value assigned by the last call of |
| @@ -1484,7 +1485,7 @@ and so is its new parent, we should make replacement's | |||
| 1484 | children be children of that parent instead. ***/ | 1485 | children be children of that parent instead. ***/ |
| 1485 | } | 1486 | } |
| 1486 | 1487 | ||
| 1487 | DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | 1488 | DEFUE ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", |
| 1488 | doc: /* Remove WINDOW from its frame. | 1489 | doc: /* Remove WINDOW from its frame. |
| 1489 | WINDOW defaults to the selected window. Return nil. | 1490 | WINDOW defaults to the selected window. Return nil. |
| 1490 | Signal an error when WINDOW is the only window on its frame. */) | 1491 | Signal an error when WINDOW is the only window on its frame. */) |
| @@ -1945,7 +1946,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in | |||
| 1945 | } | 1946 | } |
| 1946 | 1947 | ||
| 1947 | 1948 | ||
| 1948 | DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, | 1949 | DEFUE ("next-window", Fnext_window, Snext_window, 0, 3, 0, |
| 1949 | doc: /* Return window following WINDOW in cyclic ordering of windows. | 1950 | doc: /* Return window following WINDOW in cyclic ordering of windows. |
| 1950 | WINDOW defaults to the selected window. The optional arguments | 1951 | WINDOW defaults to the selected window. The optional arguments |
| 1951 | MINIBUF and ALL-FRAMES specify the set of windows to consider. | 1952 | MINIBUF and ALL-FRAMES specify the set of windows to consider. |
| @@ -2396,7 +2397,7 @@ If FRAME is a frame, search only that frame. */) | |||
| 2396 | frame); | 2397 | frame); |
| 2397 | } | 2398 | } |
| 2398 | 2399 | ||
| 2399 | DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0, | 2400 | DEFUE ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0, |
| 2400 | doc: /* Return a window currently displaying BUFFER-OR-NAME, or nil if none. | 2401 | doc: /* Return a window currently displaying BUFFER-OR-NAME, or nil if none. |
| 2401 | BUFFER-OR-NAME may be a buffer or a buffer name and defaults to the | 2402 | BUFFER-OR-NAME may be a buffer or a buffer name and defaults to the |
| 2402 | current buffer. | 2403 | current buffer. |
| @@ -3275,8 +3276,10 @@ change_window_heights (Lisp_Object window, int n) | |||
| 3275 | 3276 | ||
| 3276 | int window_select_count; | 3277 | int window_select_count; |
| 3277 | 3278 | ||
| 3278 | EXFUN (Fset_window_fringes, 4); | 3279 | INFUN (Fset_window_margins, 3); |
| 3279 | EXFUN (Fset_window_scroll_bars, 4); | 3280 | INFUN (Fset_window_fringes, 4); |
| 3281 | INFUN (Fset_window_scroll_bars, 4); | ||
| 3282 | INFUN (Fset_window_vscroll, 3); | ||
| 3280 | 3283 | ||
| 3281 | static void | 3284 | static void |
| 3282 | run_funs (Lisp_Object funs) | 3285 | run_funs (Lisp_Object funs) |
| @@ -3441,7 +3444,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int | |||
| 3441 | } | 3444 | } |
| 3442 | 3445 | ||
| 3443 | 3446 | ||
| 3444 | DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0, | 3447 | DEFUE ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0, |
| 3445 | doc: /* Make WINDOW display BUFFER-OR-NAME as its contents. | 3448 | doc: /* Make WINDOW display BUFFER-OR-NAME as its contents. |
| 3446 | WINDOW defaults to the selected window. BUFFER-OR-NAME must be a buffer | 3449 | WINDOW defaults to the selected window. BUFFER-OR-NAME must be a buffer |
| 3447 | or the name of an existing buffer. Optional third argument KEEP-MARGINS | 3450 | or the name of an existing buffer. Optional third argument KEEP-MARGINS |
| @@ -3571,7 +3574,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) | |||
| 3571 | /* Note that selected_window can be nil when this is called from | 3574 | /* Note that selected_window can be nil when this is called from |
| 3572 | Fset_window_configuration. */ | 3575 | Fset_window_configuration. */ |
| 3573 | 3576 | ||
| 3574 | DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, | 3577 | DEFUE ("select-window", Fselect_window, Sselect_window, 1, 2, 0, |
| 3575 | doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. | 3578 | doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. |
| 3576 | If WINDOW is not already selected, make WINDOW's buffer current | 3579 | If WINDOW is not already selected, make WINDOW's buffer current |
| 3577 | and make WINDOW the frame's selected window. Return WINDOW. | 3580 | and make WINDOW the frame's selected window. Return WINDOW. |
| @@ -5499,7 +5502,7 @@ displayed_window_lines (struct window *w) | |||
| 5499 | } | 5502 | } |
| 5500 | 5503 | ||
| 5501 | 5504 | ||
| 5502 | DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", | 5505 | DEFUE ("recenter", Frecenter, Srecenter, 0, 1, "P", |
| 5503 | doc: /* Center point in selected window and maybe redisplay frame. | 5506 | doc: /* Center point in selected window and maybe redisplay frame. |
| 5504 | With prefix argument ARG, recenter putting point on screen line ARG | 5507 | With prefix argument ARG, recenter putting point on screen line ARG |
| 5505 | relative to the selected window. If ARG is negative, it counts up from the | 5508 | relative to the selected window. If ARG is negative, it counts up from the |
| @@ -5852,7 +5855,7 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config | |||
| 5852 | return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; | 5855 | return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; |
| 5853 | } | 5856 | } |
| 5854 | 5857 | ||
| 5855 | DEFUN ("set-window-configuration", Fset_window_configuration, | 5858 | DEFUE ("set-window-configuration", Fset_window_configuration, |
| 5856 | Sset_window_configuration, 1, 1, 0, | 5859 | Sset_window_configuration, 1, 1, 0, |
| 5857 | doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION. | 5860 | doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION. |
| 5858 | CONFIGURATION must be a value previously returned | 5861 | CONFIGURATION must be a value previously returned |
| @@ -6349,7 +6352,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) | |||
| 6349 | return i; | 6352 | return i; |
| 6350 | } | 6353 | } |
| 6351 | 6354 | ||
| 6352 | DEFUN ("current-window-configuration", Fcurrent_window_configuration, | 6355 | DEFUE ("current-window-configuration", Fcurrent_window_configuration, |
| 6353 | Scurrent_window_configuration, 0, 1, 0, | 6356 | Scurrent_window_configuration, 0, 1, 0, |
| 6354 | doc: /* Return an object representing the current window configuration of FRAME. | 6357 | doc: /* Return an object representing the current window configuration of FRAME. |
| 6355 | If FRAME is nil or omitted, use the selected frame. | 6358 | If FRAME is nil or omitted, use the selected frame. |
| @@ -6541,7 +6544,7 @@ as nil. */) | |||
| 6541 | Fringes | 6544 | Fringes |
| 6542 | ***********************************************************************/ | 6545 | ***********************************************************************/ |
| 6543 | 6546 | ||
| 6544 | DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes, | 6547 | DEFUE ("set-window-fringes", Fset_window_fringes, Sset_window_fringes, |
| 6545 | 2, 4, 0, | 6548 | 2, 4, 0, |
| 6546 | doc: /* Set the fringe widths of window WINDOW. | 6549 | doc: /* Set the fringe widths of window WINDOW. |
| 6547 | If WINDOW is nil, set the fringe widths of the currently selected | 6550 | If WINDOW is nil, set the fringe widths of the currently selected |
| @@ -6607,8 +6610,8 @@ Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) | |||
| 6607 | Scroll bars | 6610 | Scroll bars |
| 6608 | ***********************************************************************/ | 6611 | ***********************************************************************/ |
| 6609 | 6612 | ||
| 6610 | DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars, Sset_window_scroll_bars, | 6613 | DEFUE ("set-window-scroll-bars", Fset_window_scroll_bars, |
| 6611 | 2, 4, 0, | 6614 | Sset_window_scroll_bars, 2, 4, 0, |
| 6612 | doc: /* Set width and type of scroll bars of window WINDOW. | 6615 | doc: /* Set width and type of scroll bars of window WINDOW. |
| 6613 | If window is nil, set scroll bars of the currently selected window. | 6616 | If window is nil, set scroll bars of the currently selected window. |
| 6614 | Second parameter WIDTH specifies the pixel width for the scroll bar; | 6617 | Second parameter WIDTH specifies the pixel width for the scroll bar; |