diff options
Diffstat (limited to 'src/indent.c')
| -rw-r--r-- | src/indent.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c index 9d69936d440..fdc042bc9e4 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1993,6 +1993,10 @@ The optional second argument WINDOW specifies the window to use for | |||
| 1993 | parameters such as width, horizontal scrolling, and so on. | 1993 | parameters such as width, horizontal scrolling, and so on. |
| 1994 | The default is to use the selected window's parameters. | 1994 | The default is to use the selected window's parameters. |
| 1995 | 1995 | ||
| 1996 | LINES can optionally take the form (COLS . LINES), in which case | ||
| 1997 | the motion will not stop at the start of a screen line but on | ||
| 1998 | its column COLS (if such exists on that line, that is). | ||
| 1999 | |||
| 1996 | `vertical-motion' always uses the current buffer, | 2000 | `vertical-motion' always uses the current buffer, |
| 1997 | regardless of which buffer is displayed in WINDOW. | 2001 | regardless of which buffer is displayed in WINDOW. |
| 1998 | This is consistent with other cursor motion functions | 2002 | This is consistent with other cursor motion functions |
| @@ -2006,6 +2010,14 @@ whether or not it is currently displayed in some window. */) | |||
| 2006 | struct window *w; | 2010 | struct window *w; |
| 2007 | Lisp_Object old_buffer; | 2011 | Lisp_Object old_buffer; |
| 2008 | struct gcpro gcpro1; | 2012 | struct gcpro gcpro1; |
| 2013 | int cols = 0; | ||
| 2014 | |||
| 2015 | /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */ | ||
| 2016 | if (CONSP (lines) && (NUMBERP (XCAR (lines)))) | ||
| 2017 | { | ||
| 2018 | cols = XINT (XCAR (lines)); | ||
| 2019 | lines = XCDR (lines); | ||
| 2020 | } | ||
| 2009 | 2021 | ||
| 2010 | CHECK_NUMBER (lines); | 2022 | CHECK_NUMBER (lines); |
| 2011 | if (! NILP (window)) | 2023 | if (! NILP (window)) |
| @@ -2094,6 +2106,11 @@ whether or not it is currently displayed in some window. */) | |||
| 2094 | if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0) | 2106 | if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0) |
| 2095 | move_it_by_lines (&it, XINT (lines), 0); | 2107 | move_it_by_lines (&it, XINT (lines), 0); |
| 2096 | 2108 | ||
| 2109 | if (cols) | ||
| 2110 | move_it_in_display_line (&it, ZV, | ||
| 2111 | cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)), | ||
| 2112 | MOVE_TO_X); | ||
| 2113 | |||
| 2097 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); | 2114 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); |
| 2098 | } | 2115 | } |
| 2099 | 2116 | ||