aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-01-26 19:53:32 +0000
committerRichard M. Stallman1996-01-26 19:53:32 +0000
commit14dacacd653d70334d4b6d7b09b5fe5e1929dac6 (patch)
treecda3dc825d0ea1dedd7507c0824b1ea286e7640c
parentc2304e0240e57545c939c872d9bd67d130c8554e (diff)
downloademacs-14dacacd653d70334d4b6d7b09b5fe5e1929dac6.tar.gz
emacs-14dacacd653d70334d4b6d7b09b5fe5e1929dac6.zip
Add some keybindings.
(next-line-mark, next-line-nomark): Set this-command. (previous-line-mark, previous-line-nomark): Likewise. (end-of-line-mark, end-of-line-nomark): Likewise.
-rw-r--r--lisp/emulation/pc-select.el36
1 files changed, 26 insertions, 10 deletions
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el
index f0451d70fcc..4c1103b40d9 100644
--- a/lisp/emulation/pc-select.el
+++ b/lisp/emulation/pc-select.el
@@ -53,6 +53,8 @@
53;; David Biesack <sasdjb@unx.sas.com> suggested some more cleanup. 53;; David Biesack <sasdjb@unx.sas.com> suggested some more cleanup.
54;; Thanks to Pete Forman <pete.forman@airgun.wg.waii.com> 54;; Thanks to Pete Forman <pete.forman@airgun.wg.waii.com>
55;; for additional motif keybindings. 55;; for additional motif keybindings.
56;; Thanks to jvromans@squirrel.nl (Johan Vromans) for a bug report
57;; concerning setting of this-command.
56;; 58;;
57;; 59;;
58;; Ok, some details about the idea of pc-selection-mode: 60;; Ok, some details about the idea of pc-selection-mode:
@@ -121,7 +123,7 @@ and nil is returned."
121 "Ensure mark is active; move forward to end of paragraph. 123 "Ensure mark is active; move forward to end of paragraph.
122With arg N, do it N times; negative arg -N means move backward N paragraphs.\n 124With arg N, do it N times; negative arg -N means move backward N paragraphs.\n
123A line which `paragraph-start' matches either separates paragraphs 125A line which `paragraph-start' matches either separates paragraphs
124(if `paragraph-separate' matches it also) or is the first line of a paragraph. 126\(if `paragraph-separate' matches it also) or is the first line of a paragraph.
125A paragraph end is the beginning of a line which is not part of the paragraph 127A paragraph end is the beginning of a line which is not part of the paragraph
126to which the end of the previous line belongs, or the end of the buffer." 128to which the end of the previous line belongs, or the end of the buffer."
127 (interactive "p") 129 (interactive "p")
@@ -144,7 +146,8 @@ Then it does not try to move vertically. This goal column is stored
144in `goal-column', which is nil when there is none." 146in `goal-column', which is nil when there is none."
145 (interactive "p") 147 (interactive "p")
146 (ensure-mark) 148 (ensure-mark)
147 (next-line arg)) 149 (next-line arg)
150 (setq this-command 'next-line))
148 151
149(defun end-of-line-mark (&optional arg) 152(defun end-of-line-mark (&optional arg)
150 "Ensure mark is active; move point to end of current line. 153 "Ensure mark is active; move point to end of current line.
@@ -152,7 +155,8 @@ With argument ARG not nil or 1, move forward ARG - 1 lines first.
152If scan reaches end of buffer, stop there without error." 155If scan reaches end of buffer, stop there without error."
153 (interactive "p") 156 (interactive "p")
154 (ensure-mark) 157 (ensure-mark)
155 (end-of-line arg)) 158 (end-of-line arg)
159 (setq this-command 'end-of-line))
156 160
157(defun scroll-down-mark (&optional arg) 161(defun scroll-down-mark (&optional arg)
158 "Ensure mark is active; scroll down ARG lines; or near full screen if no ARG. 162 "Ensure mark is active; scroll down ARG lines; or near full screen if no ARG.
@@ -219,7 +223,7 @@ and nil is returned."
219 "Deactivate mark; move forward to end of paragraph. 223 "Deactivate mark; move forward to end of paragraph.
220With arg N, do it N times; negative arg -N means move backward N paragraphs.\n 224With arg N, do it N times; negative arg -N means move backward N paragraphs.\n
221A line which `paragraph-start' matches either separates paragraphs 225A line which `paragraph-start' matches either separates paragraphs
222(if `paragraph-separate' matches it also) or is the first line of a paragraph. 226\(if `paragraph-separate' matches it also) or is the first line of a paragraph.
223A paragraph end is the beginning of a line which is not part of the paragraph 227A paragraph end is the beginning of a line which is not part of the paragraph
224to which the end of the previous line belongs, or the end of the buffer." 228to which the end of the previous line belongs, or the end of the buffer."
225 (interactive "p") 229 (interactive "p")
@@ -242,7 +246,8 @@ Then it does not try to move vertically. This goal column is stored
242in `goal-column', which is nil when there is none." 246in `goal-column', which is nil when there is none."
243 (interactive "p") 247 (interactive "p")
244 (setq mark-active nil) 248 (setq mark-active nil)
245 (next-line arg)) 249 (next-line arg)
250 (setq this-command 'next-line))
246 251
247(defun end-of-line-nomark (&optional arg) 252(defun end-of-line-nomark (&optional arg)
248 "Deactivate mark; move point to end of current line. 253 "Deactivate mark; move point to end of current line.
@@ -250,7 +255,8 @@ With argument ARG not nil or 1, move forward ARG - 1 lines first.
250If scan reaches end of buffer, stop there without error." 255If scan reaches end of buffer, stop there without error."
251 (interactive "p") 256 (interactive "p")
252 (setq mark-active nil) 257 (setq mark-active nil)
253 (end-of-line arg)) 258 (end-of-line arg)
259 (setq this-command 'end-of-line))
254 260
255(defun scroll-down-nomark (&optional arg) 261(defun scroll-down-nomark (&optional arg)
256 "Deactivate mark; scroll down ARG lines; or near full screen if no ARG. 262 "Deactivate mark; scroll down ARG lines; or near full screen if no ARG.
@@ -267,7 +273,7 @@ With arg N, put point N/10 of the way from the end.\n
267If the buffer is narrowed, this command uses the beginning and size 273If the buffer is narrowed, this command uses the beginning and size
268of the accessible part of the buffer.\n 274of the accessible part of the buffer.\n
269Don't use this command in Lisp programs! 275Don't use this command in Lisp programs!
270(goto-char (point-max)) is faster and avoids clobbering the mark." 276\(goto-char (point-max)) is faster and avoids clobbering the mark."
271 (interactive "P") 277 (interactive "P")
272 (setq mark-active nil) 278 (setq mark-active nil)
273 (let ((size (- (point-max) (point-min)))) 279 (let ((size (- (point-max) (point-min))))
@@ -338,7 +344,8 @@ If you are thinking of using this in a Lisp program, consider using
338to use and more reliable (no dependence on goal column, etc.)." 344to use and more reliable (no dependence on goal column, etc.)."
339 (interactive "p") 345 (interactive "p")
340 (ensure-mark) 346 (ensure-mark)
341 (previous-line arg)) 347 (previous-line arg)
348 (setq this-command 'previous-line))
342 349
343(defun beginning-of-line-mark (&optional arg) 350(defun beginning-of-line-mark (&optional arg)
344 "Ensure mark is active; move point to beginning of current line. 351 "Ensure mark is active; move point to beginning of current line.
@@ -419,7 +426,8 @@ a semipermanent goal column to which this command always moves.
419Then it does not try to move vertically." 426Then it does not try to move vertically."
420 (interactive "p") 427 (interactive "p")
421 (setq mark-active nil) 428 (setq mark-active nil)
422 (previous-line arg)) 429 (previous-line arg)
430 (setq this-command 'previous-line))
423 431
424(defun beginning-of-line-nomark (&optional arg) 432(defun beginning-of-line-nomark (&optional arg)
425 "Deactivate mark; move point to beginning of current line. 433 "Deactivate mark; move point to beginning of current line.
@@ -444,7 +452,7 @@ With arg N, put point N/10 of the way from the beginning.\n
444If the buffer is narrowed, this command uses the beginning and size 452If the buffer is narrowed, this command uses the beginning and size
445of the accessible part of the buffer.\n 453of the accessible part of the buffer.\n
446Don't use this command in Lisp programs! 454Don't use this command in Lisp programs!
447(goto-char (point-min)) is faster and avoids clobbering the mark." 455\(goto-char (point-min)) is faster and avoids clobbering the mark."
448 (interactive "P") 456 (interactive "P")
449 (setq mark-active nil) 457 (setq mark-active nil)
450 (let ((size (- (point-max) (point-min)))) 458 (let ((size (- (point-max) (point-min))))
@@ -487,6 +495,8 @@ the MAC GUI or MS-Windows (sorry for the last one)."
487 (define-key global-map [right] 'forward-char-nomark) 495 (define-key global-map [right] 'forward-char-nomark)
488 (define-key global-map [C-S-right] 'forward-word-mark) 496 (define-key global-map [C-S-right] 'forward-word-mark)
489 (define-key global-map [C-right] 'forward-word-nomark) 497 (define-key global-map [C-right] 'forward-word-nomark)
498 (define-key global-map [M-S-right] 'forward-word-mark)
499 (define-key global-map [M-right] 'forward-word-nomark)
490 500
491 (define-key global-map [S-down] 'next-line-mark) 501 (define-key global-map [S-down] 'next-line-mark)
492 (define-key global-map [down] 'next-line-nomark) 502 (define-key global-map [down] 'next-line-nomark)
@@ -495,6 +505,8 @@ the MAC GUI or MS-Windows (sorry for the last one)."
495 (define-key global-map [end] 'end-of-line-nomark) 505 (define-key global-map [end] 'end-of-line-nomark)
496 (global-set-key [S-C-end] 'end-of-buffer-mark) 506 (global-set-key [S-C-end] 'end-of-buffer-mark)
497 (global-set-key [C-end] 'end-of-buffer-nomark) 507 (global-set-key [C-end] 'end-of-buffer-nomark)
508 (global-set-key [S-M-end] 'end-of-buffer-mark)
509 (global-set-key [M-end] 'end-of-buffer-nomark)
498 510
499 (define-key global-map [S-next] 'scroll-up-mark) 511 (define-key global-map [S-next] 'scroll-up-mark)
500 (define-key global-map [next] 'scroll-up-nomark) 512 (define-key global-map [next] 'scroll-up-nomark)
@@ -503,6 +515,8 @@ the MAC GUI or MS-Windows (sorry for the last one)."
503 (define-key global-map [left] 'backward-char-nomark) 515 (define-key global-map [left] 'backward-char-nomark)
504 (define-key global-map [C-S-left] 'backward-word-mark) 516 (define-key global-map [C-S-left] 'backward-word-mark)
505 (define-key global-map [C-left] 'backward-word-nomark) 517 (define-key global-map [C-left] 'backward-word-nomark)
518 (define-key global-map [M-S-left] 'backward-word-mark)
519 (define-key global-map [M-left] 'backward-word-nomark)
506 520
507 (define-key global-map [S-up] 'previous-line-mark) 521 (define-key global-map [S-up] 'previous-line-mark)
508 (define-key global-map [up] 'previous-line-nomark) 522 (define-key global-map [up] 'previous-line-nomark)
@@ -511,6 +525,8 @@ the MAC GUI or MS-Windows (sorry for the last one)."
511 (define-key global-map [home] 'beginning-of-line-nomark) 525 (define-key global-map [home] 'beginning-of-line-nomark)
512 (global-set-key [S-C-home] 'beginning-of-buffer-mark) 526 (global-set-key [S-C-home] 'beginning-of-buffer-mark)
513 (global-set-key [C-home] 'beginning-of-buffer-nomark) 527 (global-set-key [C-home] 'beginning-of-buffer-nomark)
528 (global-set-key [S-M-home] 'beginning-of-buffer-mark)
529 (global-set-key [M-home] 'beginning-of-buffer-nomark)
514 530
515 (define-key global-map [S-prior] 'scroll-down-mark) 531 (define-key global-map [S-prior] 'scroll-down-mark)
516 (define-key global-map [prior] 'scroll-down-nomark) 532 (define-key global-map [prior] 'scroll-down-nomark)