;;=== User Command ========================================================
+(defvar mouse-sel-has-been-enabled nil
+ "Non-nil if Mouse Sel mode has been enabled at least once.")
+
(defvar mouse-sel-original-bindings nil)
(defvar mouse-sel-original-interprogram-cut-function nil)
(defvar mouse-sel-original-interprogram-paste-function nil)
(setq mouse-sel-original-interprogram-cut-function
interprogram-cut-function
mouse-sel-original-interprogram-paste-function
- interprogram-paste-function)
+ interprogram-paste-function
+ mouse-sel-has-been-enabled t)
(unless (eq mouse-sel-default-bindings 'interprogram-cut-paste)
(setq interprogram-cut-function nil
interprogram-paste-function nil))))
(remove-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook)
(dolist (binding mouse-sel-original-bindings)
(global-set-key (car binding) (cdr binding)))
- (setq interprogram-cut-function
- mouse-sel-original-interprogram-cut-function
- interprogram-paste-function
- mouse-sel-original-interprogram-paste-function)))
+ (if mouse-sel-has-been-enabled
+ (setq interprogram-cut-function
+ mouse-sel-original-interprogram-cut-function
+ interprogram-paste-function
+ mouse-sel-original-interprogram-paste-function))))
;;=== Internal Variables/Constants ========================================