comparison lisp/emulation/pc-select.el @ 30792:97c0caec0a32

fixed sds e-mail
author Sam Steingold <sds@gnu.org>
date Mon, 14 Aug 2000 21:45:06 +0000
parents e4668ff0692c
children 9d3da289cab8
comparison
equal deleted inserted replaced
30791:72225a682ad2 30792:97c0caec0a32
3 ;;; including key bindings. 3 ;;; including key bindings.
4 4
5 ;; Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc. 5 ;; Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
6 6
7 ;; Author: Michael Staats <michael@thp.Uni-Duisburg.DE> 7 ;; Author: Michael Staats <michael@thp.Uni-Duisburg.DE>
8 ;; Keywords: convenience 8 ;; Keywords: convenience
9 ;; Created: 26 Sep 1995 9 ;; Created: 26 Sep 1995
10 10
11 ;; This file is part of GNU Emacs. 11 ;; This file is part of GNU Emacs.
12 12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify 13 ;; GNU Emacs is free software; you can redistribute it and/or modify
34 ;; You can still get the old behaviour of cursor moving with the 34 ;; You can still get the old behaviour of cursor moving with the
35 ;; control sequences C-f, C-b, etc. 35 ;; control sequences C-f, C-b, etc.
36 ;; This package uses transient-mark-mode and 36 ;; This package uses transient-mark-mode and
37 ;; delete-selection-mode. 37 ;; delete-selection-mode.
38 ;; 38 ;;
39 ;; In addition to that all key-bindings from the pc-mode are 39 ;; In addition to that all key-bindings from the pc-mode are
40 ;; done here too (as suggested by RMS). 40 ;; done here too (as suggested by RMS).
41 ;; 41 ;;
42 ;; As I found out after I finished the first version, s-region.el tries 42 ;; As I found out after I finished the first version, s-region.el tries
43 ;; to do the same.... But my code is a little more complete and using 43 ;; to do the same.... But my code is a little more complete and using
44 ;; delete-selection-mode is very important for the look-and-feel. 44 ;; delete-selection-mode is very important for the look-and-feel.
57 ;; Thanks to jvromans@squirrel.nl (Johan Vromans) for a bug report 57 ;; Thanks to jvromans@squirrel.nl (Johan Vromans) for a bug report
58 ;; concerning setting of this-command. 58 ;; concerning setting of this-command.
59 ;; Dan Nicolaescu <done@ece.arizona.ro> suggested suppressing the 59 ;; Dan Nicolaescu <done@ece.arizona.ro> suggested suppressing the
60 ;; scroll-up/scroll-down error. 60 ;; scroll-up/scroll-down error.
61 ;; Eli Barzilay (eli@cs.bgu.ac.il) suggested the sexps functions and 61 ;; Eli Barzilay (eli@cs.bgu.ac.il) suggested the sexps functions and
62 ;; keybindings. 62 ;; keybindings.
63 ;; 63 ;;
64 ;; Ok, some details about the idea of pc-selection-mode: 64 ;; Ok, some details about the idea of pc-selection-mode:
65 ;; 65 ;;
66 ;; o The standard keys for moving around (right, left, up, down, home, end, 66 ;; o The standard keys for moving around (right, left, up, down, home, end,
67 ;; prior, next, called "move-keys" from now on) will always de-activate 67 ;; prior, next, called "move-keys" from now on) will always de-activate
227 (defun scroll-down-mark (&optional arg) 227 (defun scroll-down-mark (&optional arg)
228 "Ensure mark is active; scroll down ARG lines; or near full screen if no ARG. 228 "Ensure mark is active; scroll down ARG lines; or near full screen if no ARG.
229 A near full screen is `next-screen-context-lines' less than a full screen. 229 A near full screen is `next-screen-context-lines' less than a full screen.
230 Negative ARG means scroll upward. 230 Negative ARG means scroll upward.
231 When calling from a program, supply a number as argument or nil." 231 When calling from a program, supply a number as argument or nil."
232 (interactive "P") 232 (interactive "P")
233 (ensure-mark) 233 (ensure-mark)
234 (cond (pc-select-override-scroll-error 234 (cond (pc-select-override-scroll-error
235 (condition-case nil (scroll-down arg) 235 (condition-case nil (scroll-down arg)
236 (beginning-of-buffer (goto-char (point-min))))) 236 (beginning-of-buffer (goto-char (point-min)))))
237 (t (scroll-down arg)))) 237 (t (scroll-down arg))))
492 of the accessible part of the buffer. 492 of the accessible part of the buffer.
493 493
494 Don't use this command in Lisp programs! 494 Don't use this command in Lisp programs!
495 \(goto-char (p\oint-min)) is faster and avoids clobbering the mark." 495 \(goto-char (p\oint-min)) is faster and avoids clobbering the mark."
496 (interactive "P") 496 (interactive "P")
497 (ensure-mark) 497 (ensure-mark)
498 (let ((size (- (point-max) (point-min)))) 498 (let ((size (- (point-max) (point-min))))
499 (goto-char (if arg 499 (goto-char (if arg
500 (+ (point-min) 500 (+ (point-min)
501 (if (> size 10000) 501 (if (> size 10000)
502 ;; Avoid overflow for large buffer sizes! 502 ;; Avoid overflow for large buffer sizes!
662 ;; This is to avoid confusion with the delete-selection-mode 662 ;; This is to avoid confusion with the delete-selection-mode
663 ;; On simple displays you can't see that a region is active and 663 ;; On simple displays you can't see that a region is active and
664 ;; will be deleted on the next keypress. IMHO especially for 664 ;; will be deleted on the next keypress. IMHO especially for
665 ;; copy-region-as-kill this is confusing. 665 ;; copy-region-as-kill this is confusing.
666 ;; The same goes for exchange-point-and-mark 666 ;; The same goes for exchange-point-and-mark
667 (define-key global-map "\M-w" 'copy-region-as-kill-nomark) 667 (define-key global-map "\M-w" 'copy-region-as-kill-nomark)
668 (define-key global-map "\C-x\C-x" 'exchange-point-and-mark-nomark) 668 (define-key global-map "\C-x\C-x" 'exchange-point-and-mark-nomark)
669 ;; The following keybindings are for standard ISO keyboards 669 ;; The following keybindings are for standard ISO keyboards
670 ;; as they are used with IBM compatible PCs, IBM RS/6000, 670 ;; as they are used with IBM compatible PCs, IBM RS/6000,
671 ;; MACs, many X-Stations and probably more 671 ;; MACs, many X-Stations and probably more
672 (define-key global-map [S-right] 'forward-char-mark) 672 (define-key global-map [S-right] 'forward-char-mark)
673 (define-key global-map [right] 'forward-char-nomark) 673 (define-key global-map [right] 'forward-char-nomark)
721 721
722 ;; Next four lines are from Pete Forman. 722 ;; Next four lines are from Pete Forman.
723 (global-set-key [C-down] 'forward-paragraph-nomark) ; KNextPara cDn 723 (global-set-key [C-down] 'forward-paragraph-nomark) ; KNextPara cDn
724 (global-set-key [C-up] 'backward-paragraph-nomark) ; KPrevPara cUp 724 (global-set-key [C-up] 'backward-paragraph-nomark) ; KPrevPara cUp
725 (global-set-key [S-C-down] 'forward-paragraph-mark) 725 (global-set-key [S-C-down] 'forward-paragraph-mark)
726 (global-set-key [S-C-up] 'backward-paragraph-mark) 726 (global-set-key [S-C-up] 'backward-paragraph-mark)
727 727
728 (or pc-select-selection-keys-only 728 (or pc-select-selection-keys-only
729 (progn 729 (progn
730 (define-key global-map [S-insert] 'yank) 730 (define-key global-map [S-insert] 'yank)
731 (define-key global-map [C-insert] 'copy-region-as-kill) 731 (define-key global-map [C-insert] 'copy-region-as-kill)
732 (define-key global-map [S-delete] 'kill-region) 732 (define-key global-map [S-delete] 'kill-region)
733 733
734 ;; The following bindings are useful on Sun Type 3 keyboards 734 ;; The following bindings are useful on Sun Type 3 keyboards
735 ;; They implement the Get-Delete-Put (copy-cut-paste) 735 ;; They implement the Get-Delete-Put (copy-cut-paste)
736 ;; functions from sunview on the L6, L8 and L10 keys 736 ;; functions from sunview on the L6, L8 and L10 keys
737 ;; Sam Steingold <sds@ptc.com> says that f16 is copy and f18 is paste. 737 ;; Sam Steingold <sds@gnu.org> says that f16 is copy and f18 is paste.
738 (define-key global-map [f16] 'copy-region-as-kill) 738 (define-key global-map [f16] 'copy-region-as-kill)
739 (define-key global-map [f18] 'yank) 739 (define-key global-map [f18] 'yank)
740 (define-key global-map [f20] 'kill-region) 740 (define-key global-map [f20] 'kill-region)
741 741
742 ;; The following bindings are from Pete Forman. 742 ;; The following bindings are from Pete Forman.
751 (define-key function-key-map [M-delete] [?\M-d]) 751 (define-key function-key-map [M-delete] [?\M-d])
752 (global-set-key [C-M-delete] 'kill-sexp) 752 (global-set-key [C-M-delete] 'kill-sexp)
753 (global-set-key [C-backspace] 'backward-kill-word) 753 (global-set-key [C-backspace] 'backward-kill-word)
754 ;; Next line proposed by Eli Barzilay 754 ;; Next line proposed by Eli Barzilay
755 (global-set-key [C-escape] 'electric-buffer-list))) 755 (global-set-key [C-escape] 'electric-buffer-list)))
756 ;; 756 ;;
757 ;; setup 757 ;; setup
758 ;; 758 ;;
759 ;; Next line proposed by Eli Barzilay 759 ;; Next line proposed by Eli Barzilay
760 (setq highlight-nonselected-windows nil) 760 (setq highlight-nonselected-windows nil)
761 (setq transient-mark-mode t) 761 (setq transient-mark-mode t)