>>>>> On Mon, 11 Apr 2005 19:46:26 +0900, YAMAMOTO Mitsuharu <[EMAIL >>>>> PROTECTED]> said:
> Selection data types and scrap flavor types are related in a similar > way: > (put 'mac-TEXT 'mac-scrap-flavor-type "TEXT") > (put 'mac-UNICODE 'mac-scrap-flavor-type "utxt") On second thought, I think I'd like to use UTIs (Uniform Type Identifiers, http://developer.apple.com/qa/qa2005/qa1406.html) rather than inventing new names. (put 'com.apple.traditional-mac-plain-text 'mac-scrap-flavor-type "TEXT") (put 'public.utf16-plain-text 'mac-scrap-flavor-type "utxt") But it may not be good to use `.' as a part of a Lisp symbol name (its printed representation prepends `\'), so I'd like to ask opinions about that. I personally don't care that much. By the way, TIFF images can be pasted from the clipboard using the code below :-) (with the previously posted patch, of course) YAMAMOTO Mitsuharu [EMAIL PROTECTED] (put 'com.apple.traditional-mac-plain-text 'mac-scrap-flavor-type "TEXT") (put 'public.utf16-plain-text 'mac-scrap-flavor-type "utxt") (put 'public.tiff 'mac-scrap-flavor-type "TIFF") (setq selection-converter-alist (nconc '((public.utf16-plain-text . mac-select-convert-to-string) (com.apple.traditional-mac-plain-text . mac-select-convert-to-string) (public.tiff . ignore)) selection-converter-alist)) (defun x-selection-value (type) (let (text tiff-image) (setq text (condition-case nil (x-get-selection type 'public.utf16-plain-text) (error nil))) (if (not text) (setq text (condition-case nil (x-get-selection type 'com.apple.traditional-mac-plain-text) (error nil)))) (if text (remove-text-properties 0 (length text) '(foreign-selection nil) text)) (setq tiff-image (condition-case nil (x-get-selection type 'public.tiff) (error nil))) (when tiff-image (remove-text-properties 0 (length tiff-image) '(foreign-selection nil) tiff-image) (setq tiff-image (create-image tiff-image 'tiff t)) (or text (setq text " ")) (put-text-property 0 (length text) 'display tiff-image text)) text)) _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel