Mercurial > hg > xemacs-beta
comparison lisp/simple.el @ 462:0784d089fdc9 r21-2-46
Import from CVS: tag r21-2-46
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:44:37 +0200 |
parents | 3078fd1074e8 |
children | 54fa1a5c2d12 |
comparison
equal
deleted
inserted
replaced
461:120ed4009e51 | 462:0784d089fdc9 |
---|---|
523 With arg N, put point N/10 of the way from the beginning. | 523 With arg N, put point N/10 of the way from the beginning. |
524 | 524 |
525 If the buffer is narrowed, this command uses the beginning and size | 525 If the buffer is narrowed, this command uses the beginning and size |
526 of the accessible part of the buffer. | 526 of the accessible part of the buffer. |
527 | 527 |
528 The characters that are moved over may be added to the current selection | |
529 \(i.e. active region) if the Shift key is held down, a motion key is used | |
530 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
531 the documentation for this variable for more details. | |
532 | |
528 Don't use this command in Lisp programs! | 533 Don't use this command in Lisp programs! |
529 \(goto-char (point-min)) is faster and avoids clobbering the mark." | 534 \(goto-char (point-min)) is faster and avoids clobbering the mark." |
530 ;; XEmacs change | 535 ;; XEmacs change |
531 (interactive "_P") | 536 (interactive "_P") |
532 (push-mark) | 537 (push-mark) |
545 "Move point to the end of the buffer; leave mark at previous position. | 550 "Move point to the end of the buffer; leave mark at previous position. |
546 With arg N, put point N/10 of the way from the end. | 551 With arg N, put point N/10 of the way from the end. |
547 | 552 |
548 If the buffer is narrowed, this command uses the beginning and size | 553 If the buffer is narrowed, this command uses the beginning and size |
549 of the accessible part of the buffer. | 554 of the accessible part of the buffer. |
555 | |
556 The characters that are moved over may be added to the current selection | |
557 \(i.e. active region) if the Shift key is held down, a motion key is used | |
558 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
559 the documentation for this variable for more details. | |
550 | 560 |
551 Don't use this command in Lisp programs! | 561 Don't use this command in Lisp programs! |
552 \(goto-char (point-max)) is faster and avoids clobbering the mark." | 562 \(goto-char (point-max)) is faster and avoids clobbering the mark." |
553 ;; XEmacs change | 563 ;; XEmacs change |
554 (interactive "_P") | 564 (interactive "_P") |
1101 (interactive "_p") | 1111 (interactive "_p") |
1102 (forward-line (- count)) | 1112 (forward-line (- count)) |
1103 (skip-chars-forward " \t")) | 1113 (skip-chars-forward " \t")) |
1104 | 1114 |
1105 (defcustom kill-whole-line nil | 1115 (defcustom kill-whole-line nil |
1106 "*Control when and whether `kill-line' removes entire lines. | 1116 "*If non-nil, kill the whole line if point is at the beginning. |
1107 Note: This only applies when `kill-line' is called interactively; | 1117 Otherwise, `kill-line' kills only up to the end of the line, but not |
1108 otherwise, it behaves \"historically\". | 1118 the terminating newline. Note: This only applies when `kill-line' is |
1109 | 1119 called interactively. |
1110 If `always', `kill-line' with no arg always kills the whole line, | 1120 |
1111 wherever point is in the line. (If you want to just kill to the end | 1121 WARNING: This is a misnamed variable! It should be called something |
1112 of the line, use \\[historical-kill-line].) | 1122 like `kill-whole-line-when-at-beginning'. If you simply want |
1113 | 1123 \\[kill-line] to kill the entire current line, bind it to the function |
1114 If not `always' but non-nil, `kill-line' with no arg kills the whole | 1124 `kill-entire-line'. " |
1115 line if point is at the beginning, and otherwise behaves historically. | 1125 :type 'boolean |
1116 | |
1117 If nil, `kill-line' behaves historically." | |
1118 :type '(radio (const :tag "Kill to end of line" nil) | |
1119 (const :tag "Kill whole line" always) | |
1120 (const | |
1121 :tag "Kill whole line at beginning, otherwise end of line" t)) | |
1122 :group 'killing) | 1126 :group 'killing) |
1123 | 1127 |
1124 (defun historical-kill-line (&optional arg) | 1128 (defun kill-line-1 (arg entire-line interactive-p) |
1125 "Same as `kill-line' but ignores value of `kill-whole-line'." | 1129 (kill-region (if entire-line |
1126 (interactive "*P") | |
1127 (let ((kill-whole-line nil)) | |
1128 (if (interactive-p) | |
1129 (call-interactively 'kill-line) | |
1130 (kill-line arg)))) | |
1131 | |
1132 (defun kill-line (&optional arg) | |
1133 "Kill the rest of the current line, or the entire line. | |
1134 If no nonblanks there, kill thru newline. | |
1135 If called interactively, may kill the entire line; see `kill-whole-line'. | |
1136 when given no argument at the beginning of a line. | |
1137 With prefix argument, kill that many lines from point. | |
1138 Negative arguments kill lines backward. | |
1139 | |
1140 When calling from a program, nil means \"no arg\", | |
1141 a number counts as a prefix arg." | |
1142 (interactive "*P") | |
1143 (kill-region (if (and (interactive-p) | |
1144 (not arg) | |
1145 (eq kill-whole-line 'always)) | |
1146 (save-excursion | 1130 (save-excursion |
1147 (beginning-of-line) | 1131 (beginning-of-line) |
1148 (point)) | 1132 (point)) |
1149 (point)) | 1133 (point)) |
1150 ;; Don't shift point before doing the delete; that way, | 1134 ;; Don't shift point before doing the delete; that way, |
1160 (if arg | 1144 (if arg |
1161 (forward-line (prefix-numeric-value arg)) | 1145 (forward-line (prefix-numeric-value arg)) |
1162 (if (eobp) | 1146 (if (eobp) |
1163 (signal 'end-of-buffer nil)) | 1147 (signal 'end-of-buffer nil)) |
1164 (if (or (looking-at "[ \t]*$") | 1148 (if (or (looking-at "[ \t]*$") |
1165 (and (interactive-p) | 1149 (or entire-line |
1166 (or (eq kill-whole-line 'always) | 1150 (and interactive-p |
1167 (and kill-whole-line (bolp))))) | 1151 (and kill-whole-line (bolp))))) |
1168 (forward-line 1) | 1152 (forward-line 1) |
1169 (end-of-line))) | 1153 (end-of-line))) |
1170 (point)))) | 1154 (point)))) |
1155 | |
1156 (defun kill-entire-line (&optional arg) | |
1157 "Kill the entire line. | |
1158 With prefix argument, kill that many lines from point. Negative | |
1159 arguments kill lines backward. | |
1160 | |
1161 When calling from a program, nil means \"no arg\", | |
1162 a number counts as a prefix arg." | |
1163 (interactive "*P") | |
1164 (kill-line-1 arg t (interactive-p))) | |
1165 | |
1166 (defun kill-line (&optional arg) | |
1167 "Kill the rest of the current line, or the entire line. | |
1168 If no nonblanks there, kill thru newline. If called interactively, | |
1169 may kill the entire line when given no argument at the beginning of a | |
1170 line; see `kill-whole-line'. With prefix argument, kill that many | |
1171 lines from point. Negative arguments kill lines backward. | |
1172 | |
1173 WARNING: This is a misnamed function! It should be called something | |
1174 like `kill-to-end-of-line'. If you simply want to kill the entire | |
1175 current line, use `kill-entire-line'. | |
1176 | |
1177 When calling from a program, nil means \"no arg\", | |
1178 a number counts as a prefix arg." | |
1179 (interactive "*P") | |
1180 (kill-line-1 arg nil (interactive-p))) | |
1171 | 1181 |
1172 ;; XEmacs | 1182 ;; XEmacs |
1173 (defun backward-kill-line nil | 1183 (defun backward-kill-line nil |
1174 "Kill back to the beginning of the line." | 1184 "Kill back to the beginning of the line." |
1175 (interactive) | 1185 (interactive) |
1724 The special value `shifted-motion-commands' causes marks set as a result | 1734 The special value `shifted-motion-commands' causes marks set as a result |
1725 of selection using any shifted motion commands to not be recorded. | 1735 of selection using any shifted motion commands to not be recorded. |
1726 | 1736 |
1727 The value `yank' affects all yank-like commands, as well as just `yank'." | 1737 The value `yank' affects all yank-like commands, as well as just `yank'." |
1728 :type '(repeat (choice (const :tag "shifted motion commands" | 1738 :type '(repeat (choice (const :tag "shifted motion commands" |
1729 'shifted-motion-commands) | 1739 shifted-motion-commands) |
1730 (const :tag "functions that select text" | 1740 (const :tag "functions that select text" |
1731 :inline t | 1741 :inline t |
1732 '(mark-beginning-of-buffer | 1742 (mark-beginning-of-buffer |
1733 mark-bob | 1743 mark-bob |
1734 mark-defun | 1744 mark-defun |
1735 mark-end-of-buffer | 1745 mark-end-of-buffer |
1736 mark-end-of-line | 1746 mark-end-of-line |
1737 mark-end-of-sentence | 1747 mark-end-of-sentence |
1738 mark-eob | 1748 mark-eob |
1739 mark-marker | 1749 mark-marker |
1740 mark-page | 1750 mark-page |
1741 mark-paragraph | 1751 mark-paragraph |
1742 mark-sexp | 1752 mark-sexp |
1743 mark-whole-buffer | 1753 mark-whole-buffer |
1744 mark-word)) | 1754 mark-word)) |
1745 (const :tag "functions that paste text" | 1755 (const :tag "functions that paste text" |
1746 'yank) | 1756 yank) |
1747 function)) | 1757 function)) |
1748 :group 'killing) | 1758 :group 'killing) |
1749 | 1759 |
1750 (defcustom mark-ring-max 16 | 1760 (defcustom mark-ring-max 16 |
1751 "*Maximum size of mark ring. Start discarding off end if gets this big." | 1761 "*Maximum size of mark ring. Start discarding off end if gets this big." |
1918 (goto-char position) | 1928 (goto-char position) |
1919 (switch-to-buffer buffer))) | 1929 (switch-to-buffer buffer))) |
1920 | 1930 |
1921 | 1931 |
1922 (defcustom signal-error-on-buffer-boundary t | 1932 (defcustom signal-error-on-buffer-boundary t |
1923 "*Non-nil value causes XEmacs to beep or signal an error when certain interactive commands would move point past (point-min) or (point-max). | 1933 "*If Non-nil, beep or signal an error when moving past buffer boundary. |
1924 The commands that honor this variable are | 1934 The commands that honor this variable are |
1925 | 1935 |
1926 forward-char-command | 1936 forward-char-command |
1927 backward-char-command | 1937 backward-char-command |
1928 next-line | 1938 next-line |
1940 :type 'boolean | 1950 :type 'boolean |
1941 :group 'editing-basics) | 1951 :group 'editing-basics) |
1942 | 1952 |
1943 (defcustom shifted-motion-keys-select-region t | 1953 (defcustom shifted-motion-keys-select-region t |
1944 "*If non-nil, shifted motion keys select text, like in MS Windows. | 1954 "*If non-nil, shifted motion keys select text, like in MS Windows. |
1945 See also `unshifted-motion-keys-deselect-region'." | 1955 |
1956 More specifically, if a keystroke that matches one of the key | |
1957 specifications in `motion-keys-for-shifted-motion' is pressed along | |
1958 with the Shift key, and the command invoked moves the cursor and | |
1959 preserves the active region (see `zmacs-region-stays'), the | |
1960 intervening text will be added to the active region. | |
1961 | |
1962 When the region has been enabled or augmented as a result of a shifted | |
1963 motion key, an unshifted motion key will normally deselect the region. | |
1964 However, if `unshifted-motion-keys-deselect-region' is t, the region | |
1965 will remain active, augmented by the characters moved over by this | |
1966 motion key. | |
1967 | |
1968 This functionality is specifically interpreted in terms of keys, and | |
1969 *NOT* in terms of particular commands, because that produces the most | |
1970 intuitive behavior: `forward-char' will work with shifted motion | |
1971 when invoked by `right' but not `C-f', and user-written motion commands | |
1972 bound to motion keys will automatically work with shifted motion." | |
1946 :type 'boolean | 1973 :type 'boolean |
1947 :group 'editing-basics) | 1974 :group 'editing-basics) |
1948 | 1975 |
1949 (defcustom unshifted-motion-keys-deselect-region t | 1976 (defcustom unshifted-motion-keys-deselect-region t |
1950 "*If non-nil, unshifted motion keys deselect a shifted-motion region. | 1977 "*If non-nil, unshifted motion keys deselect a shifted-motion region. |
1951 This only occurs after a region has been selected using shifted motion keys | 1978 This only occurs after a region has been selected or augmented using |
1952 (not when using the traditional set-mark-then-move method), and has no effect | 1979 shifted motion keys (not when using the traditional set-mark-then-move |
1953 if `shifted-motion-keys-select-region' is nil." | 1980 method), and has no effect if `shifted-motion-keys-select-region' is |
1981 nil." | |
1954 :type 'boolean | 1982 :type 'boolean |
1955 :group 'editing-basics) | 1983 :group 'editing-basics) |
1956 | 1984 |
1985 (defcustom motion-keys-for-shifted-motion | |
1986 '(left right up down home end prior next | |
1987 kp-left kp-right kp-up kp-down kp-home kp-end kp-prior kp-next) | |
1988 "*List of keys considered motion keys for the purpose of shifted selection. | |
1989 When one of these keys is pressed along with the Shift key, and the | |
1990 command invoked moves the cursor and preserves the active region (see | |
1991 `zmacs-region-stays'), the intervening text will be added to the active | |
1992 region. See `shifted-motion-keys-select-region' for more details. | |
1993 | |
1994 Each entry should be a keysym or a list (MODIFIERS ... KEYSYM), | |
1995 i.e. zero or more modifiers followed by a keysym. When a keysym alone | |
1996 is given, a keystroke consisting of that keysym, with or without any | |
1997 modifiers, is considered a motion key. When the list form is given, | |
1998 only a keystroke with exactly those modifiers and no others (with the | |
1999 exception of the Shift key) is considered a motion key. | |
2000 | |
2001 NOTE: Currently, the keysym cannot be a non-alphabetic character key | |
2002 such as the `=/+' key. In any case, the shifted-motion paradigm does | |
2003 not make much sense with those keys. The keysym can, however, be an | |
2004 alphabetic key without problem, and you can specify the key using | |
2005 either a character or a symbol, uppercase or lowercase." | |
2006 :type '(repeat (choice (const :tag "normal cursor-pad (\"gray\") keys" | |
2007 :inline t | |
2008 (left right up down home end prior next)) | |
2009 (const :tag "keypad motion keys" | |
2010 :inline t | |
2011 (kp-left kp-right kp-up kp-down | |
2012 kp-home kp-end kp-prior kp-next)) | |
2013 (const :tag "alphabetic motion keys" | |
2014 :inline t | |
2015 ((control b) (control f) | |
2016 (control p) (control n) | |
2017 (control a) (control e) | |
2018 (control v) (meta v) | |
2019 (meta b) (meta f) | |
2020 (meta a) (meta e) | |
2021 (meta m) ; back-to-indentation | |
2022 (meta r) ; move-to-window-line | |
2023 (meta control b) (meta control f) | |
2024 (meta control p) (meta control n) | |
2025 (meta control a) (meta control e) | |
2026 (meta control d) ;; down-list | |
2027 (meta control u) ;; backward-up-list | |
2028 )) | |
2029 symbol)) | |
2030 :group 'editing-basics) | |
2031 | |
1957 (defun handle-pre-motion-command-current-command-is-motion () | 2032 (defun handle-pre-motion-command-current-command-is-motion () |
1958 (and (key-press-event-p last-input-event) | 2033 (and (key-press-event-p last-input-event) |
1959 (memq (event-key last-input-event) | 2034 (let ((key (event-key last-input-event)) |
1960 '(left right up down home end prior next | 2035 (mods (delq 'shift (event-modifiers last-input-event)))) |
1961 kp-left kp-right kp-up kp-down | 2036 ;(princ (format "key: %s mods: %s\n" key mods) 'external-debugging-output) |
1962 kp-home kp-end kp-prior kp-next)))) | 2037 (catch 'handle-pre-motion-command-current-command-is-motion |
2038 (flet ((keysyms-equal (a b) | |
2039 (if (characterp a) | |
2040 (setq a (intern (char-to-string (downcase a))))) | |
2041 (if (characterp b) | |
2042 (setq b (intern (char-to-string (downcase b))))) | |
2043 (eq a b))) | |
2044 (mapc #'(lambda (keysym) | |
2045 (when (if (listp keysym) | |
2046 (and (equal mods (butlast keysym)) | |
2047 (keysyms-equal key (car (last keysym)))) | |
2048 (keysyms-equal key keysym)) | |
2049 (throw | |
2050 'handle-pre-motion-command-current-command-is-motion | |
2051 t))) | |
2052 motion-keys-for-shifted-motion) | |
2053 nil))))) | |
1963 | 2054 |
1964 (defun handle-pre-motion-command () | 2055 (defun handle-pre-motion-command () |
1965 (if | 2056 (if (and |
1966 (and | |
1967 (handle-pre-motion-command-current-command-is-motion) | 2057 (handle-pre-motion-command-current-command-is-motion) |
1968 zmacs-regions | 2058 zmacs-regions |
1969 shifted-motion-keys-select-region | 2059 shifted-motion-keys-select-region |
1970 (not (region-active-p)) | 2060 (not (region-active-p)) |
1971 (memq 'shift (event-modifiers last-input-event))) | 2061 ;; Special-case alphabetic keysyms, because the `shift' |
2062 ;; modifier does not appear on them. (Unfortunately, we have no | |
2063 ;; way of determining Shift-key status on non-alphabetic ASCII | |
2064 ;; keysyms. However, in this case, using Shift will invoke a | |
2065 ;; separate command from the non-shifted version, so the | |
2066 ;; "shifted motion" paradigm makes no sense.) | |
2067 (or (memq 'shift (event-modifiers last-input-event)) | |
2068 (let ((key (event-key last-input-event))) | |
2069 (and (characterp key) | |
2070 (not (eq key (downcase key))))))) | |
1972 (let ((in-shifted-motion-command t)) | 2071 (let ((in-shifted-motion-command t)) |
1973 (push-mark nil nil t)))) | 2072 (push-mark nil nil t)))) |
1974 | 2073 |
1975 (defun handle-post-motion-command () | 2074 (defun handle-post-motion-command () |
1976 (if | 2075 (if |
1977 (and | 2076 (and |
1978 (handle-pre-motion-command-current-command-is-motion) | 2077 (handle-pre-motion-command-current-command-is-motion) |
1979 zmacs-regions | 2078 zmacs-regions |
1980 (region-active-p)) | 2079 (region-active-p)) |
1981 (cond ((memq 'shift (event-modifiers last-input-event)) | 2080 ;; Special-case alphabetic keysyms, because the `shift' |
2081 ;; modifier does not appear on them. See above. | |
2082 (cond ((or (memq 'shift (event-modifiers last-input-event)) | |
2083 (let ((key (event-key last-input-event))) | |
2084 (and (characterp key) | |
2085 (not (eq key (downcase key)))))) | |
1982 (if shifted-motion-keys-select-region | 2086 (if shifted-motion-keys-select-region |
1983 (putf this-command-properties 'shifted-motion-command t)) | 2087 (putf this-command-properties 'shifted-motion-command t)) |
1984 (setq zmacs-region-stays t)) | 2088 (setq zmacs-region-stays t)) |
1985 ((and (getf last-command-properties 'shifted-motion-command) | 2089 ((and (getf last-command-properties 'shifted-motion-command) |
1986 unshifted-motion-keys-deselect-region) | 2090 unshifted-motion-keys-deselect-region) |
1991 (defun forward-char-command (&optional arg buffer) | 2095 (defun forward-char-command (&optional arg buffer) |
1992 "Move point right ARG characters (left if ARG negative) in BUFFER. | 2096 "Move point right ARG characters (left if ARG negative) in BUFFER. |
1993 On attempt to pass end of buffer, stop and signal `end-of-buffer'. | 2097 On attempt to pass end of buffer, stop and signal `end-of-buffer'. |
1994 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'. | 2098 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'. |
1995 Error signaling is suppressed if `signal-error-on-buffer-boundary' | 2099 Error signaling is suppressed if `signal-error-on-buffer-boundary' |
1996 is nil. If BUFFER is nil, the current buffer is assumed." | 2100 is nil. If BUFFER is nil, the current buffer is assumed. |
2101 | |
2102 The characters that are moved over may be added to the current selection | |
2103 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2104 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2105 the documentation for this variable for more details." | |
1997 (interactive "_p") | 2106 (interactive "_p") |
1998 (if signal-error-on-buffer-boundary | 2107 (if signal-error-on-buffer-boundary |
1999 (forward-char arg buffer) | 2108 (forward-char arg buffer) |
2000 (condition-case nil | 2109 (condition-case nil |
2001 (forward-char arg buffer) | 2110 (forward-char arg buffer) |
2005 (defun backward-char-command (&optional arg buffer) | 2114 (defun backward-char-command (&optional arg buffer) |
2006 "Move point left ARG characters (right if ARG negative) in BUFFER. | 2115 "Move point left ARG characters (right if ARG negative) in BUFFER. |
2007 On attempt to pass end of buffer, stop and signal `end-of-buffer'. | 2116 On attempt to pass end of buffer, stop and signal `end-of-buffer'. |
2008 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'. | 2117 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'. |
2009 Error signaling is suppressed if `signal-error-on-buffer-boundary' | 2118 Error signaling is suppressed if `signal-error-on-buffer-boundary' |
2010 is nil. If BUFFER is nil, the current buffer is assumed." | 2119 is nil. If BUFFER is nil, the current buffer is assumed. |
2120 | |
2121 The characters that are moved over may be added to the current selection | |
2122 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2123 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2124 the documentation for this variable for more details." | |
2011 (interactive "_p") | 2125 (interactive "_p") |
2012 (if signal-error-on-buffer-boundary | 2126 (if signal-error-on-buffer-boundary |
2013 (backward-char arg buffer) | 2127 (backward-char arg buffer) |
2014 (condition-case nil | 2128 (condition-case nil |
2015 (backward-char arg buffer) | 2129 (backward-char arg buffer) |
2033 Negative N means scroll downward. | 2147 Negative N means scroll downward. |
2034 When calling from a program, supply a number as argument or nil. | 2148 When calling from a program, supply a number as argument or nil. |
2035 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. | 2149 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. |
2036 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is | 2150 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is |
2037 signaled. | 2151 signaled. |
2152 | |
2153 The characters that are moved over may be added to the current selection | |
2154 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2155 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2156 the documentation for this variable for more details. | |
2038 | 2157 |
2039 If `signal-error-on-buffer-boundary' is nil, attempts to scroll past buffer | 2158 If `signal-error-on-buffer-boundary' is nil, attempts to scroll past buffer |
2040 boundaries do not cause an error to be signaled." | 2159 boundaries do not cause an error to be signaled." |
2041 (interactive "_P") | 2160 (interactive "_P") |
2042 (if signal-error-on-buffer-boundary | 2161 (if signal-error-on-buffer-boundary |
2065 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. | 2184 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. |
2066 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is | 2185 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is |
2067 signaled. | 2186 signaled. |
2068 | 2187 |
2069 If `signal-error-on-buffer-boundary' is nil, attempts to scroll past buffer | 2188 If `signal-error-on-buffer-boundary' is nil, attempts to scroll past buffer |
2070 boundaries do not cause an error to be signaled." | 2189 boundaries do not cause an error to be signaled. |
2190 | |
2191 The characters that are moved over may be added to the current selection | |
2192 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2193 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2194 the documentation for this variable for more details." | |
2071 (interactive "_P") | 2195 (interactive "_P") |
2072 (if signal-error-on-buffer-boundary | 2196 (if signal-error-on-buffer-boundary |
2073 (scroll-down n) | 2197 (scroll-down n) |
2074 (condition-case nil | 2198 (condition-case nil |
2075 (scroll-down n) | 2199 (scroll-down n) |
2089 | 2213 |
2090 The command \\[set-goal-column] can be used to create | 2214 The command \\[set-goal-column] can be used to create |
2091 a semipermanent goal column to which this command always moves. | 2215 a semipermanent goal column to which this command always moves. |
2092 Then it does not try to move vertically. This goal column is stored | 2216 Then it does not try to move vertically. This goal column is stored |
2093 in `goal-column', which is nil when there is none. | 2217 in `goal-column', which is nil when there is none. |
2218 | |
2219 The characters that are moved over may be added to the current selection | |
2220 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2221 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2222 the documentation for this variable for more details. | |
2094 | 2223 |
2095 If you are thinking of using this in a Lisp program, consider | 2224 If you are thinking of using this in a Lisp program, consider |
2096 using `forward-line' instead. It is usually easier to use | 2225 using `forward-line' instead. It is usually easier to use |
2097 and more reliable (no dependence on goal column, etc.)." | 2226 and more reliable (no dependence on goal column, etc.)." |
2098 (interactive "_p") | 2227 (interactive "_p") |
2121 | 2250 |
2122 The command \\[set-goal-column] can be used to create | 2251 The command \\[set-goal-column] can be used to create |
2123 a semipermanent goal column to which this command always moves. | 2252 a semipermanent goal column to which this command always moves. |
2124 Then it does not try to move vertically. | 2253 Then it does not try to move vertically. |
2125 | 2254 |
2255 The characters that are moved over may be added to the current selection | |
2256 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2257 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2258 the documentation for this variable for more details. | |
2259 | |
2126 If you are thinking of using this in a Lisp program, consider using | 2260 If you are thinking of using this in a Lisp program, consider using |
2127 `forward-line' with a negative argument instead. It is usually easier | 2261 `forward-line' with a negative argument instead. It is usually easier |
2128 to use and more reliable (no dependence on goal column, etc.)." | 2262 to use and more reliable (no dependence on goal column, etc.)." |
2129 (interactive "_p") | 2263 (interactive "_p") |
2130 (if (interactive-p) | 2264 (if (interactive-p) |
2142 :group 'editing-basics) | 2276 :group 'editing-basics) |
2143 | 2277 |
2144 (defun backward-block-of-lines () | 2278 (defun backward-block-of-lines () |
2145 "Move backward by one \"block\" of lines. | 2279 "Move backward by one \"block\" of lines. |
2146 The number of lines that make up a block is controlled by | 2280 The number of lines that make up a block is controlled by |
2147 `block-movement-size', which defaults to 6." | 2281 `block-movement-size', which defaults to 6. |
2282 | |
2283 The characters that are moved over may be added to the current selection | |
2284 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2285 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2286 the documentation for this variable for more details." | |
2148 (interactive "_") | 2287 (interactive "_") |
2149 (forward-line (- block-movement-size))) | 2288 (forward-line (- block-movement-size))) |
2150 | 2289 |
2151 (defun forward-block-of-lines () | 2290 (defun forward-block-of-lines () |
2152 "Move forward by one \"block\" of lines. | 2291 "Move forward by one \"block\" of lines. |
2153 The number of lines that make up a block is controlled by | 2292 The number of lines that make up a block is controlled by |
2154 `block-movement-size', which defaults to 6." | 2293 `block-movement-size', which defaults to 6. |
2294 | |
2295 The characters that are moved over may be added to the current selection | |
2296 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2297 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2298 the documentation for this variable for more details." | |
2155 (interactive "_") | 2299 (interactive "_") |
2156 (forward-line block-movement-size)) | 2300 (forward-line block-movement-size)) |
2157 | 2301 |
2158 (defcustom track-eol nil | 2302 (defcustom track-eol nil |
2159 "*Non-nil means vertical motion starting at end of line keeps to ends of lines. | 2303 "*Non-nil means vertical motion starting at end of line keeps to ends of lines. |
2741 (defun backward-word (&optional count buffer) | 2885 (defun backward-word (&optional count buffer) |
2742 "Move point backward COUNT words (forward if COUNT is negative). | 2886 "Move point backward COUNT words (forward if COUNT is negative). |
2743 Normally t is returned, but if an edge of the buffer is reached, | 2887 Normally t is returned, but if an edge of the buffer is reached, |
2744 point is left there and nil is returned. | 2888 point is left there and nil is returned. |
2745 | 2889 |
2746 COUNT defaults to 1, and BUFFER defaults to the current buffer." | 2890 COUNT defaults to 1, and BUFFER defaults to the current buffer. |
2891 | |
2892 The characters that are moved over may be added to the current selection | |
2893 \(i.e. active region) if the Shift key is held down, a motion key is used | |
2894 to invoke this command, and `shifted-motion-keys-select-region' is t; see | |
2895 the documentation for this variable for more details." | |
2747 (interactive "_p") | 2896 (interactive "_p") |
2748 (forward-word (- (or count 1)) buffer)) | 2897 (forward-word (- (or count 1)) buffer)) |
2749 | 2898 |
2750 (defun mark-word (&optional count) | 2899 (defun mark-word (&optional count) |
2751 "Mark the text from point until encountering the end of a word. | 2900 "Mark the text from point until encountering the end of a word. |