GNU bug report logs - #1367
23.0.60; Mailto service won't work

Previous Next

Package: emacs;

Reported by: Harald Hanche-Olsen <hanche <at> math.ntnu.no>

Date: Tue, 18 Nov 2008 09:40:04 UTC

Severity: wishlist

Merged with 3963, 9135

Found in version 24.0.50

Full log


View this message in rfc822 format

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Adrian Robert <adrian.b.robert <at> gmail.com>, 1367 <at> debbugs.gnu.org
Cc: Harald Hanche-Olsen <hanche <at> math.ntnu.no>
Subject: bug#1367: #1367 - 23.0.60;	Mailto service won't work - Emacs bug report logs
Date: Sat, 22 Nov 2008 10:36:09 +0900
>>>>> On Fri, 21 Nov 2008 16:00:47 -0500, Adrian Robert <adrian.b.robert <at> gmail.com> said:

> On the other hand, if the mailto: mapping results in some random
> applescript command being sent to Emacs, then what is needed is an
> enhancement.  I am unfamiliar with how standardized the various
> applescript things a well-behaved OS X application should respond to
> is.  Is there documentation on this somewhere?  Also, I don't know
> if you are familiar with Cocoa programming, but I wonder if there is
> an NSApp delegate method or a notification that could be registered
> for, avoiding the need to parse applescript.  (This is the way,
> e.g., double-clicking associated files in the Finder can open them
> in Emacs.app.)

You don't need to "parse" AppleScript.  What Carbon or Cocoa
applications receive is an Apple event:

  http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_handle_AEs/chapter_11_section_4.html

Core functionalities such as "open documents" and "quit application"
also send some corresponding Apple events, and Cocoa applications
usually handle them via some application delegate methods.

  http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_handle_AEs/chapter_11_section_3.html

> The Carbon port of emacs did do applescript parsing, but I was never
> convinced that it was sufficiently "core" functionality to bring to
> the Cocoa port (given the bloat involved).  Though nowadays with
> DBUS in the X11 emacs the case is more compelling.

Unlike Cocoa, Carbon applications need to handle the "core
functionalities" via Apple event handers.  In the original Carbon
Emacs by Andrew Choi, the handlers were hard-coded C routines.  I
lifted them to the Lisp-level so I can provide graceful termination(*)
in response to the "quit application" event.  The mailto: URL support
via "get URL" handler in the Carbon port is a bonus that came for free
by its general Lisp-level Apple event handling mechanism.

(*) If you try logout/shutdown/reboot while leaving a file-visiting
    buffer modified and unsaved, a popup window appears for
    confirmation.  If you cancel the termination of Emacs, the whole
    logout/shutdown/reboot process is also canceled immediately.

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp




This bug report was last modified 3 years and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.