emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/indent.c,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/indent.c,v
Date: Thu, 05 Jun 2008 03:57:11 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/06/05 03:57:10

Index: src/indent.c
===================================================================
RCS file: /sources/emacs/emacs/src/indent.c,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -b -r1.206 -r1.207
--- src/indent.c        14 May 2008 07:49:35 -0000      1.206
+++ src/indent.c        5 Jun 2008 03:57:09 -0000       1.207
@@ -1993,6 +1993,10 @@
 parameters such as width, horizontal scrolling, and so on.
 The default is to use the selected window's parameters.
 
+LINES can optionally take the form (COLS . LINES), in which case
+the motion will not stop at the start of a screen line but on
+its column COLS (if such exists on that line, that is).
+
 `vertical-motion' always uses the current buffer,
 regardless of which buffer is displayed in WINDOW.
 This is consistent with other cursor motion functions
@@ -2006,6 +2010,14 @@
   struct window *w;
   Lisp_Object old_buffer;
   struct gcpro gcpro1;
+  int cols = 0;
+
+  /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES).  */
+  if (CONSP (lines) && (NUMBERP (XCAR (lines))))
+    {
+      cols = XINT (XCAR (lines));
+      lines = XCDR (lines);
+    }
 
   CHECK_NUMBER (lines);
   if (! NILP (window))
@@ -2094,6 +2106,11 @@
       if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0)
        move_it_by_lines (&it, XINT (lines), 0);
 
+      if (cols)
+       move_it_in_display_line (&it, ZV,
+                                cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)),
+                                MOVE_TO_X);
+
       SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
     }
 




reply via email to

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