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: Sat, 29 Oct 2005 15:43:50 -0400

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.1062 emacs/src/xdisp.c:1.1063
*** emacs/src/xdisp.c:1.1062    Fri Oct 28 16:27:47 2005
--- emacs/src/xdisp.c   Sat Oct 29 19:43:46 2005
***************
*** 3176,3181 ****
--- 3176,3184 ----
    Lisp_Object prop, pos;
    enum prop_handled handled = HANDLED_NORMALLY;
  
+   if (!NILP (Vmemory_full))
+     return handled;
+ 
    /* Get the value of the `fontified' property at IT's current buffer
       position.  (The `fontified' property doesn't have a special
       meaning in strings.)  If the value is nil, call functions from
***************
*** 8616,8622 ****
  static Lisp_Object Vmode_line_unwind_vector;
  
  static Lisp_Object
! format_mode_line_unwind_data (obuf)
       struct buffer *obuf;
  {
    Lisp_Object vector;
--- 8619,8625 ----
  static Lisp_Object Vmode_line_unwind_vector;
  
  static Lisp_Object
! format_mode_line_unwind_data (obuf, save_proptrans)
       struct buffer *obuf;
  {
    Lisp_Object vector;
***************
*** 8632,8638 ****
    AREF (vector, 0) = make_number (mode_line_target);
    AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0));
    AREF (vector, 2) = mode_line_string_list;
!   AREF (vector, 3) = mode_line_proptrans_alist;
    AREF (vector, 4) = mode_line_string_face;
    AREF (vector, 5) = mode_line_string_face_prop;
  
--- 8635,8641 ----
    AREF (vector, 0) = make_number (mode_line_target);
    AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0));
    AREF (vector, 2) = mode_line_string_list;
!   AREF (vector, 3) = (save_proptrans ? mode_line_proptrans_alist : Qt);
    AREF (vector, 4) = mode_line_string_face;
    AREF (vector, 5) = mode_line_string_face_prop;
  
***************
*** 8651,8657 ****
    mode_line_target = XINT (AREF (vector, 0));
    mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1));
    mode_line_string_list = AREF (vector, 2);
!   mode_line_proptrans_alist = AREF (vector, 3);
    mode_line_string_face = AREF (vector, 4);
    mode_line_string_face_prop = AREF (vector, 5);
  
--- 8654,8661 ----
    mode_line_target = XINT (AREF (vector, 0));
    mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1));
    mode_line_string_list = AREF (vector, 2);
!   if (! EQ (AREF (vector, 3), Qt))
!     mode_line_proptrans_alist = AREF (vector, 3);
    mode_line_string_face = AREF (vector, 4);
    mode_line_string_face_prop = AREF (vector, 5);
  
***************
*** 8774,8780 ****
         mode_line_target so that display_mode_element will output into
         mode_line_noprop_buf; then display the title.  */
        record_unwind_protect (unwind_format_mode_line,
!                            format_mode_line_unwind_data (current_buffer));
  
        set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer));
        fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
--- 8778,8784 ----
         mode_line_target so that display_mode_element will output into
         mode_line_noprop_buf; then display the title.  */
        record_unwind_protect (unwind_format_mode_line,
!                            format_mode_line_unwind_data (current_buffer, 0));
  
        set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer));
        fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
***************
*** 10571,10577 ****
      clear_garbaged_frames ();
  
    /* Build menubar and tool-bar items.  */
!   prepare_menu_bars ();
  
    if (windows_or_buffers_changed)
      update_mode_lines++;
--- 10575,10582 ----
      clear_garbaged_frames ();
  
    /* Build menubar and tool-bar items.  */
!   if (NILP (Vmemory_full))
!     prepare_menu_bars ();
  
    if (windows_or_buffers_changed)
      update_mode_lines++;
***************
*** 16159,16165 ****
      it.base_face_id = it.face_id = DEFAULT_FACE_ID;
  
    record_unwind_protect (unwind_format_mode_line,
!                        format_mode_line_unwind_data (NULL));
  
    mode_line_target = MODE_LINE_DISPLAY;
  
--- 16164,16170 ----
      it.base_face_id = it.face_id = DEFAULT_FACE_ID;
  
    record_unwind_protect (unwind_format_mode_line,
!                        format_mode_line_unwind_data (NULL, 0));
  
    mode_line_target = MODE_LINE_DISPLAY;
  
***************
*** 16194,16199 ****
--- 16199,16242 ----
    return it.glyph_row->height;
  }
  
+ /* Move element ELT in LIST to the front of LIST.
+    Return the updated list.  */
+ 
+ static Lisp_Object
+ move_elt_to_front (elt, list)
+      Lisp_Object elt, list;
+ {
+   register Lisp_Object tail, prev;
+   register Lisp_Object tem;
+ 
+   tail = list;
+   prev = Qnil;
+   while (CONSP (tail))
+     {
+       tem = XCAR (tail);
+       
+       if (EQ (elt, tem))
+       {
+         /* Splice out the link TAIL.  */
+         if (NILP (prev))
+           list = XCDR (tail);
+         else
+           Fsetcdr (prev, XCDR (tail));
+ 
+         /* Now make it the first.  */
+         Fsetcdr (tail, list);
+         return tail;
+       }
+       else
+       prev = tail;
+       tail = XCDR (tail);
+       QUIT;
+     }
+ 
+   /* Not found--return unchanged LIST.  */
+   return list;
+ }
+ 
  /* Contribute ELT to the mode line for window IT->w.  How it
     translates into text depends on its data type.
  
***************
*** 16243,16249 ****
        unsigned char c;
        int offset = 0;
  
!       if (!NILP (props) || risky)
          {
            Lisp_Object oprops, aelt;
            oprops = Ftext_properties_at (make_number (0), elt);
--- 16286,16293 ----
        unsigned char c;
        int offset = 0;
  
!       if (SCHARS (elt) > 0
!           && (!NILP (props) || risky))
          {
            Lisp_Object oprops, aelt;
            oprops = Ftext_properties_at (make_number (0), elt);
***************
*** 16274,16287 ****
                aelt = Fassoc (elt, mode_line_proptrans_alist);
                if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt))))
                  {
!                   mode_line_proptrans_alist
!                     = Fcons (aelt, Fdelq (aelt, mode_line_proptrans_alist));
                    elt = XCAR (aelt);
                  }
                else
                  {
                    Lisp_Object tem;
  
                    elt = Fcopy_sequence (elt);
                    Fset_text_properties (make_number (0), Flength (elt),
                                          props, elt);
--- 16318,16339 ----
                aelt = Fassoc (elt, mode_line_proptrans_alist);
                if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt))))
                  {
!                   /* AELT is what we want.  Move it to the front
!                      without consing.  */
                    elt = XCAR (aelt);
+                   mode_line_proptrans_alist
+                     = move_elt_to_front (aelt, mode_line_proptrans_alist);
                  }
                else
                  {
                    Lisp_Object tem;
  
+                   /* If AELT has the wrong props, it is useless.
+                      so get rid of it.  */
+                   if (! NILP (aelt))
+                     mode_line_proptrans_alist
+                       = Fdelq (aelt, mode_line_proptrans_alist);
+ 
                    elt = Fcopy_sequence (elt);
                    Fset_text_properties (make_number (0), Flength (elt),
                                          props, elt);
***************
*** 16807,16813 ****
      old_buffer = current_buffer;
  
    record_unwind_protect (unwind_format_mode_line,
!                        format_mode_line_unwind_data (old_buffer));
  
    if (old_buffer)
      set_buffer_internal_1 (XBUFFER (buffer));
--- 16859,16865 ----
      old_buffer = current_buffer;
  
    record_unwind_protect (unwind_format_mode_line,
!                        format_mode_line_unwind_data (old_buffer, 1));
  
    if (old_buffer)
      set_buffer_internal_1 (XBUFFER (buffer));
***************
*** 17195,17202 ****
      case 'e':
  #ifndef SYSTEM_MALLOC
        {
!       extern char *spare_memory;
!       if (spare_memory)
          return "";
        else
          return "!MEM FULL! ";
--- 17247,17253 ----
      case 'e':
  #ifndef SYSTEM_MALLOC
        {
!       if (NILP (Vmemory_full))
          return "";
        else
          return "!MEM FULL! ";




reply via email to

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