/[emacs]/emacs/src/xdisp.c
ViewVC logotype

Diff of /emacs/src/xdisp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.745 by monnier, Mon Apr 1 23:10:26 2002 UTC revision 1.746 by rms, Thu Apr 4 21:10:36 2002 UTC
# Line 226  Lisp_Object Qgrow_only; Line 226  Lisp_Object Qgrow_only;
226  Lisp_Object Qinhibit_eval_during_redisplay;  Lisp_Object Qinhibit_eval_during_redisplay;
227  Lisp_Object Qbuffer_position, Qposition, Qobject;  Lisp_Object Qbuffer_position, Qposition, Qobject;
228    
229    Lisp_Object Qrisky_local_variable;
230    
231  /* Holds the list (error).  */  /* Holds the list (error).  */
232  Lisp_Object list_of_error;  Lisp_Object list_of_error;
233    
# Line 760  static int try_window_id P_ ((struct win Line 762  static int try_window_id P_ ((struct win
762  static int display_line P_ ((struct it *));  static int display_line P_ ((struct it *));
763  static int display_mode_lines P_ ((struct window *));  static int display_mode_lines P_ ((struct window *));
764  static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object));  static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object));
765  static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, Lisp_Object));  static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, Lisp_Object, int));
766  static char *decode_mode_spec P_ ((struct window *, int, int, int, int *));  static char *decode_mode_spec P_ ((struct window *, int, int, int, int *));
767  static void display_menu_bar P_ ((struct window *));  static void display_menu_bar P_ ((struct window *));
768  static int display_count_lines P_ ((int, int, int, int, int *));  static int display_count_lines P_ ((int, int, int, int, int *));
# Line 4945  next_element_from_composition (it) Line 4947  next_element_from_composition (it)
4947  /* Move iterator IT to a specified buffer or X position within one  /* Move iterator IT to a specified buffer or X position within one
4948     line on the display without producing glyphs.     line on the display without producing glyphs.
4949    
4950     Begin to skip at IT's current position.  Skip to TO_CHARPOS or TO_X     OP should be a bit mask including some or all of these bits:
4951     whichever is reached first.      MOVE_TO_X: Stop on reaching x-position TO_X.
4952        MOVE_TO_POS: Stop on reaching buffer or string position TO_CHARPOS.
4953     TO_CHARPOS <= 0 means no TO_CHARPOS is specified.     Regardless of OP's value, stop in reaching the end of the display line.
4954    
4955       TO_X is normally a value 0 <= TO_X <= IT->last_visible_x.
4956       This means, in particular, that TO_X includes window's horizontal
4957       scroll amount.
4958    
4959     TO_X < 0 means that no TO_X is specified.  TO_X is normally a value     The return value has several possible values that
4960     0 <= TO_X <= IT->last_visible_x.  This means in particular, that     say what condition caused the scan to stop:
    TO_X includes the amount by which a window is horizontally  
    scrolled.  
   
    Value is  
4961    
4962     MOVE_POS_MATCH_OR_ZV     MOVE_POS_MATCH_OR_ZV
4963       - when TO_POS or ZV was reached.       - when TO_POS or ZV was reached.
# Line 7282  x_consider_frame_title (frame) Line 7284  x_consider_frame_title (frame)
7284        frame_title_ptr = frame_title_buf;        frame_title_ptr = frame_title_buf;
7285        init_iterator (&it, XWINDOW (f->selected_window), -1, -1,        init_iterator (&it, XWINDOW (f->selected_window), -1, -1,
7286                       NULL, DEFAULT_FACE_ID);                       NULL, DEFAULT_FACE_ID);
7287        display_mode_element (&it, 0, -1, -1, fmt, Qnil);        display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0);
7288        len = frame_title_ptr - frame_title_buf;        len = frame_title_ptr - frame_title_buf;
7289        frame_title_ptr = NULL;        frame_title_ptr = NULL;
7290        set_buffer_internal_1 (obuf);        set_buffer_internal_1 (obuf);
# Line 13578  display_mode_line (w, face_id, format) Line 13580  display_mode_line (w, face_id, format)
13580       kboard-local variables in the mode_line_format will get the right       kboard-local variables in the mode_line_format will get the right
13581       values.  */       values.  */
13582    push_frame_kboard (it.f);    push_frame_kboard (it.f);
13583    display_mode_element (&it, 0, 0, 0, format, Qnil);    display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
13584    pop_frame_kboard ();    pop_frame_kboard ();
13585    
13586    /* Fill up with spaces.  */    /* Fill up with spaces.  */
# Line 13621  Lisp_Object mode_line_proptrans_alist; Line 13623  Lisp_Object mode_line_proptrans_alist;
13623     characters to display from ELT's representation.  See     characters to display from ELT's representation.  See
13624     display_string for details.     display_string for details.
13625    
13626     Returns the hpos of the end of the text generated by ELT.  */     Returns the hpos of the end of the text generated by ELT.
13627    
13628       PROPS is a property list to add to any string we encounter.
13629    
13630       If RISKY is nonzero, remove (disregard) any properties in any string
13631       we encounter, and ignore :eval and :propertize.  */
13632    
13633  static int  static int
13634  display_mode_element (it, depth, field_width, precision, elt, props)  display_mode_element (it, depth, field_width, precision, elt, props, risky)
13635       struct it *it;       struct it *it;
13636       int depth;       int depth;
13637       int field_width, precision;       int field_width, precision;
13638       Lisp_Object elt, props;       Lisp_Object elt, props;
13639         int risky;
13640  {  {
13641    int n = 0, field, prec;    int n = 0, field, prec;
13642    int literal = 0;    int literal = 0;
# Line 13647  display_mode_element (it, depth, field_w Line 13655  display_mode_element (it, depth, field_w
13655          unsigned char c;          unsigned char c;
13656          unsigned char *this, *lisp_string;          unsigned char *this, *lisp_string;
13657    
13658          if (!NILP (props))          if (!NILP (props) || risky)
13659            {            {
13660              Lisp_Object oprops, aelt;              Lisp_Object oprops, aelt;
13661              oprops = Ftext_properties_at (make_number (0), elt);              oprops = Ftext_properties_at (make_number (0), elt);
13662              if (NILP (Fequal (props, oprops)))  
13663                if (NILP (Fequal (props, oprops)) || risky)
13664                {                {
13665                  /* If the starting string has properties,                  /* If the starting string has properties,
13666                     merge the specified ones onto the existing ones.  */                     merge the specified ones onto the existing ones.  */
13667                  if (! NILP (oprops))                  if (! NILP (oprops) && !risky)
13668                    {                    {
13669                      Lisp_Object tem;                      Lisp_Object tem;
13670    
# Line 13752  display_mode_element (it, depth, field_w Line 13761  display_mode_element (it, depth, field_w
13761                                    
13762                  if (c == 'M')                  if (c == 'M')
13763                    n += display_mode_element (it, depth, field, prec,                    n += display_mode_element (it, depth, field, prec,
13764                                               Vglobal_mode_string, props);                                               Vglobal_mode_string, props,
13765                                                 risky);
13766                  else if (c != 0)                  else if (c != 0)
13767                    {                    {
13768                      int multibyte;                      int multibyte;
# Line 13813  display_mode_element (it, depth, field_w Line 13823  display_mode_element (it, depth, field_w
13823           literally.  */           literally.  */
13824        {        {
13825          register Lisp_Object tem;          register Lisp_Object tem;
13826    
13827            /* If the variable is not marked as risky to set
13828               then its contents are risky to use.  */
13829            if (NILP (Fget (elt, Qrisky_local_variable)))
13830              risky = 1;
13831    
13832          tem = Fboundp (elt);          tem = Fboundp (elt);
13833          if (!NILP (tem))          if (!NILP (tem))
13834            {            {
# Line 13851  display_mode_element (it, depth, field_w Line 13867  display_mode_element (it, depth, field_w
13867              /* An element of the form (:eval FORM) means evaluate FORM              /* An element of the form (:eval FORM) means evaluate FORM
13868                 and use the result as mode line elements.  */                 and use the result as mode line elements.  */
13869    
13870                if (risky)
13871                  break;
13872    
13873              if (CONSP (XCDR (elt)))              if (CONSP (XCDR (elt)))
13874                {                {
13875                  Lisp_Object spec;                  Lisp_Object spec;
13876                  spec = safe_eval (XCAR (XCDR (elt)));                  spec = safe_eval (XCAR (XCDR (elt)));
13877                  n += display_mode_element (it, depth, field_width - n,                  n += display_mode_element (it, depth, field_width - n,
13878                                             precision - n, spec, props);                                             precision - n, spec, props,
13879                                               risky);
13880                }                }
13881            }            }
13882          else if (EQ (car, QCpropertize))          else if (EQ (car, QCpropertize))
13883            {            {
13884                /* An element of the form (:propertize ELT PROPS...)
13885                   means display ELT but applying properties PROPS.  */
13886    
13887                if (risky)
13888                  break;
13889    
13890              if (CONSP (XCDR (elt)))              if (CONSP (XCDR (elt)))
13891                {                n += display_mode_element (it, depth, field_width - n,
13892                  /* An element of the form (:propertize ELT PROPS...)                                           precision - n, XCAR (XCDR (elt)),
13893                     means display ELT but applying properties PROPS.  */                                           XCDR (XCDR (elt)), risky);
                 n += display_mode_element (it, depth, field_width - n,  
                                            precision - n, XCAR (XCDR (elt)),  
                                            XCDR (XCDR (elt)));  
               }  
13894            }            }
13895          else if (SYMBOLP (car))          else if (SYMBOLP (car))
13896            {            {
# Line 13933  display_mode_element (it, depth, field_w Line 13955  display_mode_element (it, depth, field_w
13955                     && (precision <= 0 || n < precision))                     && (precision <= 0 || n < precision))
13956                {                {
13957                  n += display_mode_element (it, depth, field_width - n,                  n += display_mode_element (it, depth, field_width - n,
13958                                             precision - n, XCAR (elt), props);                                             precision - n, XCAR (elt),
13959                                               props, risky);
13960                  elt = XCDR (elt);                  elt = XCDR (elt);
13961                }                }
13962            }            }
# Line 14922  syms_of_xdisp () Line 14945  syms_of_xdisp ()
14945    staticpro (&Qbuffer_position);    staticpro (&Qbuffer_position);
14946    Qobject = intern ("object");    Qobject = intern ("object");
14947    staticpro (&Qobject);    staticpro (&Qobject);
14948      Qrisky_local_variable = intern ("risky-local-variable");
14949      staticpro (&Qrisky_local_variable);
14950    
14951    list_of_error = Fcons (intern ("error"), Qnil);    list_of_error = Fcons (intern ("error"), Qnil);
14952    staticpro (&list_of_error);    staticpro (&list_of_error);

Legend:
Removed from v.1.745  
changed lines
  Added in v.1.746

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26