Function: pc-selection-mode
pc-selection-mode is an interactive and byte-compiled function defined
in pc-select.el.gz.
This command is obsolete since 24.1; use delete-selection-mode(var)/delete-selection-mode(fun)
instead.
Signature
(pc-selection-mode &optional ARG)
Documentation
Change mark behavior to emulate Motif, Mac or MS-Windows cut and paste style.
This is a minor mode. If called interactively, toggle the
Pc-Selection mode mode. If the prefix argument is positive, enable
the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the
mode if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate (default-value \=pc-selection-mode)'.
The mode's hook is called both when the mode is enabled and when it is disabled.
This mode enables Delete Selection mode and Transient Mark mode.
The arrow keys (and others) are bound to new functions which modify the status of the mark.
The ordinary arrow keys disable the mark. The shift-arrow keys move, leaving the mark behind.
C-LEFT and C-RIGHT move back or forward one word, disabling the mark. S-C-LEFT and S-C-RIGHT move back or forward one word, leaving the mark behind.
M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark.
S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark
behind. To control whether these keys move word-wise or sexp-wise set the
variable pc-select-meta-moves-sexps after loading pc-select.el but before
turning PC Selection mode on.
C-DOWN and C-UP move back or forward a paragraph, disabling the mark. S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind.
HOME moves to beginning of line, disabling the mark. S-HOME moves to beginning of line, leaving the mark behind. With Ctrl or Meta, these keys move to beginning of buffer instead.
END moves to end of line, disabling the mark. S-END moves to end of line, leaving the mark behind. With Ctrl or Meta, these keys move to end of buffer instead.
PRIOR or PAGE-UP scrolls and disables the mark. S-PRIOR or S-PAGE-UP scrolls and leaves the mark behind.
S-DELETE kills the region (kill-region).
S-INSERT yanks text from the kill ring (yank).
C-INSERT copies the region into the kill ring (copy-region-as-kill).
In addition, certain other PC bindings are imitated (to avoid this, set
the variable pc-select-selection-keys-only to t after loading pc-select.el
but before calling PC Selection mode):
F6 other-window
DELETE delete-char
C-DELETE kill-line
M-DELETE kill-word
C-M-DELETE kill-sexp
C-BACKSPACE backward-kill-word
M-BACKSPACE undo
Probably introduced at or before Emacs version 22.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/pc-select.el.gz
;;;###autoload
(define-minor-mode pc-selection-mode
"Change mark behavior to emulate Motif, Mac or MS-Windows cut and paste style.
This mode enables Delete Selection mode and Transient Mark mode.
The arrow keys (and others) are bound to new functions
which modify the status of the mark.
The ordinary arrow keys disable the mark.
The shift-arrow keys move, leaving the mark behind.
C-LEFT and C-RIGHT move back or forward one word, disabling the mark.
S-C-LEFT and S-C-RIGHT move back or forward one word, leaving the mark behind.
M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark.
S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark
behind. To control whether these keys move word-wise or sexp-wise set the
variable `pc-select-meta-moves-sexps' after loading pc-select.el but before
turning PC Selection mode on.
C-DOWN and C-UP move back or forward a paragraph, disabling the mark.
S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind.
HOME moves to beginning of line, disabling the mark.
S-HOME moves to beginning of line, leaving the mark behind.
With Ctrl or Meta, these keys move to beginning of buffer instead.
END moves to end of line, disabling the mark.
S-END moves to end of line, leaving the mark behind.
With Ctrl or Meta, these keys move to end of buffer instead.
PRIOR or PAGE-UP scrolls and disables the mark.
S-PRIOR or S-PAGE-UP scrolls and leaves the mark behind.
S-DELETE kills the region (`kill-region').
S-INSERT yanks text from the kill ring (`yank').
C-INSERT copies the region into the kill ring (`copy-region-as-kill').
In addition, certain other PC bindings are imitated (to avoid this, set
the variable `pc-select-selection-keys-only' to t after loading pc-select.el
but before calling PC Selection mode):
F6 other-window
DELETE delete-char
C-DELETE kill-line
M-DELETE kill-word
C-M-DELETE kill-sexp
C-BACKSPACE backward-kill-word
M-BACKSPACE undo"
;; FIXME: bring pc-bindings-mode here ?
:global t
(if pc-selection-mode
(if (null pc-select-key-bindings-alist)
(progn
(setq pc-select-saved-global-map (copy-keymap (current-global-map)))
(setq pc-select-key-bindings-alist
(append pc-select-default-key-bindings
(if pc-select-selection-keys-only
nil
pc-select-extra-key-bindings)
(if pc-select-meta-moves-sexps
(car pc-select-meta-moves-sexps-key-bindings)
(cadr pc-select-meta-moves-sexps-key-bindings))
(if (or pc-select-selection-keys-only
(eq window-system 'x)
(memq system-type '(ms-dos windows-nt)))
nil
pc-select-tty-key-bindings)))
(pc-select-define-keys pc-select-key-bindings-alist
(current-global-map))
(unless (or pc-select-selection-keys-only
(eq window-system 'x)
(memq system-type '(ms-dos windows-nt)))
;; it is not clear that we need the following line
;; I hope it doesn't do too much harm to leave it in, though...
(setq pc-select-old-M-delete-binding
(lookup-key function-key-map [M-delete]))
(define-key function-key-map [M-delete] [?\M-d]))
(when (and (not pc-select-selection-keys-only)
(or (eq window-system 'x)
(memq system-type '(ms-dos windows-nt)))
(fboundp 'normal-erase-is-backspace-mode))
(pc-select-save-and-set-mode normal-erase-is-backspace-mode 1
normal-erase-is-backspace))
;; the original author also had this above:
;; (setq-default normal-erase-is-backspace t)
;; However, the documentation for the variable says that
;; "setting it with setq has no effect", so I'm removing it.
(pc-select-save-and-set-var highlight-nonselected-windows nil)
(pc-select-save-and-set-var transient-mark-mode t)
(pc-select-save-and-set-var shift-select-mode t)
(pc-select-save-and-set-var mark-even-if-inactive t)
(pc-select-save-and-set-mode delete-selection-mode 1))
;;else
;; If the user turned on pc-selection-mode a second time
;; do not clobber the values of the variables that were
;; saved from before pc-selection mode was activated --
;; just make sure the values are the way we like them.
(pc-select-define-keys pc-select-key-bindings-alist
(current-global-map))
(unless (or pc-select-selection-keys-only
(eq window-system 'x)
(memq system-type '(ms-dos windows-nt)))
;; it is not clear that we need the following line
;; I hope it doesn't do too much harm to leave it in, though...
(define-key function-key-map [M-delete] [?\M-d]))
(when (and (not pc-select-selection-keys-only)
(or (eq window-system 'x)
(memq system-type '(ms-dos windows-nt)))
(fboundp 'normal-erase-is-backspace-mode))
(normal-erase-is-backspace-mode 1))
(setq highlight-nonselected-windows nil)
(transient-mark-mode 1)
(setq mark-even-if-inactive t)
(delete-selection-mode 1))
;;else
(when pc-select-key-bindings-alist
(when (and (not pc-select-selection-keys-only)
(or (eq window-system 'x)
(memq system-type '(ms-dos windows-nt))))
(pc-select-restore-mode normal-erase-is-backspace-mode))
(pc-select-restore-keys
pc-select-key-bindings-alist (current-global-map)
pc-select-saved-global-map)
(pc-select-restore-var highlight-nonselected-windows)
(pc-select-restore-var transient-mark-mode)
(pc-select-restore-var shift-select-mode)
(pc-select-restore-var mark-even-if-inactive)
(pc-select-restore-mode delete-selection-mode)
(and pc-select-old-M-delete-binding
(define-key function-key-map [M-delete]
pc-select-old-M-delete-binding))
(setq pc-select-key-bindings-alist nil
pc-select-saved-settings-alist nil))))