diff lisp/term/mac-win.el @ 49397:689e43474805

(interprogram-paste-function): Handle empty clipboard.
author John Paul Wallington <jpw@pobox.com>
date Thu, 23 Jan 2003 00:04:20 +0000
parents 1e7527c1a0a0
children 0ffb4e489776
line wrap: on
line diff
--- a/lisp/term/mac-win.el	Wed Jan 22 23:16:41 2003 +0000
+++ b/lisp/term/mac-win.el	Thu Jan 23 00:04:20 2003 +0000
@@ -125,15 +125,16 @@
 ;; mac-paste-function are defined in mac.c.
 (set-selection-coding-system 'compound-text-mac)
 
-(setq interprogram-cut-function 
-      '(lambda (str push) 
+(setq interprogram-cut-function
+      '(lambda (str push)
 	 (mac-cut-function
-	  (encode-coding-string str selection-coding-system t) push))) 
+	  (encode-coding-string str selection-coding-system t) push)))
 
-(setq interprogram-paste-function 
-      '(lambda () 
-	 (decode-coding-string
-	  (mac-paste-function) selection-coding-system t)))
+(setq interprogram-paste-function
+      '(lambda ()
+	 (let ((clipboard (mac-paste-function)))
+	   (if clipboard
+	       (decode-coding-string clipboard selection-coding-system t)))))
 
 (defun mac-drag-n-drop (event)
   "Edit the files listed in the drag-n-drop event.\n\