emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110741: font.c (Ffont_at): If WINDOW


From: Kenichi Handa
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110741: font.c (Ffont_at): If WINDOW is specified and it is not displaying the current buffer, signal an error.
Date: Tue, 30 Oct 2012 20:39:33 +0900
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110741 [merge]
committer: Kenichi Handa <address@hidden>
branch nick: trunk
timestamp: Tue 2012-10-30 20:39:33 +0900
message:
  font.c (Ffont_at): If WINDOW is specified and it is not displaying the 
current buffer, signal an error.
modified:
  src/ChangeLog
  src/font.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-10-30 03:10:52 +0000
+++ b/src/ChangeLog     2012-10-30 11:38:37 +0000
@@ -1,3 +1,8 @@
+2012-10-30  Kenichi Handa  <address@hidden>
+
+       * font.c (Ffont_at): If WINDOW is specified and it is not
+       displaying the current buffer, signal an error.
+
 2012-10-29  Daniel Colascione  <address@hidden>
 
        * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In

=== modified file 'src/font.c'
--- a/src/font.c        2012-10-23 15:42:29 +0000
+++ b/src/font.c        2012-10-30 11:14:15 +0000
@@ -4760,14 +4760,22 @@
 DEFUN ("font-at", Ffont_at, Sfont_at, 1, 3, 0,
        doc: /* Return a font-object for displaying a character at POSITION.
 Optional second arg WINDOW, if non-nil, is a window displaying
-the current buffer.  It defaults to the currently selected window.  */)
+the current buffer.  It defaults to the currently selected window.
+Optional third arg STRING, if non-nil, is a string containing the target
+character at index specified by POSITION.  */)
   (Lisp_Object position, Lisp_Object window, Lisp_Object string)
 {
   struct window *w;
   ptrdiff_t pos;
 
+  if (NILP (window))
+    window = selected_window;
+  CHECK_LIVE_WINDOW (window);
+  w = XWINDOW (window);
   if (NILP (string))
     {
+      if (XBUFFER (w->buffer) != current_buffer)
+       error ("Specified window is not displaying the current buffer.");
       CHECK_NUMBER_COERCE_MARKER (position);
       if (! (BEGV <= XINT (position) && XINT (position) < ZV))
        args_out_of_range_3 (position, make_number (BEGV), make_number (ZV));
@@ -4781,10 +4789,6 @@
        args_out_of_range (string, position);
       pos = XINT (position);
     }
-  if (NILP (window))
-    window = selected_window;
-  CHECK_LIVE_WINDOW (window);
-  w = XWINDOW (window);
 
   return font_at (-1, pos, NULL, w, string);
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]