diff options
| author | Gerd Moellmann | 2000-07-24 12:22:54 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-07-24 12:22:54 +0000 |
| commit | 23a96c7762a45eed54d73518b98b3d8a1b3679a5 (patch) | |
| tree | 37aa5caf25eee8989ae94f911c757bbf6614b8a4 /src | |
| parent | 7972fcfca4cdaa6e2e2f51f6f5e6653721c38fca (diff) | |
| download | emacs-23a96c7762a45eed54d73518b98b3d8a1b3679a5.tar.gz emacs-23a96c7762a45eed54d73518b98b3d8a1b3679a5.zip | |
(with_echo_area_buffer): Take additional EMACS_INT
parameters instead of using int parameters. Expect FN to accept
EMACS_INT parameters.
(display_echo_area, resize_echo_area_axactly, current_message)
(truncate_echo_area, set_message_1): Call with_echo_area_buffer
with new argument list.
(resize_mini_window_1): New callback function.
(current_message_1, truncate_message_1, set_message_1): Change
parameter lists to the new format expected by
with_echo_area_buffer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 83 |
1 files changed, 54 insertions, 29 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 0c17f68fee6..fab426c561b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -629,12 +629,17 @@ static struct glyph_row *row_containing_pos P_ ((struct window *, int, | |||
| 629 | struct glyph_row *)); | 629 | struct glyph_row *)); |
| 630 | static Lisp_Object unwind_with_echo_area_buffer P_ ((Lisp_Object)); | 630 | static Lisp_Object unwind_with_echo_area_buffer P_ ((Lisp_Object)); |
| 631 | static Lisp_Object with_echo_area_buffer_unwind_data P_ ((struct window *)); | 631 | static Lisp_Object with_echo_area_buffer_unwind_data P_ ((struct window *)); |
| 632 | static int with_echo_area_buffer P_ ((struct window *, int, | ||
| 633 | int (*) (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT), | ||
| 634 | EMACS_INT, EMACS_INT, EMACS_INT, | ||
| 635 | EMACS_INT)); | ||
| 632 | static void clear_garbaged_frames P_ ((void)); | 636 | static void clear_garbaged_frames P_ ((void)); |
| 633 | static int current_message_1 P_ ((Lisp_Object *)); | 637 | static int current_message_1 P_ ((EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT)); |
| 634 | static int truncate_message_1 P_ ((int)); | 638 | static int truncate_message_1 P_ ((EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT)); |
| 635 | static int set_message_1 P_ ((char *s, Lisp_Object, int, int)); | 639 | static int set_message_1 P_ ((EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT)); |
| 636 | static int display_echo_area P_ ((struct window *)); | 640 | static int display_echo_area P_ ((struct window *)); |
| 637 | static int display_echo_area_1 P_ ((struct window *)); | 641 | static int display_echo_area_1 P_ ((EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT)); |
| 642 | static int resize_mini_window_1 P_ ((EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT)); | ||
| 638 | static Lisp_Object unwind_redisplay P_ ((Lisp_Object)); | 643 | static Lisp_Object unwind_redisplay P_ ((Lisp_Object)); |
| 639 | static int string_char_and_length P_ ((unsigned char *, int, int *)); | 644 | static int string_char_and_length P_ ((unsigned char *, int, int *)); |
| 640 | static struct text_pos display_prop_end P_ ((struct it *, Lisp_Object, | 645 | static struct text_pos display_prop_end P_ ((struct it *, Lisp_Object, |
| @@ -5441,7 +5446,7 @@ ensure_echo_area_buffers () | |||
| 5441 | } | 5446 | } |
| 5442 | 5447 | ||
| 5443 | 5448 | ||
| 5444 | /* Call FN with args A1..A5 with either the current or last displayed | 5449 | /* Call FN with args A1..A4 with either the current or last displayed |
| 5445 | echo_area_buffer as current buffer. | 5450 | echo_area_buffer as current buffer. |
| 5446 | 5451 | ||
| 5447 | WHICH zero means use the current message buffer | 5452 | WHICH zero means use the current message buffer |
| @@ -5458,11 +5463,11 @@ ensure_echo_area_buffers () | |||
| 5458 | Value is what FN returns. */ | 5463 | Value is what FN returns. */ |
| 5459 | 5464 | ||
| 5460 | static int | 5465 | static int |
| 5461 | with_echo_area_buffer (w, which, fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) | 5466 | with_echo_area_buffer (w, which, fn, a1, a2, a3, a4) |
| 5462 | struct window *w; | 5467 | struct window *w; |
| 5463 | int which; | 5468 | int which; |
| 5464 | int (*fn) (); | 5469 | int (*fn) P_ ((EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT)); |
| 5465 | int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10; | 5470 | EMACS_INT a1, a2, a3, a4; |
| 5466 | { | 5471 | { |
| 5467 | Lisp_Object buffer; | 5472 | Lisp_Object buffer; |
| 5468 | int this_one, the_other, clear_buffer_p, rc; | 5473 | int this_one, the_other, clear_buffer_p, rc; |
| @@ -5528,7 +5533,7 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) | |||
| 5528 | xassert (BEGV >= BEG); | 5533 | xassert (BEGV >= BEG); |
| 5529 | xassert (ZV <= Z && ZV >= BEGV); | 5534 | xassert (ZV <= Z && ZV >= BEGV); |
| 5530 | 5535 | ||
| 5531 | rc = fn (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); | 5536 | rc = fn (a1, a2, a3, a4); |
| 5532 | 5537 | ||
| 5533 | xassert (BEGV >= BEG); | 5538 | xassert (BEGV >= BEG); |
| 5534 | xassert (ZV <= Z && ZV >= BEGV); | 5539 | xassert (ZV <= Z && ZV >= BEGV); |
| @@ -5699,7 +5704,8 @@ display_echo_area (w) | |||
| 5699 | 5704 | ||
| 5700 | window_height_changed_p | 5705 | window_height_changed_p |
| 5701 | = with_echo_area_buffer (w, display_last_displayed_message_p, | 5706 | = with_echo_area_buffer (w, display_last_displayed_message_p, |
| 5702 | (int (*) ()) display_echo_area_1, w); | 5707 | display_echo_area_1, |
| 5708 | (EMACS_INT) w, 0, 0, 0); | ||
| 5703 | 5709 | ||
| 5704 | if (no_message_p) | 5710 | if (no_message_p) |
| 5705 | echo_area_buffer[i] = Qnil; | 5711 | echo_area_buffer[i] = Qnil; |
| @@ -5710,14 +5716,16 @@ display_echo_area (w) | |||
| 5710 | 5716 | ||
| 5711 | 5717 | ||
| 5712 | /* Helper for display_echo_area. Display the current buffer which | 5718 | /* Helper for display_echo_area. Display the current buffer which |
| 5713 | contains the current echo area message in window W, a mini-window. | 5719 | contains the current echo area message in window W, a mini-window, |
| 5720 | a pointer to which is passed in A1. A2..A4 are currently not used. | ||
| 5714 | Change the height of W so that all of the message is displayed. | 5721 | Change the height of W so that all of the message is displayed. |
| 5715 | Value is non-zero if height of W was changed. */ | 5722 | Value is non-zero if height of W was changed. */ |
| 5716 | 5723 | ||
| 5717 | static int | 5724 | static int |
| 5718 | display_echo_area_1 (w) | 5725 | display_echo_area_1 (a1, a2, a3, a4) |
| 5719 | struct window *w; | 5726 | EMACS_INT a1, a2, a3, a4; |
| 5720 | { | 5727 | { |
| 5728 | struct window *w = (struct window *) a1; | ||
| 5721 | Lisp_Object window; | 5729 | Lisp_Object window; |
| 5722 | struct text_pos start; | 5730 | struct text_pos start; |
| 5723 | int window_height_changed_p = 0; | 5731 | int window_height_changed_p = 0; |
| @@ -5748,9 +5756,8 @@ resize_echo_area_axactly () | |||
| 5748 | struct window *w = XWINDOW (echo_area_window); | 5756 | struct window *w = XWINDOW (echo_area_window); |
| 5749 | int resized_p; | 5757 | int resized_p; |
| 5750 | 5758 | ||
| 5751 | resized_p = with_echo_area_buffer (w, 0, | 5759 | resized_p = with_echo_area_buffer (w, 0, resize_mini_window_1, |
| 5752 | (int (*) ()) resize_mini_window, | 5760 | (EMACS_INT) w, 0, 0, 0); |
| 5753 | w, 1); | ||
| 5754 | if (resized_p) | 5761 | if (resized_p) |
| 5755 | { | 5762 | { |
| 5756 | ++windows_or_buffers_changed; | 5763 | ++windows_or_buffers_changed; |
| @@ -5761,6 +5768,19 @@ resize_echo_area_axactly () | |||
| 5761 | } | 5768 | } |
| 5762 | 5769 | ||
| 5763 | 5770 | ||
| 5771 | /* Callback function for with_echo_area_buffer, when used from | ||
| 5772 | resize_echo_area_axactly. A1 contains a pointer to the window to | ||
| 5773 | resize, A2 to A4 are not used. Value is what resize_mini_window | ||
| 5774 | returns. */ | ||
| 5775 | |||
| 5776 | static int | ||
| 5777 | resize_mini_window_1 (a1, a2, a3, a4) | ||
| 5778 | EMACS_INT a1, a2, a3, a4; | ||
| 5779 | { | ||
| 5780 | return resize_mini_window ((struct window *) a1, 1); | ||
| 5781 | } | ||
| 5782 | |||
| 5783 | |||
| 5764 | /* Resize mini-window W to fit the size of its contents. EXACT:P | 5784 | /* Resize mini-window W to fit the size of its contents. EXACT:P |
| 5765 | means size the window exactly to the size needed. Otherwise, it's | 5785 | means size the window exactly to the size needed. Otherwise, it's |
| 5766 | only enlarged until W's buffer is empty. Value is non-zero if | 5786 | only enlarged until W's buffer is empty. Value is non-zero if |
| @@ -5866,7 +5886,8 @@ current_message () | |||
| 5866 | msg = Qnil; | 5886 | msg = Qnil; |
| 5867 | else | 5887 | else |
| 5868 | { | 5888 | { |
| 5869 | with_echo_area_buffer (0, 0, (int (*) ()) current_message_1, &msg); | 5889 | with_echo_area_buffer (0, 0, current_message_1, |
| 5890 | (EMACS_INT) &msg, 0, 0, 0); | ||
| 5870 | if (NILP (msg)) | 5891 | if (NILP (msg)) |
| 5871 | echo_area_buffer[0] = Qnil; | 5892 | echo_area_buffer[0] = Qnil; |
| 5872 | } | 5893 | } |
| @@ -5876,9 +5897,11 @@ current_message () | |||
| 5876 | 5897 | ||
| 5877 | 5898 | ||
| 5878 | static int | 5899 | static int |
| 5879 | current_message_1 (msg) | 5900 | current_message_1 (a1, a2, a3, a4) |
| 5880 | Lisp_Object *msg; | 5901 | EMACS_INT a1, a2, a3, a4; |
| 5881 | { | 5902 | { |
| 5903 | Lisp_Object *msg = (Lisp_Object *) a1; | ||
| 5904 | |||
| 5882 | if (Z > BEG) | 5905 | if (Z > BEG) |
| 5883 | *msg = make_buffer_string (BEG, Z, 1); | 5906 | *msg = make_buffer_string (BEG, Z, 1); |
| 5884 | else | 5907 | else |
| @@ -5958,7 +5981,7 @@ truncate_echo_area (nchars) | |||
| 5958 | { | 5981 | { |
| 5959 | struct frame *sf = SELECTED_FRAME (); | 5982 | struct frame *sf = SELECTED_FRAME (); |
| 5960 | if (FRAME_MESSAGE_BUF (sf)) | 5983 | if (FRAME_MESSAGE_BUF (sf)) |
| 5961 | with_echo_area_buffer (0, 0, (int (*) ()) truncate_message_1, nchars); | 5984 | with_echo_area_buffer (0, 0, truncate_message_1, nchars, 0, 0, 0); |
| 5962 | } | 5985 | } |
| 5963 | } | 5986 | } |
| 5964 | 5987 | ||
| @@ -5967,8 +5990,8 @@ truncate_echo_area (nchars) | |||
| 5967 | message to at most NCHARS characters. */ | 5990 | message to at most NCHARS characters. */ |
| 5968 | 5991 | ||
| 5969 | static int | 5992 | static int |
| 5970 | truncate_message_1 (nchars) | 5993 | truncate_message_1 (nchars, a2, a3, a4) |
| 5971 | int nchars; | 5994 | EMACS_INT nchars, a2, a3, a4; |
| 5972 | { | 5995 | { |
| 5973 | if (BEG + nchars < Z) | 5996 | if (BEG + nchars < Z) |
| 5974 | del_range (BEG + nchars, Z); | 5997 | del_range (BEG + nchars, Z); |
| @@ -5998,22 +6021,24 @@ set_message (s, string, nbytes, multibyte_p) | |||
| 5998 | = ((s && multibyte_p) | 6021 | = ((s && multibyte_p) |
| 5999 | || (STRINGP (string) && STRING_MULTIBYTE (string))); | 6022 | || (STRINGP (string) && STRING_MULTIBYTE (string))); |
| 6000 | 6023 | ||
| 6001 | with_echo_area_buffer (0, -1, (int (*) ()) set_message_1, | 6024 | with_echo_area_buffer (0, -1, set_message_1, |
| 6002 | s, string, nbytes, multibyte_p); | 6025 | (EMACS_INT) s, string, nbytes, multibyte_p); |
| 6003 | message_buf_print = 0; | 6026 | message_buf_print = 0; |
| 6004 | } | 6027 | } |
| 6005 | 6028 | ||
| 6006 | 6029 | ||
| 6007 | /* Helper function for set_message. Arguments have the same meaning | 6030 | /* Helper function for set_message. Arguments have the same meaning |
| 6008 | as there. This function is called with the echo area buffer being | 6031 | as there, with A1 corresponding to S and A2 corresponding to STRING |
| 6032 | This function is called with the echo area buffer being | ||
| 6009 | current. */ | 6033 | current. */ |
| 6010 | 6034 | ||
| 6011 | static int | 6035 | static int |
| 6012 | set_message_1 (s, string, nbytes, multibyte_p) | 6036 | set_message_1 (a1, a2, nbytes, multibyte_p) |
| 6013 | char *s; | 6037 | EMACS_INT a1, a2, nbytes, multibyte_p; |
| 6014 | Lisp_Object string; | ||
| 6015 | int nbytes, multibyte_p; | ||
| 6016 | { | 6038 | { |
| 6039 | char *s = (char *) a1; | ||
| 6040 | Lisp_Object string = (Lisp_Object) a2; | ||
| 6041 | |||
| 6017 | xassert (BEG == Z); | 6042 | xassert (BEG == Z); |
| 6018 | 6043 | ||
| 6019 | /* Change multibyteness of the echo buffer appropriately. */ | 6044 | /* Change multibyteness of the echo buffer appropriately. */ |