emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/xdisp.c


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c
Date: Wed, 08 Dec 2004 17:16:47 -0500

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.943 emacs/src/xdisp.c:1.944
*** emacs/src/xdisp.c:1.943     Fri Nov 26 14:38:55 2004
--- emacs/src/xdisp.c   Wed Dec  8 22:06:31 2004
***************
*** 342,347 ****
--- 342,352 ----
  
  Lisp_Object Qtrailing_whitespace;
  
+ /* Name and number of the face used to highlight escape glyphs.  */
+ 
+ Lisp_Object Qescape_glyph;
+ int escape_glyph_face;
+ 
  /* The symbol `image' which is the car of the lists used to represent
     images in Lisp.  */
  
***************
*** 4922,4927 ****
--- 4927,4947 ----
                 display.  Then, set IT->dpvec to these glyphs.  */
              GLYPH g;
              int ctl_len;
+             int face_id = escape_glyph_face;
+ 
+             /* Find the face id if `escape-glyph' unless we recently did.  */
+             if (face_id < 0)
+               {
+                 Lisp_Object tem = Fget (Qescape_glyph, Qface);
+                 if (INTEGERP (tem))
+                   face_id = XINT (tem);
+                 else
+                   face_id = 0;
+                 /* If there's overflow, use 0 instead.  */
+                 if (FAST_GLYPH_FACE (FAST_MAKE_GLYPH (0, face_id)) != face_id)
+                   face_id = 0;
+                 escape_glyph_face = face_id;
+               }
  
              if (it->c < 128 && it->ctl_arrow_p)
                {
***************
*** 4931,4940 ****
                      && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp))))
                    g = XINT (DISP_CTRL_GLYPH (it->dp));
                  else
!                   g = FAST_MAKE_GLYPH ('^', 0);
                  XSETINT (it->ctl_chars[0], g);
  
!                 g = FAST_MAKE_GLYPH (it->c ^ 0100, 0);
                  XSETINT (it->ctl_chars[1], g);
                  ctl_len = 2;
                }
--- 4951,4960 ----
                      && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp))))
                    g = XINT (DISP_CTRL_GLYPH (it->dp));
                  else
!                   g = FAST_MAKE_GLYPH ('^', face_id);
                  XSETINT (it->ctl_chars[0], g);
  
!                 g = FAST_MAKE_GLYPH (it->c ^ 0100, face_id);
                  XSETINT (it->ctl_chars[1], g);
                  ctl_len = 2;
                }
***************
*** 4951,4957 ****
                      && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH 
(it->dp))))
                    escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp));
                  else
!                   escape_glyph = FAST_MAKE_GLYPH ('\\', 0);
  
                  if (SINGLE_BYTE_CHAR_P (it->c))
                    str[0] = it->c, len = 1;
--- 4971,4977 ----
                      && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH 
(it->dp))))
                    escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp));
                  else
!                   escape_glyph = FAST_MAKE_GLYPH ('\\', face_id);
  
                  if (SINGLE_BYTE_CHAR_P (it->c))
                    str[0] = it->c, len = 1;
***************
*** 4978,4988 ****
                      XSETINT (it->ctl_chars[i * 4], escape_glyph);
                      /* Insert three more glyphs into IT->ctl_chars for
                         the octal display of the character.  */
!                     g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0', 0);
                      XSETINT (it->ctl_chars[i * 4 + 1], g);
!                     g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0', 0);
                      XSETINT (it->ctl_chars[i * 4 + 2], g);
!                     g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', 0);
                      XSETINT (it->ctl_chars[i * 4 + 3], g);
                    }
                  ctl_len = len * 4;
--- 4998,5011 ----
                      XSETINT (it->ctl_chars[i * 4], escape_glyph);
                      /* Insert three more glyphs into IT->ctl_chars for
                         the octal display of the character.  */
!                     g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0',
!                                          face_id);
                      XSETINT (it->ctl_chars[i * 4 + 1], g);
!                     g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0',
!                                          face_id);
                      XSETINT (it->ctl_chars[i * 4 + 2], g);
!                     g = FAST_MAKE_GLYPH ((str[i] & 7) + '0',
!                                          face_id);
                      XSETINT (it->ctl_chars[i * 4 + 3], g);
                    }
                  ctl_len = len * 4;
***************
*** 11578,11583 ****
--- 11601,11609 ----
    *w->desired_matrix->method = 0;
  #endif
  
+   /* Force this to be looked up again for each redisp of each window.  */
+   escape_glyph_face = -1;
+ 
    specbind (Qinhibit_point_motion_hooks, Qt);
  
    reconsider_clip_changes (w, buffer);
***************
*** 22145,22150 ****
--- 22171,22178 ----
    staticpro (&Qfontification_functions);
    Qtrailing_whitespace = intern ("trailing-whitespace");
    staticpro (&Qtrailing_whitespace);
+   Qescape_glyph = intern ("escape-glyph");
+   staticpro (&Qescape_glyph);
    Qimage = intern ("image");
    staticpro (&Qimage);
    QCmap = intern (":map");




reply via email to

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