• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/emulation/

Lines Matching +defs:delete +defs:selection +defs:mode

37 ;; This package uses transient-mark-mode and
38 ;; delete-selection-mode.
40 ;; In addition to that all key-bindings from the pc-mode are
45 ;; delete-selection-mode is very important for the look-and-feel.
65 ;; Ok, some details about the idea of PC Selection mode:
76 ;; They will be bound according to the "old" behaviour to S-delete (cut),
92 This variable applies in PC Selection mode only.
100 (defcustom pc-select-selection-keys-only nil
101 "*Non-nil means only bind the basic selection keys when started.
103 This gives mostly Emacs-like behavior with only the selection keys enabled."
112 (defcustom pc-selection-mode-hook nil
113 "The hook to run when pc-selection-mode is toggled."
118 "The values of the variables before PC Selection mode was toggled on.
119 When PC Selection mode is toggled on, it sets quite a few variables
121 variables PC Selection mode had set, so that these variables can be
122 restored to their original values when PC Selection mode is toggled off.")
125 "The keymap used as the global map when PC Selection mode is on." )
128 "The global map that was in effect when PC Selection mode was toggled on.")
131 "This alist holds all the key bindings PC Selection mode sets.")
134 "These key bindings always get set by PC Selection mode.")
138 ;; This is to avoid confusion with the delete-selection-mode
193 "Key bindings to set only if `pc-select-selection-keys-only' is nil.")
202 ([S-delete] . kill-region)
214 ([C-delete] . kill-line) ; KEraseEndLine cDel
217 ;; The following binding is taken from pc-mode.el
220 ([C-M-delete] . kill-sexp)
241 ;; but bind keys as pc-selection-mode did before
245 '(([delete] . delete-char) ; KDelete Del
247 "The list of key bindings controlled by `pc-select-selection-keys-only'.
249 `pc-select-selection-keys-only' is nil.")
251 (defvar pc-select-old-M-delete-binding nil
252 "Holds the old mapping of [M-delete] in the `function-key-map'.
253 This variable holds the value associated with [M-delete] in the
254 `function-key-map' before PC Selection mode had changed that
268 Deactivating mark is to avoid confusion with `delete-selection-mode'
269 and `transient-mark-mode'."
792 (defmacro pc-select-save-and-set-mode (mode &optional arg mode-var)
794 MODE is presumed to be a function which turns on a minor mode. First,
800 (unless mode-var (setq mode-var mode))
801 `(when (fboundp ',mode)
803 ,mode-var ,mode-var)
804 (,mode ,arg)))
815 (defmacro pc-select-restore-mode (mode)
816 "Restore the previous state (either on or off) of the minor mode MODE.
821 `(when (fboundp ',mode)
822 (let ((,elt (assq ',mode pc-select-saved-settings-alist)))
824 (,mode (if (cdr ,elt) 1 -1)))))))
828 (define-minor-mode pc-selection-mode
831 This mode enables Delete Selection mode and Transient Mark mode.
846 turning PC Selection mode on.
867 the variable `pc-select-selection-keys-only' to t after loading pc-select.el
868 but before calling PC Selection mode):
871 DELETE delete-char
877 ;; FIXME: bring pc-bindings-mode here ?
883 (if pc-selection-mode
889 (if pc-select-selection-keys-only
895 (if (or pc-select-selection-keys-only
904 (unless (or pc-select-selection-keys-only
909 (setq pc-select-old-M-delete-binding
910 (lookup-key function-key-map [M-delete]))
911 (define-key function-key-map [M-delete] [?\M-d]))
913 (when (and (not pc-select-selection-keys-only)
916 (fboundp 'normal-erase-is-backspace-mode))
917 (pc-select-save-and-set-mode normal-erase-is-backspace-mode 1
925 (pc-select-save-and-set-var transient-mark-mode t)
927 (pc-select-save-and-set-mode delete-selection-mode 1))
929 ;; If the user turned on pc-selection-mode a second time
931 ;; saved from before pc-selection mode was activated --
935 (unless (or pc-select-selection-keys-only
940 (define-key function-key-map [M-delete] [?\M-d]))
941 (when (and (not pc-select-selection-keys-only)
944 (fboundp 'normal-erase-is-backspace-mode))
945 (normal-erase-is-backspace-mode 1))
947 (setq transient-mark-mode t)
949 (delete-selection-mode 1))
952 (when (and (not pc-select-selection-keys-only)
955 (pc-select-restore-mode normal-erase-is-backspace-mode))
962 (pc-select-restore-var transient-mark-mode)
964 (pc-select-restore-mode delete-selection-mode)
965 (and pc-select-old-M-delete-binding
966 (define-key function-key-map [M-delete]
967 pc-select-old-M-delete-binding))
973 (defcustom pc-selection-mode nil
974 "Toggle PC Selection mode.
977 This mode enables Delete Selection mode and Transient Mark mode.
979 you must modify it using \\[customize] or \\[pc-selection-mode]."
981 (pc-selection-mode (if value 1 -1)))