diff options
| -rw-r--r-- | lisp/mouse-sel.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/mouse-sel.el b/lisp/mouse-sel.el index 92e837657f6..57c131d43c1 100644 --- a/lisp/mouse-sel.el +++ b/lisp/mouse-sel.el | |||
| @@ -196,6 +196,9 @@ If nil, point will always be placed at the beginning of the region." | |||
| 196 | 196 | ||
| 197 | ;;=== User Command ======================================================== | 197 | ;;=== User Command ======================================================== |
| 198 | 198 | ||
| 199 | (defvar mouse-sel-has-been-enabled nil | ||
| 200 | "Non-nil if Mouse Sel mode has been enabled at least once.") | ||
| 201 | |||
| 199 | (defvar mouse-sel-original-bindings nil) | 202 | (defvar mouse-sel-original-bindings nil) |
| 200 | (defvar mouse-sel-original-interprogram-cut-function nil) | 203 | (defvar mouse-sel-original-interprogram-cut-function nil) |
| 201 | (defvar mouse-sel-original-interprogram-paste-function nil) | 204 | (defvar mouse-sel-original-interprogram-paste-function nil) |
| @@ -252,7 +255,8 @@ primary selection and region." | |||
| 252 | (setq mouse-sel-original-interprogram-cut-function | 255 | (setq mouse-sel-original-interprogram-cut-function |
| 253 | interprogram-cut-function | 256 | interprogram-cut-function |
| 254 | mouse-sel-original-interprogram-paste-function | 257 | mouse-sel-original-interprogram-paste-function |
| 255 | interprogram-paste-function) | 258 | interprogram-paste-function |
| 259 | mouse-sel-has-been-enabled t) | ||
| 256 | (unless (eq mouse-sel-default-bindings 'interprogram-cut-paste) | 260 | (unless (eq mouse-sel-default-bindings 'interprogram-cut-paste) |
| 257 | (setq interprogram-cut-function nil | 261 | (setq interprogram-cut-function nil |
| 258 | interprogram-paste-function nil)))) | 262 | interprogram-paste-function nil)))) |
| @@ -261,10 +265,11 @@ primary selection and region." | |||
| 261 | (remove-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook) | 265 | (remove-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook) |
| 262 | (dolist (binding mouse-sel-original-bindings) | 266 | (dolist (binding mouse-sel-original-bindings) |
| 263 | (global-set-key (car binding) (cdr binding))) | 267 | (global-set-key (car binding) (cdr binding))) |
| 264 | (setq interprogram-cut-function | 268 | (if mouse-sel-has-been-enabled |
| 265 | mouse-sel-original-interprogram-cut-function | 269 | (setq interprogram-cut-function |
| 266 | interprogram-paste-function | 270 | mouse-sel-original-interprogram-cut-function |
| 267 | mouse-sel-original-interprogram-paste-function))) | 271 | interprogram-paste-function |
| 272 | mouse-sel-original-interprogram-paste-function)))) | ||
| 268 | 273 | ||
| 269 | ;;=== Internal Variables/Constants ======================================== | 274 | ;;=== Internal Variables/Constants ======================================== |
| 270 | 275 | ||