emacs-devel
[Top][All Lists]
Advanced

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

vertical-motion on stretch glyph


From: Kyotaro HORIGUCHI
Subject: vertical-motion on stretch glyph
Date: Wed, 30 Nov 2005 17:44:06 +0900 (JST)
User-agent: Mew version 4.2.54 on Emacs 22.0 / Mule 5.0 (榊) / Meadow-3.00-dev (菊)

(vertical-motion 1) on stretch glyph results in no motion of
point.

After evaluating the exporession below in *scratch*, M-:
(vertical-motion 1) makes no movement of point.

(save-excursion
  (let ((a "12ABC"))
    (put-text-property 0 2 'display '(space :width 10) a)
    (insert a)))

The following patch fixes this problem.

-- 
Kyotaro HORIGUCHI


Index: indent.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/indent.c,v
retrieving revision 1.180
diff -u -2 -r1.180 indent.c
--- indent.c    7 Aug 2005 12:33:17 -0000       1.180
+++ indent.c    30 Nov 2005 06:52:17 -0000
@@ -2075,5 +2075,5 @@
       int it_start;
       int oselective;
-      int start_on_image_p;
+      int start_on_image_or_stretch_p;
 
       SET_TEXT_POS (pt, PT, PT_BYTE);
@@ -2087,5 +2087,6 @@
         PT had.  */
       it_start = IT_CHARPOS (it);
-      start_on_image_p = (it.method == GET_FROM_IMAGE);
+      start_on_image_or_stretch_p = (it.method == GET_FROM_IMAGE
+                                    || it.method == GET_FROM_STRETCH);
       reseat_at_previous_visible_line_start (&it);
       it.current_x = it.hpos = 0;
@@ -2098,7 +2099,8 @@
       /* Move back if we got too far.  This may happen if
         truncate-lines is on and PT is beyond right margin.
-        It may also happen if it_start is on an image --
-        in that case, don't go back.  */
-      if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 && !start_on_image_p)
+        It may also happen if it_start is on an image or a stretch
+        glyph -- in that case, don't go back.  */
+      if (IT_CHARPOS (it) > it_start && XINT (lines) > 0
+         && !start_on_image_or_stretch_p)
        move_it_by_lines (&it, -1, 0);
 




reply via email to

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