emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r111186: Consistently use marker_posi


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111186: Consistently use marker_position and marker_byte_position.
Date: Tue, 11 Dec 2012 10:08:53 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111186
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2012-12-11 10:08:53 +0400
message:
  Consistently use marker_position and marker_byte_position.
  * fringe.c (Ffringe_bitmaps_at_pos):
  * indent.c (Fvertical_motion):
  * insdel.c (prepare_to_modify_buffer):
  * keyboard.c (make_lispy_position):
  * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
  (window_scroll_pixel_based, displayed_window_lines)
  (Fset_window_configuration):
  * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
  (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
  Replace direct access to marker fields with calls
  to marker_position and/or marker_byte_position.
modified:
  src/ChangeLog
  src/fringe.c
  src/indent.c
  src/insdel.c
  src/keyboard.c
  src/window.c
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-12-11 02:06:53 +0000
+++ b/src/ChangeLog     2012-12-11 06:08:53 +0000
@@ -1,3 +1,18 @@
+2012-12-11  Dmitry Antipov  <address@hidden>
+
+       Consistently use marker_position and marker_byte_position.
+       * fringe.c (Ffringe_bitmaps_at_pos):
+       * indent.c (Fvertical_motion):
+       * insdel.c (prepare_to_modify_buffer):
+       * keyboard.c (make_lispy_position):
+       * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
+       (window_scroll_pixel_based, displayed_window_lines)
+       (Fset_window_configuration):
+       * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
+       (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
+       Replace direct access to marker fields with calls
+       to marker_position and/or marker_byte_position.
+
 2012-12-11  Juanma Barranquero  <address@hidden>
 
        * makefile.w32-in (SIG2STR_H): New macro.

=== modified file 'src/fringe.c'
--- a/src/fringe.c      2012-11-02 10:34:26 +0000
+++ b/src/fringe.c      2012-12-11 06:08:53 +0000
@@ -1744,7 +1744,7 @@
   else if (w == XWINDOW (selected_window))
     textpos = PT;
   else
-    textpos = XMARKER (w->pointm)->charpos;
+    textpos = marker_position (w->pointm);
 
   row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
   row = row_containing_pos (w, textpos, row, NULL, 0);

=== modified file 'src/indent.c'
--- a/src/indent.c      2012-12-10 02:00:42 +0000
+++ b/src/indent.c      2012-12-11 06:08:53 +0000
@@ -1991,8 +1991,8 @@
     {
       /* Set the window's buffer temporarily to the current buffer.  */
       old_buffer = w->buffer;
-      old_charpos = XMARKER (w->pointm)->charpos;
-      old_bytepos = XMARKER (w->pointm)->bytepos;
+      old_charpos = marker_position (w->pointm);
+      old_bytepos = marker_byte_position (w->pointm);
       wset_buffer (w, Fcurrent_buffer ());
       set_marker_both (w->pointm, w->buffer,
                       BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));

=== modified file 'src/insdel.c'
--- a/src/insdel.c      2012-12-03 14:13:06 +0000
+++ b/src/insdel.c      2012-12-11 06:08:53 +0000
@@ -1854,7 +1854,7 @@
          : (!NILP (Vselect_active_regions)
             && !NILP (Vtransient_mark_mode))))
     {
-      ptrdiff_t b = XMARKER (BVAR (current_buffer, mark))->charpos;
+      ptrdiff_t b = marker_position (BVAR (current_buffer, mark));
       ptrdiff_t e = PT;
       if (b < e)
        Vsaved_region_selection = make_buffer_string (b, e, 0);

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-12-10 20:46:20 +0000
+++ b/src/keyboard.c    2012-12-11 06:08:53 +0000
@@ -5138,7 +5138,7 @@
            string_info = Fcons (string, make_number (charpos));
          textpos = (w == XWINDOW (selected_window)
                     && current_buffer == XBUFFER (w->buffer))
-           ? PT : XMARKER (w->pointm)->charpos;
+           ? PT : marker_position (w->pointm);
 
          xret = wx;
          yret = wy;

=== modified file 'src/window.c'
--- a/src/window.c      2012-12-10 17:34:47 +0000
+++ b/src/window.c      2012-12-11 06:08:53 +0000
@@ -1492,6 +1492,7 @@
       && !noninteractive)
     {
       struct text_pos startp;
+      ptrdiff_t charpos = marker_position (w->start);
       struct it it;
       struct buffer *old_buffer = NULL;
       void *itdata = NULL;
@@ -1509,9 +1510,9 @@
          `-l' containing a call to `rmail' with subsequent other
          commands.  At the end, W->start happened to be BEG, while
          rmail had already narrowed the buffer.  */
-      if (XMARKER (w->start)->charpos < BEGV)
+      if (charpos < BEGV)
        SET_TEXT_POS (startp, BEGV, BEGV_BYTE);
-      else if (XMARKER (w->start)->charpos > ZV)
+      else if (charpos > ZV)
        SET_TEXT_POS (startp, ZV, ZV_BYTE);
       else
        SET_TEXT_POS_FROM_MARKER (startp, w->start);
@@ -1634,7 +1635,7 @@
   else if (w == XWINDOW (selected_window))
     posint = PT;
   else
-    posint = XMARKER (w->pointm)->charpos;
+    posint = marker_position (w->pointm);
 
   /* If position is above window start or outside buffer boundaries,
      or if window start is out of range, position is not visible.  */
@@ -1980,7 +1981,7 @@
           && EQ (buf, XWINDOW (BVAR (b, last_selected_window))->buffer)))
     temp_set_point_both (b,
                         clip_to_bounds (BUF_BEGV (b),
-                                        XMARKER (w->pointm)->charpos,
+                                        marker_position (w->pointm),
                                         BUF_ZV (b)),
                         clip_to_bounds (BUF_BEGV_BYTE (b),
                                         marker_byte_position (w->pointm),
@@ -4616,7 +4617,7 @@
       /* Set the window start, and set up the window for redisplay.  */
       set_marker_restricted (w->start, make_number (pos),
                             w->buffer);
-      bytepos = XMARKER (w->start)->bytepos;
+      bytepos = marker_byte_position (w->start);
       w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
       w->update_mode_line = 1;
       w->last_modified = 0;
@@ -5116,6 +5117,7 @@
 {
   struct it it;
   struct text_pos start;
+  ptrdiff_t charpos = marker_position (w->start);
   int height = window_box_height (w);
   struct buffer *old_buffer;
   int bottom_y;
@@ -5132,9 +5134,9 @@
   /* In case W->start is out of the accessible range, do something
      reasonable.  This happens in Info mode when Info-scroll-down
      calls (recenter -1) while W->start is 1.  */
-  if (XMARKER (w->start)->charpos < BEGV)
+  if (charpos < BEGV)
     SET_TEXT_POS (start, BEGV, BEGV_BYTE);
-  else if (XMARKER (w->start)->charpos > ZV)
+  else if (charpos > ZV)
     SET_TEXT_POS (start, ZV, ZV_BYTE);
   else
     SET_TEXT_POS_FROM_MARKER (start, w->start);
@@ -5562,7 +5564,7 @@
            && WINDOWP (selected_window)
            && EQ (XWINDOW (selected_window)->buffer, new_current_buffer)
            && !EQ (selected_window, data->current_window))
-         old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
+         old_point = marker_position (XWINDOW (data->current_window)->pointm);
        else
          old_point = PT;
       else
@@ -5577,7 +5579,7 @@
        if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)
            /* If current_window = selected_window, its point is in BUF_PT.  */
            && !EQ (selected_window, data->current_window))
-         old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
+         old_point = marker_position (XWINDOW (data->current_window)->pointm);
        else
          old_point = BUF_PT (XBUFFER (new_current_buffer));
     }

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-12-10 17:34:47 +0000
+++ b/src/xdisp.c       2012-12-11 06:08:53 +0000
@@ -9495,7 +9495,7 @@
              del_range_both (BEG, BEG_BYTE, PT, PT_BYTE, 0);
            }
        }
-      BEGV = XMARKER (oldbegv)->charpos;
+      BEGV = marker_position (oldbegv);
       BEGV_BYTE = marker_byte_position (oldbegv);
 
       if (zv_at_end)
@@ -9505,7 +9505,7 @@
        }
       else
        {
-         ZV = XMARKER (oldzv)->charpos;
+         ZV = marker_position (oldzv);
          ZV_BYTE = marker_byte_position (oldzv);
        }
 
@@ -9514,8 +9514,8 @@
       else
        /* We can't do Fgoto_char (oldpoint) because it will run some
            Lisp code.  */
-       TEMP_SET_PT_BOTH (XMARKER (oldpoint)->charpos,
-                         XMARKER (oldpoint)->bytepos);
+       TEMP_SET_PT_BOTH (marker_position (oldpoint),
+                         marker_byte_position (oldpoint));
 
       UNGCPRO;
       unchain_marker (XMARKER (oldpoint));
@@ -10087,8 +10087,8 @@
     {
       XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i;
       ASET (vector, i, w->buffer); ++i;
-      ASET (vector, i, make_number (XMARKER (w->pointm)->charpos)); ++i;
-      ASET (vector, i, make_number (XMARKER (w->pointm)->bytepos)); ++i;
+      ASET (vector, i, make_number (marker_position (w->pointm))); ++i;
+      ASET (vector, i, make_number (marker_byte_position (w->pointm))); ++i;
     }
   else
     {
@@ -13801,7 +13801,7 @@
          if (w == XWINDOW (selected_window))
            w->last_point = BUF_PT (b);
          else
-           w->last_point = XMARKER (w->pointm)->charpos;
+           w->last_point = marker_position (w->pointm);
        }
     }
 
@@ -15562,7 +15562,7 @@
      window, set up appropriate value.  */
   if (!EQ (window, selected_window))
     {
-      ptrdiff_t new_pt = XMARKER (w->pointm)->charpos;
+      ptrdiff_t new_pt = marker_position (w->pointm);
       ptrdiff_t new_pt_byte = marker_byte_position (w->pointm);
       if (new_pt < BEGV)
        {
@@ -21526,7 +21526,7 @@
        if (mode_line_target == MODE_LINE_TITLE)
          return "";
 
-       startpos = XMARKER (w->start)->charpos;
+       startpos = marker_position (w->start);
        startpos_byte = marker_byte_position (w->start);
        height = WINDOW_TOTAL_LINES (w);
 


reply via email to

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