From f868cd8a7186e86e4c9bbd52de2aca99fa94648f Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sat, 26 Mar 2011 02:23:15 +0100 Subject: [PATCH] src/*.h: Remove unused parameters and functions. * keyboard.h (timer_check, show_help_echo): Remove unused parameters. * keyboard.c (timer_check): Remove parameter `do_it_now', unused since 1996-04-12T06:01:29Z!rms@gnu.org. (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo', unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca. * keyboard.c (read_char): * w32menu.c (w32_menu_display_help): * xmenu.c (show_help_event, menu_help_callback): Adjust calls to `show_help_echo'. * gtkutil.c (xg_maybe_add_timer): * keyboard.c (readable_events): * process.c (wait_reading_process_output): * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'. * insdel.c (adjust_markers_gap_motion): Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org. (gap_left, gap_right): Don't call it. --- src/ChangeLog | 23 +++++++++++++++++++ src/gtkutil.c | 2 +- src/insdel.c | 72 +++------------------------------------------------------- src/keyboard.c | 20 +++++----------- src/keyboard.h | 4 ++-- src/process.c | 4 ++-- src/w32menu.c | 2 +- src/xmenu.c | 6 ++--- 8 files changed, 41 insertions(+), 92 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c7b0edede3f..69e850610bc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,26 @@ +2011-03-26 Juanma Barranquero + + * keyboard.h (timer_check, show_help_echo): Remove unused parameters. + + * keyboard.c (timer_check): Remove parameter `do_it_now', + unused since 1996-04-12T06:01:29Z!rms@gnu.org. + (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo', + unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca. + + * keyboard.c (read_char): + * w32menu.c (w32_menu_display_help): + * xmenu.c (show_help_event, menu_help_callback): + Adjust calls to `show_help_echo'. + + * gtkutil.c (xg_maybe_add_timer): + * keyboard.c (readable_events): + * process.c (wait_reading_process_output): + * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'. + + * insdel.c (adjust_markers_gap_motion): + Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org. + (gap_left, gap_right): Don't call it. + 2011-03-25 Chong Yidong * xdisp.c (handle_fontified_prop): Discard changes to clip_changed diff --git a/src/gtkutil.c b/src/gtkutil.c index 754f61e366d..4e5ecce76c7 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1555,7 +1555,7 @@ static gboolean xg_maybe_add_timer (gpointer data) { struct xg_dialog_data *dd = (struct xg_dialog_data *) data; - EMACS_TIME next_time = timer_check (1); + EMACS_TIME next_time = timer_check (); long secs = EMACS_SECS (next_time); long usecs = EMACS_USECS (next_time); diff --git a/src/insdel.c b/src/insdel.c index 1cbe3de20d2..4bdcb4bc0b7 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -41,8 +41,6 @@ static void insert_from_buffer_1 (struct buffer *buf, int inherit); static void gap_left (EMACS_INT charpos, EMACS_INT bytepos, int newgap); static void gap_right (EMACS_INT charpos, EMACS_INT bytepos); -static void adjust_markers_gap_motion (EMACS_INT from, EMACS_INT to, - EMACS_INT amount); static void adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte, EMACS_INT to, EMACS_INT to_byte, int before_markers); @@ -162,10 +160,9 @@ gap_left (EMACS_INT charpos, EMACS_INT bytepos, int newgap) memmove (to, from, i); } - /* Adjust markers, and buffer data structure, to put the gap at BYTEPOS. - BYTEPOS is where the loop above stopped, which may be what was specified - or may be where a quit was detected. */ - adjust_markers_gap_motion (bytepos, GPT_BYTE, GAP_SIZE); + /* Adjust buffer data structure, to put the gap at BYTEPOS. + BYTEPOS is where the loop above stopped, which may be what + was specified or may be where a quit was detected. */ GPT_BYTE = bytepos; GPT = charpos; if (bytepos < charpos) @@ -217,8 +214,6 @@ gap_right (EMACS_INT charpos, EMACS_INT bytepos) from += i, to += i; } - adjust_markers_gap_motion (GPT_BYTE + GAP_SIZE, bytepos + GAP_SIZE, - - GAP_SIZE); GPT = charpos; GPT_BYTE = bytepos; if (bytepos < charpos) @@ -227,67 +222,6 @@ gap_right (EMACS_INT charpos, EMACS_INT bytepos) QUIT; } -/* Add AMOUNT to the byte position of every marker in the current buffer - whose current byte position is between FROM (exclusive) and TO (inclusive). - - Also, any markers past the outside of that interval, in the direction - of adjustment, are first moved back to the near end of the interval - and then adjusted by AMOUNT. - - When the latter adjustment is done, if AMOUNT is negative, - we record the adjustment for undo. (This case happens only for - deletion.) - - The markers' character positions are not altered, - because gap motion does not affect character positions. */ - -int adjust_markers_test; - -static void -adjust_markers_gap_motion (EMACS_INT from, EMACS_INT to, EMACS_INT amount) -{ - /* Now that a marker has a bytepos, not counting the gap, - nothing needs to be done here. */ -#if 0 - Lisp_Object marker; - register struct Lisp_Marker *m; - register EMACS_INT mpos; - - marker = BUF_MARKERS (current_buffer); - - while (!NILP (marker)) - { - m = XMARKER (marker); - mpos = m->bytepos; - if (amount > 0) - { - if (mpos > to && mpos < to + amount) - { - if (adjust_markers_test) - abort (); - mpos = to + amount; - } - } - else - { - /* Here's the case where a marker is inside text being deleted. - AMOUNT can be negative for gap motion, too, - but then this range contains no markers. */ - if (mpos > from + amount && mpos <= from) - { - if (adjust_markers_test) - abort (); - mpos = from + amount; - } - } - if (mpos > from && mpos <= to) - mpos += amount; - m->bufpos = mpos; - marker = m->chain; - } -#endif -} - /* Adjust all markers for a deletion whose range in bytes is FROM_BYTE to TO_BYTE. The range in charpos is FROM to TO. diff --git a/src/keyboard.c b/src/keyboard.c index 6ce102c7d65..c4ef2795f6a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -351,7 +351,7 @@ Lisp_Object Qmenu_bar; Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void); Lisp_Object Fthis_command_keys (void); Lisp_Object Qextended_command_history; -EMACS_TIME timer_check (int do_it_now); +EMACS_TIME timer_check (void); static void record_menu_key (Lisp_Object c); static int echo_length (void); @@ -2068,16 +2068,12 @@ make_ctrl_char (int c) the `display' property). POS is the position in that string under the mouse. - OK_TO_OVERWRITE_KEYSTROKE_ECHO non-zero means it's okay if the help - echo overwrites a keystroke echo currently displayed in the echo - area. - Note: this function may only be called with HELP nil or a string from X code running asynchronously. */ void show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object, - Lisp_Object pos, int ok_to_overwrite_keystroke_echo) + Lisp_Object pos) { if (!NILP (help) && !STRINGP (help)) { @@ -3007,7 +3003,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event htem = Fcdr (htem); position = Fcar (htem); - show_help_echo (help, window, object, position, 0); + show_help_echo (help, window, object, position); /* We stopped being idle for this event; undo that. */ if (!end_time) @@ -3309,7 +3305,7 @@ static int readable_events (int flags) { if (flags & READABLE_EVENTS_DO_TIMERS_NOW) - timer_check (1); + timer_check (); /* If the buffer contains only FOCUS_IN_EVENT events, and READABLE_EVENTS_FILTER_EVENTS is set, report it as empty. */ @@ -4383,14 +4379,10 @@ timer_check_2 (void) Returns the time to wait until the next timer fires. If no timer is active, return -1. - As long as any timer is ripe, we run it. - - DO_IT_NOW is now ignored. It used to mean that we should - run the timer directly instead of queueing a timer-event. - Now we always run timers directly. */ + As long as any timer is ripe, we run it. */ EMACS_TIME -timer_check (int do_it_now) +timer_check (void) { EMACS_TIME nexttime; diff --git a/src/keyboard.h b/src/keyboard.h index 00745a09140..ba3c909c4dd 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -507,7 +507,7 @@ extern void kbd_buffer_store_event_hold (struct input_event *, extern void kbd_buffer_unget_event (struct input_event *); extern void poll_for_input_1 (void); extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, int); + Lisp_Object); extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, EMACS_INT); extern void kbd_buffer_store_help_event (Lisp_Object, Lisp_Object); @@ -517,7 +517,7 @@ extern void add_user_signal (int, const char *); extern int tty_read_avail_input (struct terminal *, int, struct input_event *); -extern EMACS_TIME timer_check (int); +extern EMACS_TIME timer_check (void); extern void mark_kboards (void); #ifdef WINDOWSNT diff --git a/src/process.c b/src/process.c index 4a7202388bf..639b6a49fce 100644 --- a/src/process.c +++ b/src/process.c @@ -4548,7 +4548,7 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, struct buffer *old_buffer = current_buffer; Lisp_Object old_window = selected_window; - timer_delay = timer_check (1); + timer_delay = timer_check (); /* If a timer has run, this might have changed buffers an alike. Make read_key_sequence aware of that. */ @@ -6946,7 +6946,7 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, do { int old_timers_run = timers_run; - timer_delay = timer_check (1); + timer_delay = timer_check (); if (timers_run != old_timers_run && do_display) /* We must retry, since a timer may have requeued itself and that could alter the time delay. */ diff --git a/src/w32menu.c b/src/w32menu.c index c363fdd72cb..f092ff87bf2 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1616,7 +1616,7 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags) else /* X version has a loop through frames here, which doesn't appear to do anything, unless it has some side effect. */ - show_help_echo (help, Qnil, Qnil, Qnil, 1); + show_help_echo (help, Qnil, Qnil, Qnil); } } diff --git a/src/xmenu.c b/src/xmenu.c index 60ac27a5b8f..8ecef00c88e 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -383,7 +383,7 @@ x_menu_wait_for_event (void *data) #endif ) { - EMACS_TIME next_time = timer_check (1), *ntp; + EMACS_TIME next_time = timer_check (), *ntp; long secs = EMACS_SECS (next_time); long usecs = EMACS_USECS (next_time); SELECT_TYPE read_fds; @@ -712,7 +712,7 @@ show_help_event (FRAME_PTR f, xt_or_gtk_widget widget, Lisp_Object help) break; } #endif - show_help_echo (help, Qnil, Qnil, Qnil, 1); + show_help_echo (help, Qnil, Qnil, Qnil); } } @@ -2201,7 +2201,7 @@ menu_help_callback (char *help_string, int pane, int item) Fcons (pane_name, Fcons (make_number (pane), Qnil))); show_help_echo (help_string ? build_string (help_string) : Qnil, - Qnil, menu_object, make_number (item), 1); + Qnil, menu_object, make_number (item)); } static Lisp_Object -- 2.11.4.GIT