aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2011-03-26 02:23:15 +0100
committerJuanma Barranquero2011-03-26 02:23:15 +0100
commitf868cd8a7186e86e4c9bbd52de2aca99fa94648f (patch)
treec861c3ee7b8fe1c1f12729faac4a8e08c0b5862c /src
parentdc8026879ec33cfdcb47973ab7a3c14789c62aa6 (diff)
downloademacs-f868cd8a7186e86e4c9bbd52de2aca99fa94648f.tar.gz
emacs-f868cd8a7186e86e4c9bbd52de2aca99fa94648f.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog23
-rw-r--r--src/gtkutil.c2
-rw-r--r--src/insdel.c72
-rw-r--r--src/keyboard.c20
-rw-r--r--src/keyboard.h4
-rw-r--r--src/process.c4
-rw-r--r--src/w32menu.c2
-rw-r--r--src/xmenu.c6
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 @@
12011-03-26 Juanma Barranquero <lekktu@gmail.com>
2
3 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
4
5 * keyboard.c (timer_check): Remove parameter `do_it_now',
6 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
7 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
8 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
9
10 * keyboard.c (read_char):
11 * w32menu.c (w32_menu_display_help):
12 * xmenu.c (show_help_event, menu_help_callback):
13 Adjust calls to `show_help_echo'.
14
15 * gtkutil.c (xg_maybe_add_timer):
16 * keyboard.c (readable_events):
17 * process.c (wait_reading_process_output):
18 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19
20 * insdel.c (adjust_markers_gap_motion):
21 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22 (gap_left, gap_right): Don't call it.
23
12011-03-25 Chong Yidong <cyd@stupidchicken.com> 242011-03-25 Chong Yidong <cyd@stupidchicken.com>
2 25
3 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed 26 * 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
1555xg_maybe_add_timer (gpointer data) 1555xg_maybe_add_timer (gpointer data)
1556{ 1556{
1557 struct xg_dialog_data *dd = (struct xg_dialog_data *) data; 1557 struct xg_dialog_data *dd = (struct xg_dialog_data *) data;
1558 EMACS_TIME next_time = timer_check (1); 1558 EMACS_TIME next_time = timer_check ();
1559 long secs = EMACS_SECS (next_time); 1559 long secs = EMACS_SECS (next_time);
1560 long usecs = EMACS_USECS (next_time); 1560 long usecs = EMACS_USECS (next_time);
1561 1561
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,
41 int inherit); 41 int inherit);
42static void gap_left (EMACS_INT charpos, EMACS_INT bytepos, int newgap); 42static void gap_left (EMACS_INT charpos, EMACS_INT bytepos, int newgap);
43static void gap_right (EMACS_INT charpos, EMACS_INT bytepos); 43static void gap_right (EMACS_INT charpos, EMACS_INT bytepos);
44static void adjust_markers_gap_motion (EMACS_INT from, EMACS_INT to,
45 EMACS_INT amount);
46static void adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte, 44static void adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte,
47 EMACS_INT to, EMACS_INT to_byte, 45 EMACS_INT to, EMACS_INT to_byte,
48 int before_markers); 46 int before_markers);
@@ -162,10 +160,9 @@ gap_left (EMACS_INT charpos, EMACS_INT bytepos, int newgap)
162 memmove (to, from, i); 160 memmove (to, from, i);
163 } 161 }
164 162
165 /* Adjust markers, and buffer data structure, to put the gap at BYTEPOS. 163 /* Adjust buffer data structure, to put the gap at BYTEPOS.
166 BYTEPOS is where the loop above stopped, which may be what was specified 164 BYTEPOS is where the loop above stopped, which may be what
167 or may be where a quit was detected. */ 165 was specified or may be where a quit was detected. */
168 adjust_markers_gap_motion (bytepos, GPT_BYTE, GAP_SIZE);
169 GPT_BYTE = bytepos; 166 GPT_BYTE = bytepos;
170 GPT = charpos; 167 GPT = charpos;
171 if (bytepos < charpos) 168 if (bytepos < charpos)
@@ -217,8 +214,6 @@ gap_right (EMACS_INT charpos, EMACS_INT bytepos)
217 from += i, to += i; 214 from += i, to += i;
218 } 215 }
219 216
220 adjust_markers_gap_motion (GPT_BYTE + GAP_SIZE, bytepos + GAP_SIZE,
221 - GAP_SIZE);
222 GPT = charpos; 217 GPT = charpos;
223 GPT_BYTE = bytepos; 218 GPT_BYTE = bytepos;
224 if (bytepos < charpos) 219 if (bytepos < charpos)
@@ -227,67 +222,6 @@ gap_right (EMACS_INT charpos, EMACS_INT bytepos)
227 QUIT; 222 QUIT;
228} 223}
229 224
230/* Add AMOUNT to the byte position of every marker in the current buffer
231 whose current byte position is between FROM (exclusive) and TO (inclusive).
232
233 Also, any markers past the outside of that interval, in the direction
234 of adjustment, are first moved back to the near end of the interval
235 and then adjusted by AMOUNT.
236
237 When the latter adjustment is done, if AMOUNT is negative,
238 we record the adjustment for undo. (This case happens only for
239 deletion.)
240
241 The markers' character positions are not altered,
242 because gap motion does not affect character positions. */
243
244int adjust_markers_test;
245
246static void
247adjust_markers_gap_motion (EMACS_INT from, EMACS_INT to, EMACS_INT amount)
248{
249 /* Now that a marker has a bytepos, not counting the gap,
250 nothing needs to be done here. */
251#if 0
252 Lisp_Object marker;
253 register struct Lisp_Marker *m;
254 register EMACS_INT mpos;
255
256 marker = BUF_MARKERS (current_buffer);
257
258 while (!NILP (marker))
259 {
260 m = XMARKER (marker);
261 mpos = m->bytepos;
262 if (amount > 0)
263 {
264 if (mpos > to && mpos < to + amount)
265 {
266 if (adjust_markers_test)
267 abort ();
268 mpos = to + amount;
269 }
270 }
271 else
272 {
273 /* Here's the case where a marker is inside text being deleted.
274 AMOUNT can be negative for gap motion, too,
275 but then this range contains no markers. */
276 if (mpos > from + amount && mpos <= from)
277 {
278 if (adjust_markers_test)
279 abort ();
280 mpos = from + amount;
281 }
282 }
283 if (mpos > from && mpos <= to)
284 mpos += amount;
285 m->bufpos = mpos;
286 marker = m->chain;
287 }
288#endif
289}
290
291/* Adjust all markers for a deletion 225/* Adjust all markers for a deletion
292 whose range in bytes is FROM_BYTE to TO_BYTE. 226 whose range in bytes is FROM_BYTE to TO_BYTE.
293 The range in charpos is FROM to TO. 227 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;
351Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void); 351Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void);
352Lisp_Object Fthis_command_keys (void); 352Lisp_Object Fthis_command_keys (void);
353Lisp_Object Qextended_command_history; 353Lisp_Object Qextended_command_history;
354EMACS_TIME timer_check (int do_it_now); 354EMACS_TIME timer_check (void);
355 355
356static void record_menu_key (Lisp_Object c); 356static void record_menu_key (Lisp_Object c);
357static int echo_length (void); 357static int echo_length (void);
@@ -2068,16 +2068,12 @@ make_ctrl_char (int c)
2068 the `display' property). POS is the position in that string under 2068 the `display' property). POS is the position in that string under
2069 the mouse. 2069 the mouse.
2070 2070
2071 OK_TO_OVERWRITE_KEYSTROKE_ECHO non-zero means it's okay if the help
2072 echo overwrites a keystroke echo currently displayed in the echo
2073 area.
2074
2075 Note: this function may only be called with HELP nil or a string 2071 Note: this function may only be called with HELP nil or a string
2076 from X code running asynchronously. */ 2072 from X code running asynchronously. */
2077 2073
2078void 2074void
2079show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object, 2075show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
2080 Lisp_Object pos, int ok_to_overwrite_keystroke_echo) 2076 Lisp_Object pos)
2081{ 2077{
2082 if (!NILP (help) && !STRINGP (help)) 2078 if (!NILP (help) && !STRINGP (help))
2083 { 2079 {
@@ -3007,7 +3003,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
3007 htem = Fcdr (htem); 3003 htem = Fcdr (htem);
3008 position = Fcar (htem); 3004 position = Fcar (htem);
3009 3005
3010 show_help_echo (help, window, object, position, 0); 3006 show_help_echo (help, window, object, position);
3011 3007
3012 /* We stopped being idle for this event; undo that. */ 3008 /* We stopped being idle for this event; undo that. */
3013 if (!end_time) 3009 if (!end_time)
@@ -3309,7 +3305,7 @@ static int
3309readable_events (int flags) 3305readable_events (int flags)
3310{ 3306{
3311 if (flags & READABLE_EVENTS_DO_TIMERS_NOW) 3307 if (flags & READABLE_EVENTS_DO_TIMERS_NOW)
3312 timer_check (1); 3308 timer_check ();
3313 3309
3314 /* If the buffer contains only FOCUS_IN_EVENT events, and 3310 /* If the buffer contains only FOCUS_IN_EVENT events, and
3315 READABLE_EVENTS_FILTER_EVENTS is set, report it as empty. */ 3311 READABLE_EVENTS_FILTER_EVENTS is set, report it as empty. */
@@ -4383,14 +4379,10 @@ timer_check_2 (void)
4383 Returns the time to wait until the next timer fires. 4379 Returns the time to wait until the next timer fires.
4384 If no timer is active, return -1. 4380 If no timer is active, return -1.
4385 4381
4386 As long as any timer is ripe, we run it. 4382 As long as any timer is ripe, we run it. */
4387
4388 DO_IT_NOW is now ignored. It used to mean that we should
4389 run the timer directly instead of queueing a timer-event.
4390 Now we always run timers directly. */
4391 4383
4392EMACS_TIME 4384EMACS_TIME
4393timer_check (int do_it_now) 4385timer_check (void)
4394{ 4386{
4395 EMACS_TIME nexttime; 4387 EMACS_TIME nexttime;
4396 4388
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 *,
507extern void kbd_buffer_unget_event (struct input_event *); 507extern void kbd_buffer_unget_event (struct input_event *);
508extern void poll_for_input_1 (void); 508extern void poll_for_input_1 (void);
509extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object, 509extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object,
510 Lisp_Object, int); 510 Lisp_Object);
511extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object, 511extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object,
512 Lisp_Object, EMACS_INT); 512 Lisp_Object, EMACS_INT);
513extern void kbd_buffer_store_help_event (Lisp_Object, Lisp_Object); 513extern void kbd_buffer_store_help_event (Lisp_Object, Lisp_Object);
@@ -517,7 +517,7 @@ extern void add_user_signal (int, const char *);
517 517
518extern int tty_read_avail_input (struct terminal *, int, 518extern int tty_read_avail_input (struct terminal *, int,
519 struct input_event *); 519 struct input_event *);
520extern EMACS_TIME timer_check (int); 520extern EMACS_TIME timer_check (void);
521extern void mark_kboards (void); 521extern void mark_kboards (void);
522 522
523#ifdef WINDOWSNT 523#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,
4548 struct buffer *old_buffer = current_buffer; 4548 struct buffer *old_buffer = current_buffer;
4549 Lisp_Object old_window = selected_window; 4549 Lisp_Object old_window = selected_window;
4550 4550
4551 timer_delay = timer_check (1); 4551 timer_delay = timer_check ();
4552 4552
4553 /* If a timer has run, this might have changed buffers 4553 /* If a timer has run, this might have changed buffers
4554 an alike. Make read_key_sequence aware of that. */ 4554 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,
6946 do 6946 do
6947 { 6947 {
6948 int old_timers_run = timers_run; 6948 int old_timers_run = timers_run;
6949 timer_delay = timer_check (1); 6949 timer_delay = timer_check ();
6950 if (timers_run != old_timers_run && do_display) 6950 if (timers_run != old_timers_run && do_display)
6951 /* We must retry, since a timer may have requeued itself 6951 /* We must retry, since a timer may have requeued itself
6952 and that could alter the time delay. */ 6952 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)
1616 else 1616 else
1617 /* X version has a loop through frames here, which doesn't 1617 /* X version has a loop through frames here, which doesn't
1618 appear to do anything, unless it has some side effect. */ 1618 appear to do anything, unless it has some side effect. */
1619 show_help_echo (help, Qnil, Qnil, Qnil, 1); 1619 show_help_echo (help, Qnil, Qnil, Qnil);
1620 } 1620 }
1621} 1621}
1622 1622
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)
383#endif 383#endif
384 ) 384 )
385 { 385 {
386 EMACS_TIME next_time = timer_check (1), *ntp; 386 EMACS_TIME next_time = timer_check (), *ntp;
387 long secs = EMACS_SECS (next_time); 387 long secs = EMACS_SECS (next_time);
388 long usecs = EMACS_USECS (next_time); 388 long usecs = EMACS_USECS (next_time);
389 SELECT_TYPE read_fds; 389 SELECT_TYPE read_fds;
@@ -712,7 +712,7 @@ show_help_event (FRAME_PTR f, xt_or_gtk_widget widget, Lisp_Object help)
712 break; 712 break;
713 } 713 }
714#endif 714#endif
715 show_help_echo (help, Qnil, Qnil, Qnil, 1); 715 show_help_echo (help, Qnil, Qnil, Qnil);
716 } 716 }
717} 717}
718 718
@@ -2201,7 +2201,7 @@ menu_help_callback (char *help_string, int pane, int item)
2201 Fcons (pane_name, 2201 Fcons (pane_name,
2202 Fcons (make_number (pane), Qnil))); 2202 Fcons (make_number (pane), Qnil)));
2203 show_help_echo (help_string ? build_string (help_string) : Qnil, 2203 show_help_echo (help_string ? build_string (help_string) : Qnil,
2204 Qnil, menu_object, make_number (item), 1); 2204 Qnil, menu_object, make_number (item));
2205} 2205}
2206 2206
2207static Lisp_Object 2207static Lisp_Object