From a6127c0f7adaead98330ef97d67606b13bc658fa Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Thu, 23 Jan 2003 00:04:20 +0000 Subject: [PATCH] (interprogram-paste-function): Handle empty clipboard. --- lisp/ChangeLog | 7 ++++++- lisp/term/mac-win.el | 15 ++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df29ecdbb47..0eca76d76e5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,9 @@ -2003-01-22 +2003-01-23 John Paul Wallington + + * term/mac-win.el (interprogram-paste-function): Handle empty + clipboard. + +2003-01-22 Karl Berry * info.el (Info-index): change pattern so that index entries with colons can be read properly; also, require at least one space diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 67fd5102125..22a2e7fab30 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -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\ -- 2.39.2