]> git.eshelyaron.com Git - emacs.git/commitdiff
(mouse-sel-bindings): Save/restore interprogram cut/paste functions.
authorMike Williams <mdub@bigfoot.com>
Mon, 15 Jul 2002 11:49:37 +0000 (11:49 +0000)
committerMike Williams <mdub@bigfoot.com>
Mon, 15 Jul 2002 11:49:37 +0000 (11:49 +0000)
lisp/ChangeLog
lisp/mouse-sel.el

index dc36784be618dd0355638202307ddd384994d28f..e8f9e11a7190cf59881fea946b17927ba2d9f0f0 100644 (file)
@@ -1,8 +1,11 @@
+2002-07-15  Mike Williams  <mdub@bigfoot.com>
+
+       * mouse-sel.el (mouse-sel-bindings): Save/restore interprogram
+       cut/paste functions.
+
 2002-07-14  Mike Williams  <mdub@bigfoot.com>
 
        * mouse-sel.el (mouse-sel-bound-events): New constant.
-       (mouse-sel-save-original-bindings): New function.
-       (mouse-sel-restore-original-bindings): New function.
        (mouse-sel-bindings): Save/restore original mouse-bindings.
 
 2002-07-13  Stefan Monnier  <monnier@cs.yale.edu>
index 25fdc92b2962aa8500d5c04ba673df36da23365a..004b6cbf718ea3432ed78fa7ff124dccf17a82e9 100644 (file)
@@ -240,25 +240,6 @@ primary selection and region."
     [M-down-mouse-3] [M-mouse-3])
   "A list of events that mouse-sel binds.")
 
-(defun mouse-sel-save-original-bindings ()
-  "Save the current bindings for `mouse-sel-bound-events'."
-  (setq mouse-sel-original-bindings nil)
-  (mapc (function 
-         (lambda (event)
-           (setq mouse-sel-original-bindings
-                 (cons (cons event (lookup-key global-map event))
-                       mouse-sel-original-bindings))))
-        mouse-sel-bound-events))
-
-(defun mouse-sel-restore-original-bindings ()
-  "Restore the original bindings for `mouse-sel-bound-events'."
-  (mapc (function 
-         (lambda (binding)
-           (if (cdr binding)
-               (global-set-key (car binding) (cdr binding))
-             (global-unset-key (car binding)))))
-        mouse-sel-original-bindings))
-
 (defun mouse-sel-bindings (bind)
   (cond 
 
@@ -266,8 +247,18 @@ primary selection and region."
    ((and bind mouse-sel-default-bindings) 
 
     ;; Save original bindings
-    (mouse-sel-save-original-bindings)
-
+    (setq mouse-sel-original-bindings nil)
+    (mapc (function 
+           (lambda (event)
+             (setq mouse-sel-original-bindings
+                   (cons (cons event (lookup-key global-map event))
+                         mouse-sel-original-bindings))))
+          mouse-sel-bound-events)
+    (setq mouse-sel-original-interprogram-cut-function 
+          interprogram-cut-function
+          mouse-sel-original-interprogram-paste-function
+          interprogram-paste-function)
+    
     ;; Primary selection bindings.
     ;;
     ;; Bind keys to `ignore' instead of unsetting them because
@@ -295,8 +286,17 @@ primary selection and region."
    
    ((not bind)
     ;; Restore original bindings
-    (mouse-sel-restore-original-bindings))
-
+    (mapc (function 
+           (lambda (binding)
+             (if (cdr binding)
+                 (global-set-key (car binding) (cdr binding))
+               (global-unset-key (car binding)))))
+          mouse-sel-original-bindings)
+    (setq interprogram-cut-function 
+          mouse-sel-original-interprogram-cut-function
+          interprogram-paste-function
+          mouse-sel-original-interprogram-paste-function))
+   
    ))
 
 ;;=== Command Variable ====================================================