]> code.delx.au - gnu-emacs/commitdiff
Remove recently added BUFFER arg of `window-text-pixel-size'.
authorMartin Rudalics <rudalics@gmx.at>
Thu, 5 Feb 2015 14:40:19 +0000 (15:40 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Thu, 5 Feb 2015 14:40:19 +0000 (15:40 +0100)
* xdisp.c (Fwindow_text_pixel_size): Remove optional BUFFER
argument added on 2015-02-01.
* display.texi (Size of Displayed Text): Remove description of
optional argument BUFFER of `window-text-pixel-size'.

doc/lispref/ChangeLog
doc/lispref/display.texi
src/ChangeLog
src/xdisp.c

index aa4d320083096324f5263e7319b36cfad4b2eca4..e928d19c813afd06c5131921b23bf92f5cceb18c 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-05  Martin Rudalics  <rudalics@gmx.at>
+
+       * display.texi (Size of Displayed Text): Remove description of
+       optional argument BUFFER of `window-text-pixel-size'.
+
 2015-02-01  Martin Rudalics  <rudalics@gmx.at>
 
        * display.texi (Size of Displayed Text): Describe optional
index 10b17a3f3895011ae3fb649b977316e12b112d14..b09b82a6724a4bddeba7e5167896dae3a59507f9 100644 (file)
@@ -1880,7 +1880,7 @@ displayed in a given window.  This function is used by
 @code{fit-frame-to-buffer} (@pxref{Size and Position}) to make a window
 exactly as large as the text it contains.
 
-@defun window-text-pixel-size &optional window from to x-limit y-limit mode-and-header-line buffer
+@defun window-text-pixel-size &optional window from to x-limit y-limit mode-and-header-line
 This function returns the size of the text of @var{window}'s buffer in
 pixels.  @var{window} must be a live window and defaults to the selected
 one.  The return value is a cons of the maximum pixel-width of any text
@@ -1919,13 +1919,6 @@ means to not include the height of the mode- or header-line of
 @code{mode-line} or @code{header-line}, include only the height of that
 line, if present, in the return value.  If it is @code{t}, include the
 height of both, if present, in the return value.
-
-The optional argument @var{buffer} allows to specify an alternate buffer
-whose text size will be calculated.  If @var{buffer} is @code{nil} or
-omitted, then operate on the buffer of @var{window}.  If it is @code{t},
-then operate on the current buffer as if it were displayed in
-@var{window}.  If it specifies a live buffer, then operate on that
-buffer as if it were displayed in @var{window}.
 @end defun
 
 
index 6b56abbafd1a707a5cd0ea82a239ba45baa35be8..2c9b6c8375b0cbb9bfe261bcb93e525ee8199624 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-05  Martin Rudalics  <rudalics@gmx.at>
+
+       * xdisp.c (Fwindow_text_pixel_size): Remove optional BUFFER
+       argument added on 2015-02-01.
+
 2015-02-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        Remove no-longer-used two_byte_p calculations
index 3c928f7897ace09ed84c4c8b3ec591d99ae2978c..5c3e641fdfe211d67e4da5c5a490479c7c08eefc 100644 (file)
@@ -9650,7 +9650,7 @@ in_display_vector_p (struct it *it)
          && it->dpvec + it->current.dpvec_index != it->dpend);
 }
 
-DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 7, 0,
+DEFUN ("window-text-pixel-size", Fwindow_text_pixel_size, Swindow_text_pixel_size, 0, 6, 0,
        doc: /* Return the size of the text of WINDOW's buffer in pixels.
 WINDOW must be a live window and defaults to the selected one.  The
 return value is a cons of the maximum pixel-width of any text line and
@@ -9683,17 +9683,12 @@ Optional argument MODE-AND-HEADER-LINE nil or omitted means do not
 include the height of the mode- or header-line of WINDOW in the return
 value.  If it is either the symbol `mode-line' or `header-line', include
 only the height of that line, if present, in the return value.  If t,
-include the height of both, if present, in the return value.
-
-Optional argument BUFFER nil means to return the size of the text of
-WINDOW's buffer.  BUFFER t means to return the size of the text of the
-current buffer as if it were displayed in WINDOW.  Else BUFFER has to
-specify a live buffer and this function returns the size of the text of
-BUFFER as if it were displayed in WINDOW.  */)
+include the height of both, if present, in the return value.  */)
   (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit,
-   Lisp_Object y_limit, Lisp_Object mode_and_header_line, Lisp_Object buffer)
+   Lisp_Object y_limit, Lisp_Object mode_and_header_line)
 {
   struct window *w = decode_live_window (window);
+  Lisp_Object buffer = w->contents;
   struct buffer *b;
   struct it it;
   struct buffer *old_b = NULL;
@@ -9702,23 +9697,13 @@ BUFFER as if it were displayed in WINDOW.  */)
   void *itdata = NULL;
   int c, max_y = -1, x = 0, y = 0;
 
-  if (EQ (buffer, Qt))
-    b = current_buffer;
-  else
-    {
-      if (NILP (buffer))
-       buffer = w->contents;
-
-      CHECK_BUFFER (buffer);
-      if (!BUFFER_LIVE_P (XBUFFER (buffer)))
-       error ("Not a live buffer");
+  CHECK_BUFFER (buffer);
+  b = XBUFFER (buffer);
 
-      b = XBUFFER (buffer);
-      if (b != current_buffer)
-       {
-         old_b = current_buffer;
-         set_buffer_internal (b);
-       }
+  if (b != current_buffer)
+    {
+      old_b = current_buffer;
+      set_buffer_internal (b);
     }
 
   if (NILP (from))