aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2001-11-19 23:09:28 +0000
committerStefan Monnier2001-11-19 23:09:28 +0000
commitfd4e5923feb3919abcefc8b0e165c5a060caa35f (patch)
tree813965f7839cda694120d9c08d6628f943622269 /lisp
parent6710ea0676a6da518406ea919e5f1c59f11b6948 (diff)
downloademacs-fd4e5923feb3919abcefc8b0e165c5a060caa35f.tar.gz
emacs-fd4e5923feb3919abcefc8b0e165c5a060caa35f.zip
Doc string fixes.
(pc-selection-mode): Don't treat macos as a tty.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emulation/pc-select.el132
1 files changed, 66 insertions, 66 deletions
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el
index c8c3331ba31..9911666e92e 100644
--- a/lisp/emulation/pc-select.el
+++ b/lisp/emulation/pc-select.el
@@ -79,7 +79,7 @@
79 79
80;;; Code: 80;;; Code:
81 81
82;;;; Customization: 82;; Customization:
83(defgroup pc-select nil 83(defgroup pc-select nil
84 "Emulate pc bindings." 84 "Emulate pc bindings."
85 :prefix "pc-select" 85 :prefix "pc-select"
@@ -119,14 +119,15 @@ This gives mostly Emacs-like behaviour with only the selection keys enabled."
119If `interprogram-cut-function' is non-nil, also save the text for a window 119If `interprogram-cut-function' is non-nil, also save the text for a window
120system cut and paste. 120system cut and paste.
121 121
122Deactivating mark is to avoid confusion with delete-selection-mode 122Deactivating mark is to avoid confusion with `delete-selection-mode'
123and transient-mark-mode." 123and `transient-mark-mode'."
124 (interactive "r") 124 (interactive "r")
125 (copy-region-as-kill beg end) 125 (copy-region-as-kill beg end)
126 (setq mark-active nil) 126 (setq mark-active nil)
127 (message "Region saved")) 127 (message "Region saved"))
128 128
129(defun exchange-point-and-mark-nomark () 129(defun exchange-point-and-mark-nomark ()
130 "Like `exchange-point-and-mark' but without activating the mark."
130 (interactive) 131 (interactive)
131 (exchange-point-and-mark) 132 (exchange-point-and-mark)
132 (setq mark-active nil)) 133 (setq mark-active nil))
@@ -198,7 +199,7 @@ to create a line, and moves the cursor to that line. Otherwise it moves the
198cursor to the end of the buffer \(if already at the end of the buffer, an error 199cursor to the end of the buffer \(if already at the end of the buffer, an error
199is signaled). 200is signaled).
200 201
201The command C-x C-n can be used to create 202The command \\[set-goal-column] can be used to create
202a semipermanent goal column to which this command always moves. 203a semipermanent goal column to which this command always moves.
203Then it does not try to move vertically. This goal column is stored 204Then it does not try to move vertically. This goal column is stored
204in `goal-column', which is nil when there is none." 205in `goal-column', which is nil when there is none."
@@ -331,7 +332,7 @@ to create a line, and moves the cursor to that line. Otherwise it moves the
331cursor to the end of the buffer (if already at the end of the buffer, an error 332cursor to the end of the buffer (if already at the end of the buffer, an error
332is signaled). 333is signaled).
333 334
334The command C-x C-n can be used to create 335The command \\[set-goal-column] can be used to create
335a semipermanent goal column to which this command always moves. 336a semipermanent goal column to which this command always moves.
336Then it does not try to move vertically. This goal column is stored 337Then it does not try to move vertically. This goal column is stored
337in `goal-column', which is nil when there is none." 338in `goal-column', which is nil when there is none."
@@ -453,7 +454,7 @@ If there is no character in the target line exactly over the current column,
453the cursor is positioned after the character in that line which spans this 454the cursor is positioned after the character in that line which spans this
454column, or at the end of the line if it is not long enough. 455column, or at the end of the line if it is not long enough.
455 456
456The command C-x C-n can be used to create 457The command \\[set-goal-column] can be used to create
457a semipermanent goal column to which this command always moves. 458a semipermanent goal column to which this command always moves.
458Then it does not try to move vertically. 459Then it does not try to move vertically.
459 460
@@ -555,7 +556,7 @@ If there is no character in the target line exactly over the current column,
555the cursor is positioned after the character in that line which spans this 556the cursor is positioned after the character in that line which spans this
556column, or at the end of the line if it is not long enough. 557column, or at the end of the line if it is not long enough.
557 558
558The command C-x C-n can be used to create 559The command \\[set-goal-column] can be used to create
559a semipermanent goal column to which this command always moves. 560a semipermanent goal column to which this command always moves.
560Then it does not try to move vertically." 561Then it does not try to move vertically."
561 (interactive "p") 562 (interactive "p")
@@ -622,9 +623,9 @@ S-C-LEFT and S-C-RIGHT move back or forward one word, leaving the mark behind.
622 623
623M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark. 624M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark.
624S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark 625S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark
625behind. To control wether these keys move word-wise or sexp-wise set the 626behind. To control whether these keys move word-wise or sexp-wise set the
626variable pc-select-meta-moves-sexps after loading pc-select.el but before 627variable `pc-select-meta-moves-sexps' after loading pc-select.el but before
627turning pc-selection-mode on. 628turning `pc-selection-mode' on.
628 629
629C-DOWN and C-UP move back or forward a paragraph, disabling the mark. 630C-DOWN and C-UP move back or forward a paragraph, disabling the mark.
630S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind. 631S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind.
@@ -645,17 +646,18 @@ S-INSERT yanks text from the kill ring (`yank').
645C-INSERT copies the region into the kill ring (`copy-region-as-kill'). 646C-INSERT copies the region into the kill ring (`copy-region-as-kill').
646 647
647In addition, certain other PC bindings are imitated (to avoid this, set 648In addition, certain other PC bindings are imitated (to avoid this, set
648the variable pc-select-selection-keys-only to t after loading pc-select.el 649the variable `pc-select-selection-keys-only' to t after loading pc-select.el
649but before calling pc-selection-mode): 650but before calling `pc-selection-mode'):
650 651
651 F6 other-window 652 F6 `other-window'
652 DELETE delete-char 653 DELETE `delete-char'
653 C-DELETE kill-line 654 C-DELETE `kill-line'
654 M-DELETE kill-word 655 M-DELETE `kill-word'
655 C-M-DELETE kill-sexp 656 C-M-DELETE `kill-sexp'
656 C-BACKSPACE backward-kill-word 657 C-BACKSPACE `backward-kill-word'
657 M-BACKSPACE undo" 658 M-BACKSPACE `undo'"
658 659 ;; FIXME: make into a proper minor mode (i.e. undoable).
660 ;; FIXME: bring pc-bindings-mode here ?
659 (interactive) 661 (interactive)
660 ;; 662 ;;
661 ;; keybindings 663 ;; keybindings
@@ -727,57 +729,55 @@ but before calling pc-selection-mode):
727 (global-set-key [S-C-down] 'forward-paragraph-mark) 729 (global-set-key [S-C-down] 'forward-paragraph-mark)
728 (global-set-key [S-C-up] 'backward-paragraph-mark) 730 (global-set-key [S-C-up] 'backward-paragraph-mark)
729 731
730 (or pc-select-selection-keys-only 732 (unless pc-select-selection-keys-only
731 (progn 733 ;; We are behaving like normal-erase-is-backspace-mode, so
732 ;; We are behaving like normal-erase-is-backspace-mode, so 734 ;; say so explicitly. But don't do that on a Unix tty, since
733 ;; say so explicitly. But don't do that on a Unix tty, since 735 ;; some of them have keyboards that by default already behave
734 ;; some of them have keyboards that by default already behave 736 ;; as if normal-erase-is-backspace mode is on, and turning it
735 ;; as if normal-erase-is-backspace mode is on, and turning it 737 ;; a second time screws them up.
736 ;; a second time screws them up. 738 (if (or (eq window-system 'x)
737 (if (or (eq window-system 'x) 739 (memq system-name '(ms-dos windows-nt macos)))
738 (memq system-name '(ms-dos windows-nt))) 740 (progn
739 (progn 741 (setq-default normal-erase-is-backspace t)
740 (setq-default normal-erase-is-backspace t) 742 (normal-erase-is-backspace-mode 1))
741 (normal-erase-is-backspace-mode 1)) 743 ;; This is for tty. We don't turn on normal-erase-is-backspace,
742 ;; This is for tty. We don't turn on normal-erase-is-backspace, 744 ;; but bind keys as pc-selection-mode did before
743 ;; but bind keys as pc-selection-mode did before 745 ;; normal-erase-is-backspace was invented, to keep us back
744 ;; normal-erase-is-backspace was invented, to keep us back 746 ;; compatible.
745 ;; compatible. 747 (global-set-key [delete] 'delete-char) ; KDelete Del
746 (global-set-key [delete] 'delete-char) ; KDelete Del 748 (define-key function-key-map [M-delete] [?\M-d])
747 (define-key function-key-map [M-delete] [?\M-d]) 749 (global-set-key [C-backspace] 'backward-kill-word))
748 (global-set-key [C-backspace] 'backward-kill-word)) 750 (define-key global-map [S-insert] 'yank)
749 (define-key global-map [S-insert] 'yank) 751 (define-key global-map [C-insert] 'copy-region-as-kill)
750 (define-key global-map [C-insert] 'copy-region-as-kill) 752 (define-key global-map [S-delete] 'kill-region)
751 (define-key global-map [S-delete] 'kill-region) 753
752 754 ;; The following bindings are useful on Sun Type 3 keyboards
753 ;; The following bindings are useful on Sun Type 3 keyboards 755 ;; They implement the Get-Delete-Put (copy-cut-paste)
754 ;; They implement the Get-Delete-Put (copy-cut-paste) 756 ;; functions from sunview on the L6, L8 and L10 keys
755 ;; functions from sunview on the L6, L8 and L10 keys 757 ;; Sam Steingold <sds@gnu.org> says that f16 is copy and f18 is paste.
756 ;; Sam Steingold <sds@gnu.org> says that f16 is copy and f18 is paste. 758 (define-key global-map [f16] 'copy-region-as-kill)
757 (define-key global-map [f16] 'copy-region-as-kill) 759 (define-key global-map [f18] 'yank)
758 (define-key global-map [f18] 'yank) 760 (define-key global-map [f20] 'kill-region)
759 (define-key global-map [f20] 'kill-region) 761
760 762 ;; The following bindings are from Pete Forman.
761 ;; The following bindings are from Pete Forman. 763 (global-set-key [f6] 'other-window) ; KNextPane F6
762 (global-set-key [f6] 'other-window) ; KNextPane F6 764 (global-set-key [C-delete] 'kill-line) ; KEraseEndLine cDel
763 (global-set-key [C-delete] 'kill-line) ; KEraseEndLine cDel 765 (global-set-key "\M-\d" 'undo) ; KUndo aBS
764 (global-set-key "\M-\d" 'undo) ; KUndo aBS 766
765 767 ;; The following binding is taken from pc-mode.el
766 ;; The following binding is taken from pc-mode.el 768 ;; as suggested by RMS.
767 ;; as suggested by RMS. 769 ;; I only used the one that is not covered above.
768 ;; I only used the one that is not covered above. 770 (global-set-key [C-M-delete] 'kill-sexp)
769 (global-set-key [C-M-delete] 'kill-sexp) 771 ;; Next line proposed by Eli Barzilay
770 ;; Next line proposed by Eli Barzilay 772 (global-set-key [C-escape] 'electric-buffer-list))
771 (global-set-key [C-escape] 'electric-buffer-list)))
772 ;; 773 ;;
773 ;; setup 774 ;; setup
774 ;; 775 ;;
775 ;; Next line proposed by Eli Barzilay 776 ;; Next line proposed by Eli Barzilay
776 (setq highlight-nonselected-windows nil) 777 (setq highlight-nonselected-windows nil)
777 (setq transient-mark-mode t) 778 (transient-mark-mode 1)
778 (setq mark-even-if-inactive t) 779 (setq mark-even-if-inactive t)
779 (delete-selection-mode 1) 780 (delete-selection-mode 1))
780)
781 781
782;;;###autoload 782;;;###autoload
783(defcustom pc-selection-mode nil 783(defcustom pc-selection-mode nil