aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c39
1 files changed, 12 insertions, 27 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 4459363d3bc..faec93fc6f9 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9703,7 +9703,7 @@ in_display_vector_p (struct it *it)
9703 && it->dpvec + it->current.dpvec_index != it->dpend); 9703 && it->dpvec + it->current.dpvec_index != it->dpend);
9704} 9704}
9705 9705
9706DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 7, 0, 9706DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 6, 0,
9707 doc: /* Return the size of the text of WINDOW's buffer in pixels. 9707 doc: /* Return the size of the text of WINDOW's buffer in pixels.
9708WINDOW must be a live window and defaults to the selected one. The 9708WINDOW must be a live window and defaults to the selected one. The
9709return value is a cons of the maximum pixel-width of any text line and 9709return value is a cons of the maximum pixel-width of any text line and
@@ -9736,17 +9736,12 @@ Optional argument MODE-AND-HEADER-LINE nil or omitted means do not
9736include the height of the mode- or header-line of WINDOW in the return 9736include the height of the mode- or header-line of WINDOW in the return
9737value. If it is either the symbol `mode-line' or `header-line', include 9737value. If it is either the symbol `mode-line' or `header-line', include
9738only the height of that line, if present, in the return value. If t, 9738only the height of that line, if present, in the return value. If t,
9739include the height of both, if present, in the return value. 9739include the height of both, if present, in the return value. */)
9740
9741Optional argument BUFFER nil means to return the size of the text of
9742WINDOW's buffer. BUFFER t means to return the size of the text of the
9743current buffer as if it were displayed in WINDOW. Else BUFFER has to
9744specify a live buffer and this function returns the size of the text of
9745BUFFER as if it were displayed in WINDOW. */)
9746 (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit, 9740 (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit,
9747 Lisp_Object y_limit, Lisp_Object mode_and_header_line, Lisp_Object buffer) 9741 Lisp_Object y_limit, Lisp_Object mode_and_header_line)
9748{ 9742{
9749 struct window *w = decode_live_window (window); 9743 struct window *w = decode_live_window (window);
9744 Lisp_Object buffer = w->contents;
9750 struct buffer *b; 9745 struct buffer *b;
9751 struct it it; 9746 struct it it;
9752 struct buffer *old_b = NULL; 9747 struct buffer *old_b = NULL;
@@ -9755,23 +9750,13 @@ BUFFER as if it were displayed in WINDOW. */)
9755 void *itdata = NULL; 9750 void *itdata = NULL;
9756 int c, max_y = -1, x = 0, y = 0; 9751 int c, max_y = -1, x = 0, y = 0;
9757 9752
9758 if (EQ (buffer, Qt)) 9753 CHECK_BUFFER (buffer);
9759 b = current_buffer; 9754 b = XBUFFER (buffer);
9760 else
9761 {
9762 if (NILP (buffer))
9763 buffer = w->contents;
9764
9765 CHECK_BUFFER (buffer);
9766 if (!BUFFER_LIVE_P (XBUFFER (buffer)))
9767 error ("Not a live buffer");
9768 9755
9769 b = XBUFFER (buffer); 9756 if (b != current_buffer)
9770 if (b != current_buffer) 9757 {
9771 { 9758 old_b = current_buffer;
9772 old_b = current_buffer; 9759 set_buffer_internal (b);
9773 set_buffer_internal (b);
9774 }
9775 } 9760 }
9776 9761
9777 if (NILP (from)) 9762 if (NILP (from))
@@ -10184,7 +10169,7 @@ message3_nolog (Lisp_Object m)
10184 10169
10185 fwrite (SDATA (s), SBYTES (s), 1, stderr); 10170 fwrite (SDATA (s), SBYTES (s), 1, stderr);
10186 } 10171 }
10187 if (cursor_in_echo_area == 0) 10172 if (!cursor_in_echo_area)
10188 fprintf (stderr, "\n"); 10173 fprintf (stderr, "\n");
10189 fflush (stderr); 10174 fflush (stderr);
10190 } 10175 }
@@ -10326,7 +10311,7 @@ vmessage (const char *m, va_list ap)
10326 putc ('\n', stderr); 10311 putc ('\n', stderr);
10327 noninteractive_need_newline = 0; 10312 noninteractive_need_newline = 0;
10328 vfprintf (stderr, m, ap); 10313 vfprintf (stderr, m, ap);
10329 if (cursor_in_echo_area == 0) 10314 if (!cursor_in_echo_area)
10330 fprintf (stderr, "\n"); 10315 fprintf (stderr, "\n");
10331 fflush (stderr); 10316 fflush (stderr);
10332 } 10317 }