emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r108535: * fringe.c (Fset_fringe_bitm


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108535: * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive case.
Date: Sat, 09 Jun 2012 15:27:15 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108535
fixes bug: http://debbugs.gnu.org/9752
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-06-09 15:27:15 +0800
message:
  * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive case.
modified:
  src/ChangeLog
  src/fringe.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-06-08 17:50:17 +0000
+++ b/src/ChangeLog     2012-06-09 07:27:15 +0000
@@ -1,3 +1,8 @@
+2012-06-09  Chong Yidong  <address@hidden>
+
+       * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
+       case (Bug#9752).
+
 2012-06-08  Paul Eggert  <address@hidden>
 
        * xdisp.c (vmessage): Treat frame message as multibyte.

=== modified file 'src/fringe.c'
--- a/src/fringe.c      2012-04-09 22:54:59 +0000
+++ b/src/fringe.c      2012-06-09 07:27:15 +0000
@@ -1671,23 +1671,27 @@
   (Lisp_Object bitmap, Lisp_Object face)
 {
   int n;
-  int face_id;
 
   CHECK_SYMBOL (bitmap);
   n = lookup_fringe_bitmap (bitmap);
   if (!n)
     error ("Undefined fringe bitmap");
 
+  /* The purpose of the following code is to signal an error if FACE
+     is not a face.  This is for the caller's convenience only; the
+     redisplay code should be able to fail gracefully.  Skip the check
+     if FRINGE_FACE_ID is unrealized (as in batch mode and during
+     daemon startup).  */
   if (!NILP (face))
     {
-      face_id = lookup_derived_face (SELECTED_FRAME (), face,
-                                    FRINGE_FACE_ID, 1);
-      if (face_id < 0)
+      struct frame *f = SELECTED_FRAME ();
+
+      if (FACE_FROM_ID (f, FRINGE_FACE_ID)
+         && lookup_derived_face (f, face, FRINGE_FACE_ID, 1) < 0)
        error ("No such face");
     }
 
   fringe_faces[n] = face;
-
   return Qnil;
 }
 


reply via email to

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