changeset 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 81f3c177abae
children e84990b6ae01
files lisp/ChangeLog lisp/term/mac-win.el
diffstat 2 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Jan 22 23:16:41 2003 +0000
+++ b/lisp/ChangeLog	Thu Jan 23 00:04:20 2003 +0000
@@ -1,4 +1,9 @@
-2003-01-22    <karl@gnu.org>
+2003-01-23  John Paul Wallington  <jpw@shootybangbang.com>
+
+	* term/mac-win.el (interprogram-paste-function): Handle empty
+	clipboard.
+
+2003-01-22  Karl Berry  <karl@gnu.org>
 
 	* info.el (Info-index): change pattern so that index entries with
 	colons can be read properly; also, require at least one space
--- 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\