diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-11 23:01:37 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-11 23:01:37 -0700 |
commit | 8524aef308e0fe9955cfab9dc5c41ca62f7865cd (patch) | |
tree | ff170436532b585f5f960c16bee7d619ef80ab9f /src | |
parent | 16390cd253ff51ab31e3f5c607827486959e1c64 (diff) | |
download | emacs-8524aef308e0fe9955cfab9dc5c41ca62f7865cd.tar.gz |
* xdisp.c: Make symbols static if they're not exported.
* dispextern.h (scratch_glyph_row, window_box_edges):
(glyph_to_pixel_coords, set_cursor_from_row):
(get_next_display_element, set_iterator_to_next):
(highlight_trailing_whitespace, frame_to_window_pixel_xy):
(show_mouse_face): Remove decls
* frame.h (message_buf_print): Likewise.
* lisp.h (pop_message, set_message, check_point_in_composition):
Likewise.
* xterm.h (set_vertical_scroll_bar): Likewise.
* xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
(message_buf_print, scratch_glyph_row, displayed_buffer):
(set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
(get_next_display_element, show_mouse_face, window_box_edges):
(frame_to_window_pixel_xy, check_point_in_composition):
(set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
(glyph_to_pixel_coords): Remove; unused.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 18 | ||||
-rw-r--r-- | src/dispextern.h | 16 | ||||
-rw-r--r-- | src/frame.h | 5 | ||||
-rw-r--r-- | src/lisp.h | 4 | ||||
-rw-r--r-- | src/xdisp.c | 101 | ||||
-rw-r--r-- | src/xterm.h | 1 |
6 files changed, 44 insertions, 101 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 22938117ff1..dad33d964d7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,23 @@ 2011-04-12 Paul Eggert <eggert@cs.ucla.edu> + * xdisp.c: Make symbols static if they're not exported. + * dispextern.h (scratch_glyph_row, window_box_edges): + (glyph_to_pixel_coords, set_cursor_from_row): + (get_next_display_element, set_iterator_to_next): + (highlight_trailing_whitespace, frame_to_window_pixel_xy): + (show_mouse_face): Remove decls + * frame.h (message_buf_print): Likewise. + * lisp.h (pop_message, set_message, check_point_in_composition): + Likewise. + * xterm.h (set_vertical_scroll_bar): Likewise. + * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed): + (message_buf_print, scratch_glyph_row, displayed_buffer): + (set_iterator_to_next, pop_message, set_message, set_cursor_from_row): + (get_next_display_element, show_mouse_face, window_box_edges): + (frame_to_window_pixel_xy, check_point_in_composition): + (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static. + (glyph_to_pixel_coords): Remove; unused. + * dired.c (file_name_completion): Now static. * dbusbind.c (xd_in_read_queued_messages): Now static. diff --git a/src/dispextern.h b/src/dispextern.h index d957955ee33..a7ed24dd320 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1149,12 +1149,6 @@ extern int updated_area; extern int display_completed; -/* A temporary storage area, including a row of glyphs. Initialized - in xdisp.c. Used for various purposes, as an example see - get_overlay_arrow_glyph_row. */ - -extern struct glyph_row scratch_glyph_row; - /************************************************************************ @@ -2965,24 +2959,17 @@ int window_box_left (struct window *, int); int window_box_left_offset (struct window *, int); int window_box_right (struct window *, int); int window_box_right_offset (struct window *, int); -void window_box_edges (struct window *, int, int *, int *, int *, int *); int estimate_mode_line_height (struct frame *, enum face_id); void pixel_to_glyph_coords (struct frame *, int, int, int *, int *, NativeRectangle *, int); -int glyph_to_pixel_coords (struct window *, int, int, int *, int *); void remember_mouse_glyph (struct frame *, int, int, NativeRectangle *); void mark_window_display_accurate (Lisp_Object, int); void redisplay_preserve_echo_area (int); -int set_cursor_from_row (struct window *, struct glyph_row *, - struct glyph_matrix *, EMACS_INT, EMACS_INT, - int, int); void init_iterator (struct it *, struct window *, EMACS_INT, EMACS_INT, struct glyph_row *, enum face_id); void init_iterator_to_row_start (struct it *, struct window *, struct glyph_row *); -int get_next_display_element (struct it *); -void set_iterator_to_next (struct it *, int); void start_display (struct it *, struct window *, struct text_pos); void move_it_to (struct it *, EMACS_INT, int, int, int, int); void move_it_vertically (struct it *, int); @@ -2994,7 +2981,6 @@ void move_it_in_display_line (struct it *it, enum move_operation_enum op); int in_display_vector_p (struct it *); int frame_mode_line_height (struct frame *); -void highlight_trailing_whitespace (struct frame *, struct glyph_row *); extern Lisp_Object Qtool_bar; extern int redisplaying_p; extern int help_echo_showing_p; @@ -3057,12 +3043,10 @@ extern int x_intersect_rectangles (XRectangle *, XRectangle *, XRectangle *); #endif /* HAVE_WINDOW_SYSTEM */ -extern void frame_to_window_pixel_xy (struct window *, int *, int *); extern void note_mouse_highlight (struct frame *, int, int); extern void x_clear_window_mouse_face (struct window *); extern void cancel_mouse_face (struct frame *); extern int clear_mouse_face (Mouse_HLInfo *); -extern void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face); extern int cursor_in_mouse_face_p (struct window *w); extern void draw_row_with_mouse_face (struct window *, int, struct glyph_row *, int, int, enum draw_glyphs_face); diff --git a/src/frame.h b/src/frame.h index a82de35efb1..0f189414e08 100644 --- a/src/frame.h +++ b/src/frame.h @@ -31,11 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Nonzero means there is at least one garbaged frame. */ extern int frame_garbaged; -/* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by - print. */ - -extern int message_buf_print; - /* The structure representing a frame. */ diff --git a/src/lisp.h b/src/lisp.h index ce6a3c58858..7f4f06c5c5d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2621,10 +2621,8 @@ extern void setup_echo_area_for_printing (int); extern int push_message (void); extern Lisp_Object pop_message_unwind (Lisp_Object); extern Lisp_Object restore_message_unwind (Lisp_Object); -extern void pop_message (void); extern void restore_message (void); extern Lisp_Object current_message (void); -extern void set_message (const char *s, Lisp_Object, EMACS_INT, int); extern void clear_message (int, int); extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); extern void message1 (const char *); @@ -2639,8 +2637,6 @@ extern void message_log_maybe_newline (void); extern void update_echo_area (void); extern void truncate_echo_area (EMACS_INT); extern void redisplay (void); -extern int check_point_in_composition - (struct buffer *, EMACS_INT, struct buffer *, EMACS_INT); extern void redisplay_preserve_echo_area (int); extern void prepare_menu_bars (void); diff --git a/src/xdisp.c b/src/xdisp.c index ec9a112996f..14a38d82873 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -337,7 +337,7 @@ static Lisp_Object Qarrow, Qhand; Lisp_Object Qtext; /* Holds the list (error). */ -Lisp_Object list_of_error; +static Lisp_Object list_of_error; static Lisp_Object Qfontification_functions; @@ -499,7 +499,7 @@ Lisp_Object echo_area_window; message_enable_multibyte on the stack, the function restore_message pops the stack and displays MESSAGE again. */ -Lisp_Object Vmessage_stack; +static Lisp_Object Vmessage_stack; /* Nonzero means multibyte characters were enabled when the echo area message was specified. */ @@ -522,7 +522,7 @@ int cursor_type_changed; /* Nonzero after display_mode_line if %l was used and it displayed a line number. */ -int line_number_displayed; +static int line_number_displayed; /* The name of the *Messages* buffer, a string. */ @@ -549,7 +549,7 @@ static int display_last_displayed_message_p; /* Nonzero if echo area is being used by print; zero if being used by message. */ -int message_buf_print; +static int message_buf_print; /* The symbol `inhibit-menubar-update' and its DEFVAR_BOOL variable. */ @@ -565,7 +565,7 @@ static int message_cleared_p; glyphs. Also used in direct_output_for_insert. */ #define MAX_SCRATCH_GLYPHS 100 -struct glyph_row scratch_glyph_row; +static struct glyph_row scratch_glyph_row; static struct glyph scratch_glyphs[MAX_SCRATCH_GLYPHS]; /* Ascent and height of the last line processed by move_it_to. */ @@ -612,7 +612,7 @@ static Lisp_Object Qauto_hscroll_mode; /* Buffer being redisplayed -- for redisplay_window_error. */ -struct buffer *displayed_buffer; +static struct buffer *displayed_buffer; /* Value returned from text property handlers (see below). */ @@ -756,6 +756,7 @@ static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width; /* Function prototypes. */ static void setup_for_ellipsis (struct it *, int); +static void set_iterator_to_next (struct it *, int); static void mark_window_display_accurate_1 (struct window *, int); static int single_display_spec_string_p (Lisp_Object, Lisp_Object); static int display_prop_string_p (Lisp_Object, Lisp_Object); @@ -788,7 +789,9 @@ static int with_echo_area_buffer (struct window *, int, EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); static void clear_garbaged_frames (void); static int current_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); +static void pop_message (void); static int truncate_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); +static void set_message (const char *, Lisp_Object, EMACS_INT, int); static int set_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); static int display_echo_area (struct window *); static int display_echo_area_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); @@ -820,6 +823,9 @@ static void redisplay_window (Lisp_Object, int); static Lisp_Object redisplay_window_error (Lisp_Object); static Lisp_Object redisplay_window_0 (Lisp_Object); static Lisp_Object redisplay_window_1 (Lisp_Object); +static int set_cursor_from_row (struct window *, struct glyph_row *, + struct glyph_matrix *, EMACS_INT, EMACS_INT, + int, int); static int update_menu_bar (struct frame *, int, int); static int try_window_reusing_current_matrix (struct window *); static int try_window_id (struct window *); @@ -857,6 +863,7 @@ static int init_from_display_pos (struct it *, struct window *, struct display_pos *); static void reseat_to_string (struct it *, const char *, Lisp_Object, EMACS_INT, EMACS_INT, int, int); +static int get_next_display_element (struct it *); static enum move_it_result move_it_in_display_line_to (struct it *, EMACS_INT, int, enum move_operation_enum); @@ -904,6 +911,7 @@ static void append_stretch_glyph (struct it *, Lisp_Object, #endif /* HAVE_WINDOW_SYSTEM */ +static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face); static int coords_in_mouse_face_p (struct window *, int, int); @@ -1120,7 +1128,7 @@ window_box (struct window *w, int area, int *box_x, int *box_y, *BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the box. */ -INLINE void +static INLINE void window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y, int *bottom_right_x, int *bottom_right_y) { @@ -1538,61 +1546,6 @@ pixel_to_glyph_coords (FRAME_PTR f, register int pix_x, register int pix_y, } -/* Given HPOS/VPOS in the current matrix of W, return corresponding - frame-relative pixel positions in *FRAME_X and *FRAME_Y. If we - can't tell the positions because W's display is not up to date, - return 0. */ - -int -glyph_to_pixel_coords (struct window *w, int hpos, int vpos, - int *frame_x, int *frame_y) -{ -#ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w)))) - { - int success_p; - - xassert (hpos >= 0 && hpos < w->current_matrix->matrix_w); - xassert (vpos >= 0 && vpos < w->current_matrix->matrix_h); - - if (display_completed) - { - struct glyph_row *row = MATRIX_ROW (w->current_matrix, vpos); - struct glyph *glyph = row->glyphs[TEXT_AREA]; - struct glyph *end = glyph + min (hpos, row->used[TEXT_AREA]); - - hpos = row->x; - vpos = row->y; - while (glyph < end) - { - hpos += glyph->pixel_width; - ++glyph; - } - - /* If first glyph is partially visible, its first visible position is still 0. */ - if (hpos < 0) - hpos = 0; - - success_p = 1; - } - else - { - hpos = vpos = 0; - success_p = 0; - } - - *frame_x = WINDOW_TO_FRAME_PIXEL_X (w, hpos); - *frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, vpos); - return success_p; - } -#endif - - *frame_x = hpos; - *frame_y = vpos; - return 1; -} - - /* Find the glyph under window-relative coordinates X/Y in window W. Consider only glyphs from buffer text, i.e. no glyphs from overlay strings. Return in *HPOS and *VPOS the row and column number of @@ -1675,11 +1628,10 @@ x_y_to_hpos_vpos (struct window *w, int x, int y, int *hpos, int *vpos, return glyph; } -/* EXPORT: - Convert frame-relative x/y to coordinates relative to window W. +/* Convert frame-relative x/y to coordinates relative to window W. Takes pseudo-windows into account. */ -void +static void frame_to_window_pixel_xy (struct window *w, int *x, int *y) { if (w->pseudo_window_p) @@ -5637,7 +5589,7 @@ struct frame *last_glyphless_glyph_frame = NULL; unsigned last_glyphless_glyph_face_id = (1 << FACE_ID_BITS); int last_glyphless_glyph_merged_face_id = 0; -int +static int get_next_display_element (struct it *it) { /* Non-zero means that we found a display element. Zero means that @@ -9097,7 +9049,7 @@ pop_message_unwind (Lisp_Object dummy) /* Pop the top-most entry off Vmessage_stack. */ -void +static void pop_message (void) { xassert (CONSP (Vmessage_stack)); @@ -9167,7 +9119,7 @@ truncate_message_1 (EMACS_INT nchars, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4 to t before calling set_message_1 (which calls insert). */ -void +static void set_message (const char *s, Lisp_Object string, EMACS_INT nbytes, int multibyte_p) { @@ -11317,7 +11269,7 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row) return 0. PREV_BUF and PREV_PT are the last point buffer and position. BUF and PT are the current point buffer and position. */ -int +static int check_point_in_composition (struct buffer *prev_buf, EMACS_INT prev_pt, struct buffer *buf, EMACS_INT pt) { @@ -12404,7 +12356,7 @@ redisplay_window_1 (Lisp_Object window) Return 0 if cursor is not on this row, 1 otherwise. */ -int +static int set_cursor_from_row (struct window *w, struct glyph_row *row, struct glyph_matrix *matrix, EMACS_INT delta, EMACS_INT delta_bytes, @@ -13675,7 +13627,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste return rc; } -void +static void set_vertical_scroll_bar (struct window *w) { EMACS_INT start, end, whole; @@ -16984,7 +16936,7 @@ trailing_whitespace_p (EMACS_INT charpos) /* Highlight trailing whitespace, if any, in ROW. */ -void +static void highlight_trailing_whitespace (struct frame *f, struct glyph_row *row) { int used = row->used[TEXT_AREA]; @@ -23943,10 +23895,9 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row, #endif } -/* EXPORT: - Display the active region described by mouse_face_* according to DRAW. */ +/* Display the active region described by mouse_face_* according to DRAW. */ -void +static void show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) { struct window *w = XWINDOW (hlinfo->mouse_face_window); diff --git a/src/xterm.h b/src/xterm.h index 15630e902e5..e0e8240e9e8 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -991,7 +991,6 @@ extern void x_query_colors (struct frame *f, XColor *, int); extern void x_query_color (struct frame *f, XColor *); extern void x_clear_area (Display *, Window, int, int, int, int, int); extern void x_mouse_leave (struct x_display_info *); -extern void set_vertical_scroll_bar (struct window *); extern int x_dispatch_event (XEvent *, Display *); extern unsigned int x_x_to_emacs_modifiers (struct x_display_info *, |