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: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c
Date: Tue, 09 Apr 2002 03:42:27 -0400

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.745 emacs/src/xdisp.c:1.746
*** emacs/src/xdisp.c:1.745     Mon Apr  1 18:10:26 2002
--- emacs/src/xdisp.c   Thu Apr  4 16:10:36 2002
***************
*** 226,231 ****
--- 226,233 ----
  Lisp_Object Qinhibit_eval_during_redisplay;
  Lisp_Object Qbuffer_position, Qposition, Qobject;
  
+ Lisp_Object Qrisky_local_variable;
+ 
  /* Holds the list (error).  */
  Lisp_Object list_of_error;
  
***************
*** 760,766 ****
  static int display_line P_ ((struct it *));
  static int display_mode_lines P_ ((struct window *));
  static int display_mode_line P_ ((struct window *, enum face_id, 
Lisp_Object));
! static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, 
Lisp_Object));
  static char *decode_mode_spec P_ ((struct window *, int, int, int, int *));
  static void display_menu_bar P_ ((struct window *));
  static int display_count_lines P_ ((int, int, int, int, int *));
--- 762,768 ----
  static int display_line P_ ((struct it *));
  static int display_mode_lines P_ ((struct window *));
  static int display_mode_line P_ ((struct window *, enum face_id, 
Lisp_Object));
! static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, 
Lisp_Object, int));
  static char *decode_mode_spec P_ ((struct window *, int, int, int, int *));
  static void display_menu_bar P_ ((struct window *));
  static int display_count_lines P_ ((int, int, int, int, int *));
***************
*** 4945,4961 ****
  /* Move iterator IT to a specified buffer or X position within one
     line on the display without producing glyphs.
  
!    Begin to skip at IT's current position.  Skip to TO_CHARPOS or TO_X
!    whichever is reached first.
! 
!    TO_CHARPOS <= 0 means no TO_CHARPOS is specified.
  
!    TO_X < 0 means that no TO_X is specified.  TO_X is normally a value
!    0 <= TO_X <= IT->last_visible_x.  This means in particular, that
!    TO_X includes the amount by which a window is horizontally
!    scrolled.
! 
!    Value is
  
     MOVE_POS_MATCH_OR_ZV
       - when TO_POS or ZV was reached.
--- 4947,4963 ----
  /* Move iterator IT to a specified buffer or X position within one
     line on the display without producing glyphs.
  
!    OP should be a bit mask including some or all of these bits:
!     MOVE_TO_X: Stop on reaching x-position TO_X.
!     MOVE_TO_POS: Stop on reaching buffer or string position TO_CHARPOS.
!    Regardless of OP's value, stop in reaching the end of the display line.
! 
!    TO_X is normally a value 0 <= TO_X <= IT->last_visible_x.
!    This means, in particular, that TO_X includes window's horizontal
!    scroll amount.
  
!    The return value has several possible values that
!    say what condition caused the scan to stop:
  
     MOVE_POS_MATCH_OR_ZV
       - when TO_POS or ZV was reached.
***************
*** 7282,7288 ****
        frame_title_ptr = frame_title_buf;
        init_iterator (&it, XWINDOW (f->selected_window), -1, -1,
                     NULL, DEFAULT_FACE_ID);
!       display_mode_element (&it, 0, -1, -1, fmt, Qnil);
        len = frame_title_ptr - frame_title_buf;
        frame_title_ptr = NULL;
        set_buffer_internal_1 (obuf);
--- 7284,7290 ----
        frame_title_ptr = frame_title_buf;
        init_iterator (&it, XWINDOW (f->selected_window), -1, -1,
                     NULL, DEFAULT_FACE_ID);
!       display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0);
        len = frame_title_ptr - frame_title_buf;
        frame_title_ptr = NULL;
        set_buffer_internal_1 (obuf);
***************
*** 13578,13584 ****
       kboard-local variables in the mode_line_format will get the right
       values.  */
    push_frame_kboard (it.f);
!   display_mode_element (&it, 0, 0, 0, format, Qnil);
    pop_frame_kboard ();
  
    /* Fill up with spaces.  */
--- 13580,13586 ----
       kboard-local variables in the mode_line_format will get the right
       values.  */
    push_frame_kboard (it.f);
!   display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
    pop_frame_kboard ();
  
    /* Fill up with spaces.  */
***************
*** 13621,13634 ****
     characters to display from ELT's representation.  See
     display_string for details.
  
!    Returns the hpos of the end of the text generated by ELT.  */
  
  static int
! display_mode_element (it, depth, field_width, precision, elt, props)
       struct it *it;
       int depth;
       int field_width, precision;
       Lisp_Object elt, props;
  {
    int n = 0, field, prec;
    int literal = 0;
--- 13623,13642 ----
     characters to display from ELT's representation.  See
     display_string for details.
  
!    Returns the hpos of the end of the text generated by ELT.
! 
!    PROPS is a property list to add to any string we encounter.
! 
!    If RISKY is nonzero, remove (disregard) any properties in any string 
!    we encounter, and ignore :eval and :propertize.  */
  
  static int
! display_mode_element (it, depth, field_width, precision, elt, props, risky)
       struct it *it;
       int depth;
       int field_width, precision;
       Lisp_Object elt, props;
+      int risky;
  {
    int n = 0, field, prec;
    int literal = 0;
***************
*** 13647,13661 ****
        unsigned char c;
        unsigned char *this, *lisp_string;
  
!       if (!NILP (props))
          {
            Lisp_Object oprops, aelt;
            oprops = Ftext_properties_at (make_number (0), elt);
!           if (NILP (Fequal (props, oprops)))
              {
                /* If the starting string has properties,
                   merge the specified ones onto the existing ones.  */
!               if (! NILP (oprops))
                  {
                    Lisp_Object tem;
  
--- 13655,13670 ----
        unsigned char c;
        unsigned char *this, *lisp_string;
  
!       if (!NILP (props) || risky)
          {
            Lisp_Object oprops, aelt;
            oprops = Ftext_properties_at (make_number (0), elt);
! 
!           if (NILP (Fequal (props, oprops)) || risky)
              {
                /* If the starting string has properties,
                   merge the specified ones onto the existing ones.  */
!               if (! NILP (oprops) && !risky)
                  {
                    Lisp_Object tem;
  
***************
*** 13752,13758 ****
                
                if (c == 'M')
                  n += display_mode_element (it, depth, field, prec,
!                                            Vglobal_mode_string, props);
                else if (c != 0)
                  {
                    int multibyte;
--- 13761,13768 ----
                
                if (c == 'M')
                  n += display_mode_element (it, depth, field, prec,
!                                            Vglobal_mode_string, props,
!                                            risky);
                else if (c != 0)
                  {
                    int multibyte;
***************
*** 13813,13818 ****
--- 13823,13834 ----
         literally.  */
        {
        register Lisp_Object tem;
+ 
+       /* If the variable is not marked as risky to set
+          then its contents are risky to use.  */
+       if (NILP (Fget (elt, Qrisky_local_variable)))
+         risky = 1;
+ 
        tem = Fboundp (elt);
        if (!NILP (tem))
          {
***************
*** 13851,13874 ****
            /* An element of the form (:eval FORM) means evaluate FORM
               and use the result as mode line elements.  */
  
            if (CONSP (XCDR (elt)))
              {
                Lisp_Object spec;
                spec = safe_eval (XCAR (XCDR (elt)));
                n += display_mode_element (it, depth, field_width - n,
!                                          precision - n, spec, props);
              }
          }
        else if (EQ (car, QCpropertize))
          {
            if (CONSP (XCDR (elt)))
!             {
!               /* An element of the form (:propertize ELT PROPS...)
!                  means display ELT but applying properties PROPS.  */
!               n += display_mode_element (it, depth, field_width - n,
!                                          precision - n, XCAR (XCDR (elt)),
!                                          XCDR (XCDR (elt)));
!             }
          }
        else if (SYMBOLP (car))
          {
--- 13867,13896 ----
            /* An element of the form (:eval FORM) means evaluate FORM
               and use the result as mode line elements.  */
  
+           if (risky)
+             break;
+ 
            if (CONSP (XCDR (elt)))
              {
                Lisp_Object spec;
                spec = safe_eval (XCAR (XCDR (elt)));
                n += display_mode_element (it, depth, field_width - n,
!                                          precision - n, spec, props,
!                                          risky);
              }
          }
        else if (EQ (car, QCpropertize))
          {
+           /* An element of the form (:propertize ELT PROPS...)
+              means display ELT but applying properties PROPS.  */
+ 
+           if (risky)
+             break;
+ 
            if (CONSP (XCDR (elt)))
!             n += display_mode_element (it, depth, field_width - n,
!                                        precision - n, XCAR (XCDR (elt)),
!                                        XCDR (XCDR (elt)), risky);
          }
        else if (SYMBOLP (car))
          {
***************
*** 13933,13939 ****
                   && (precision <= 0 || n < precision))
              {
                n += display_mode_element (it, depth, field_width - n,
!                                          precision - n, XCAR (elt), props);
                elt = XCDR (elt);
              }
          }
--- 13955,13962 ----
                   && (precision <= 0 || n < precision))
              {
                n += display_mode_element (it, depth, field_width - n,
!                                          precision - n, XCAR (elt),
!                                          props, risky);
                elt = XCDR (elt);
              }
          }
***************
*** 14922,14927 ****
--- 14945,14952 ----
    staticpro (&Qbuffer_position);
    Qobject = intern ("object");
    staticpro (&Qobject);
+   Qrisky_local_variable = intern ("risky-local-variable");
+   staticpro (&Qrisky_local_variable);
  
    list_of_error = Fcons (intern ("error"), Qnil);
    staticpro (&list_of_error);



reply via email to

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