diff options
| author | Karl Heuer | 1994-03-15 06:49:39 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-03-15 06:49:39 +0000 |
| commit | 48ae5f0a1d4daebf66a46521f3fa567a92a88251 (patch) | |
| tree | 6062328d89d930779d8e5c6595195d29679a1022 /src | |
| parent | c26cf6c836766a260786923712d151ec3b4cc0ae (diff) | |
| download | emacs-48ae5f0a1d4daebf66a46521f3fa567a92a88251.tar.gz emacs-48ae5f0a1d4daebf66a46521f3fa567a92a88251.zip | |
(message1): Call message2 instead of duplicating code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 61 |
1 files changed, 10 insertions, 51 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index f9cadc18c9d..2bfe02d956b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -189,58 +189,10 @@ int line_number_displayed; | |||
| 189 | /* Maximum buffer size for which to display line numbers. */ | 189 | /* Maximum buffer size for which to display line numbers. */ |
| 190 | int line_number_display_limit; | 190 | int line_number_display_limit; |
| 191 | 191 | ||
| 192 | /* Specify m, a string, as a message in the minibuf. If m is 0, clear out | ||
| 193 | any existing message, and let the minibuffer text show through. */ | ||
| 194 | |||
| 195 | void | ||
| 196 | message1 (m) | ||
| 197 | char *m; | ||
| 198 | { | ||
| 199 | if (noninteractive) | ||
| 200 | { | ||
| 201 | if (noninteractive_need_newline) | ||
| 202 | putc ('\n', stderr); | ||
| 203 | noninteractive_need_newline = 0; | ||
| 204 | if (cursor_in_echo_area != 0) | ||
| 205 | fprintf (stderr, "%s", m); | ||
| 206 | else | ||
| 207 | fprintf (stderr, "%s\n", m); | ||
| 208 | fflush (stderr); | ||
| 209 | } | ||
| 210 | /* A null message buffer means that the frame hasn't really been | ||
| 211 | initialized yet. Error messages get reported properly by | ||
| 212 | cmd_error, so this must be just an informative message; toss it. */ | ||
| 213 | else if (INTERACTIVE && FRAME_MESSAGE_BUF (selected_frame)) | ||
| 214 | { | ||
| 215 | #ifdef MULTI_FRAME | ||
| 216 | Lisp_Object minibuf_frame; | ||
| 217 | |||
| 218 | choose_minibuf_frame (); | ||
| 219 | minibuf_frame = WINDOW_FRAME (XWINDOW (minibuf_window)); | ||
| 220 | FRAME_SAMPLE_VISIBILITY (XFRAME (minibuf_frame)); | ||
| 221 | if (FRAME_VISIBLE_P (selected_frame) | ||
| 222 | && ! FRAME_VISIBLE_P (XFRAME (minibuf_frame))) | ||
| 223 | Fmake_frame_visible (WINDOW_FRAME (XWINDOW (minibuf_window))); | ||
| 224 | #endif | ||
| 225 | |||
| 226 | if (m) | ||
| 227 | { | ||
| 228 | echo_area_glyphs = m; | ||
| 229 | echo_area_glyphs_length = strlen (m); | ||
| 230 | } | ||
| 231 | else | ||
| 232 | echo_area_glyphs = previous_echo_glyphs = 0; | ||
| 233 | |||
| 234 | do_pending_window_change (); | ||
| 235 | echo_area_display (); | ||
| 236 | update_frame (XFRAME (XWINDOW (minibuf_window)->frame), 1, 1); | ||
| 237 | do_pending_window_change (); | ||
| 238 | } | ||
| 239 | } | ||
| 240 | |||
| 241 | /* Display an echo area message M with a specified length of LEN chars. | 192 | /* Display an echo area message M with a specified length of LEN chars. |
| 242 | This way, null characters can be included. Do not pass text that is | 193 | The string may include null characters. If m is 0, clear out any |
| 243 | stored in a Lisp string. */ | 194 | existing message, and let the minibuffer text show through. |
| 195 | Do not pass text that is stored in a Lisp string. */ | ||
| 244 | 196 | ||
| 245 | void | 197 | void |
| 246 | message2 (m, len) | 198 | message2 (m, len) |
| @@ -288,6 +240,13 @@ message2 (m, len) | |||
| 288 | } | 240 | } |
| 289 | } | 241 | } |
| 290 | 242 | ||
| 243 | void | ||
| 244 | message1 (m) | ||
| 245 | char *m; | ||
| 246 | { | ||
| 247 | message2 (m, (m ? strlen (m) : 0)); | ||
| 248 | } | ||
| 249 | |||
| 291 | /* Truncate what will be displayed in the echo area | 250 | /* Truncate what will be displayed in the echo area |
| 292 | the next time we display it--but don't redisplay it now. */ | 251 | the next time we display it--but don't redisplay it now. */ |
| 293 | 252 | ||