>>>>> On Mon, 27 Jun 2005 19:00:16 -0700, "Sean O'Rourke" said: > I've got Emacs directly accepting URLs locally, and I've been > meaning to contribute it when I get some time (unless someone beats > me to it). Unfortunately, it's tangled with my local drag-n-drop > changes, which need some work to better cooperate with X DnD. How about the attached patch? It enables us to register Apple event handlers at the Lisp level as follows: (the code is included in the patch) (put 'internet-event 'mac-apple-event-class "GURL") (put 'get-url 'mac-apple-event-id "GURL") (defun mac-ae-get-url (event) (interactive "e") (let* ((ae (mac-event-ae event)) (parsed-url (url-generic-parse-url (mac-ae-text ae)))) (if (string= (url-type parsed-url) "mailto") (url-mailto parsed-url) (error "Unsupported URL scheme: %s" (url-type parsed-url))))) (define-key mac-apple-event-map [internet-event get-url] 'mac-ae-get-url) Then Emacs can receive kAEInternetEventClass/kAEGetURL Apple events as in the following form, and it is handled by the command `mac-ae-get-url' above. (mac-apple-event [internet-event get-url] ("aevt" ("----" "TEXT" . "mailto:mituharu@math.s.chiba-u.ac.jp?In-Reply-To=wl8y0tjuti.wl%25mituharu%40math.s.chiba-u.ac.jp&Subject=Re%3A%20OS%20X%3A%20using%20emacs%20as%20default%20mailer%3F"))) The patch is also trying to avoid Lisp object allocations (with respect to Apple events) during asynchronous input handling. http://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01457.html YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp