comparison 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
comparison
equal deleted inserted replaced
49396:81f3c177abae 49397:689e43474805
123 123
124 ;; Setup to use the Mac clipboard. The functions mac-cut-function and 124 ;; Setup to use the Mac clipboard. The functions mac-cut-function and
125 ;; mac-paste-function are defined in mac.c. 125 ;; mac-paste-function are defined in mac.c.
126 (set-selection-coding-system 'compound-text-mac) 126 (set-selection-coding-system 'compound-text-mac)
127 127
128 (setq interprogram-cut-function 128 (setq interprogram-cut-function
129 '(lambda (str push) 129 '(lambda (str push)
130 (mac-cut-function 130 (mac-cut-function
131 (encode-coding-string str selection-coding-system t) push))) 131 (encode-coding-string str selection-coding-system t) push)))
132 132
133 (setq interprogram-paste-function 133 (setq interprogram-paste-function
134 '(lambda () 134 '(lambda ()
135 (decode-coding-string 135 (let ((clipboard (mac-paste-function)))
136 (mac-paste-function) selection-coding-system t))) 136 (if clipboard
137 (decode-coding-string clipboard selection-coding-system t)))))
137 138
138 (defun mac-drag-n-drop (event) 139 (defun mac-drag-n-drop (event)
139 "Edit the files listed in the drag-n-drop event.\n\ 140 "Edit the files listed in the drag-n-drop event.\n\
140 Switch to a buffer editing the last file dropped." 141 Switch to a buffer editing the last file dropped."
141 (interactive "e") 142 (interactive "e")