Mercurial > emacs
comparison src/xdisp.c @ 57036:1e7c3f7f68db
(decode_mode_spec): Use current buffer for most purposes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 09 Sep 2004 14:53:23 +0000 |
parents | 1e3f2e826c24 |
children | 645b4e98b84e 42acc7fa8a4f 566253900690 |
comparison
equal
deleted
inserted
replaced
57035:0f53ff12f87c | 57036:1e7c3f7f68db |
---|---|
16125 | 16125 |
16126 /* Return a string for the output of a mode line %-spec for window W, | 16126 /* Return a string for the output of a mode line %-spec for window W, |
16127 generated by character C. PRECISION >= 0 means don't return a | 16127 generated by character C. PRECISION >= 0 means don't return a |
16128 string longer than that value. FIELD_WIDTH > 0 means pad the | 16128 string longer than that value. FIELD_WIDTH > 0 means pad the |
16129 string returned with spaces to that value. Return 1 in *MULTIBYTE | 16129 string returned with spaces to that value. Return 1 in *MULTIBYTE |
16130 if the result is multibyte text. */ | 16130 if the result is multibyte text. |
16131 | |
16132 Note we operate on the current buffer for most purposes, | |
16133 the exception being w->base_line_pos. */ | |
16131 | 16134 |
16132 static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------"; | 16135 static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------"; |
16133 | 16136 |
16134 static char * | 16137 static char * |
16135 decode_mode_spec (w, c, field_width, precision, multibyte) | 16138 decode_mode_spec (w, c, field_width, precision, multibyte) |
16139 int *multibyte; | 16142 int *multibyte; |
16140 { | 16143 { |
16141 Lisp_Object obj; | 16144 Lisp_Object obj; |
16142 struct frame *f = XFRAME (WINDOW_FRAME (w)); | 16145 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
16143 char *decode_mode_spec_buf = f->decode_mode_spec_buffer; | 16146 char *decode_mode_spec_buf = f->decode_mode_spec_buffer; |
16144 struct buffer *b = XBUFFER (w->buffer); | 16147 struct buffer *b = current_buffer; |
16145 | 16148 |
16146 obj = Qnil; | 16149 obj = Qnil; |
16147 *multibyte = 0; | 16150 *multibyte = 0; |
16148 | 16151 |
16149 switch (c) | 16152 switch (c) |
16441 } | 16444 } |
16442 } | 16445 } |
16443 | 16446 |
16444 case 's': | 16447 case 's': |
16445 /* status of process */ | 16448 /* status of process */ |
16446 obj = Fget_buffer_process (w->buffer); | 16449 obj = Fget_buffer_process (Fcurrent_buffer ()); |
16447 if (NILP (obj)) | 16450 if (NILP (obj)) |
16448 return "no process"; | 16451 return "no process"; |
16449 #ifdef subprocesses | 16452 #ifdef subprocesses |
16450 obj = Fsymbol_name (Fprocess_status (obj)); | 16453 obj = Fsymbol_name (Fprocess_status (obj)); |
16451 #endif | 16454 #endif |