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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Harald Hanche-Olsen <hanche@HIDDEN>; merged with #3963, #9135; dated Tue, 18 Nov 2008 09:40:04 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 1367 3963 9135. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to `wishlist' from `normal' Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.2 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1367) by emacsbugs.donarmstrong.com; 22 Nov 2008 02:51:26 +0000
Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAM2pNhN002389
	for <1367@HIDDEN>; Fri, 21 Nov 2008 18:51:24 -0800
Received: by yx-out-2324.google.com with SMTP id 8so576680yxg.31
        for <1367@HIDDEN>; Fri, 21 Nov 2008 18:51:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:cc:message-id:from:to
         :in-reply-to:content-type:content-transfer-encoding:mime-version
         :subject:date:references:x-mailer;
        bh=6+1s64i/6/4CGkb0HUtZOLRn0gsDFu6ERNMiI6zH2ZU=;
        b=JyumcqlxnynHG9vKWyOCWXEIo5va3vbpbNdoKzLbGcPGM9fRj4ekMGO3hl2TtXB4XO
         b2fDnQeiWcCc23UbT7c0SnRUPKIRIl0Mde8M1FyVVdVm6zjSsQK4FvnDIRwXM7/LXQlo
         c5Rpgh/677NHZRJ3e+h0TY8M21ALaEGJkFKZk=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=cc:message-id:from:to:in-reply-to:content-type
         :content-transfer-encoding:mime-version:subject:date:references
         :x-mailer;
        b=xjfxENQywVbczdIwTDc2K4XSvEs4NOKtObJ1AyxNjvCcu03H3kjCMcrumuzqEtPDIb
         pAWsH9AP77zeLqP1/Mt1r6UmOUtEqdIlctMJnKl0qkX5qIpAUTiKtxnf9KpptZDowJH/
         EeY4Vd4gRbr9Y25iBAH9/gCDN9YNygLa94ORA=
Received: by 10.151.10.7 with SMTP id n7mr2172828ybi.53.1227322282712;
        Fri, 21 Nov 2008 18:51:22 -0800 (PST)
Received: from ?10.0.1.199? ([72.169.150.82])
        by mx.google.com with ESMTPS id 30sm2313749yxk.4.2008.11.21.18.51.14
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Fri, 21 Nov 2008 18:51:21 -0800 (PST)
Cc: 1367 <at> debbugs.gnu.org, Harald Hanche-Olsen <hanche@HIDDEN>
Message-Id: <80FAE9B8-A93C-4AC9-9720-EA407A793913@HIDDEN>
From: Adrian Robert <adrian.b.robert@HIDDEN>
To: YAMAMOTO Mitsuharu <mituharu@HIDDEN>
In-Reply-To: <wlhc60ilti.wl%mituharu@HIDDEN>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v929.2)
Subject: Re: bug#1367: #1367 - 23.0.60;	Mailto service won't work - Emacs bug report logs
Date: Fri, 21 Nov 2008 21:51:01 -0500
References: <9195CB25-E9D7-4C36-99BA-D59160AAB662@HIDDEN> <wlhc60ilti.wl%mituharu@HIDDEN>
X-Mailer: Apple Mail (2.929.2)


On Nov 21, 2008, at 8:36 PM, YAMAMOTO Mitsuharu wrote:

>>>>>> On Fri, 21 Nov 2008 16:00:47 -0500, Adrian Robert <adrian.b.robert@HIDDEN 
>>>>>> > 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:

Thanks.. right, I meant "parse Apple Events" -- basically a property  
list, but I've seen some pretty voluminous code to do this, and you  
need to know some agreed conventions.  In this case though, as you  
say, this gets handled under a standardized "GetURL" pattern, and it  
appears from the docs you cite that Cocoa does most of the actual  
parsing.

Now the main decision is whether to go for a general AE facility, or  
just implement a kAEGetURL handler.

thanks,
Adrian






Acknowledgement sent to Adrian Robert <adrian.b.robert@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>, don@HIDDEN. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>, don@HIDDEN:
bug#1367; Package emacs,ns. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.8 required=4.0 tests=AWL,BAYES_00,FOURLA,GMAIL,
	HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1367) by emacsbugs.donarmstrong.com; 22 Nov 2008 01:36:14 +0000
Received: from mathmail.math.s.chiba-u.ac.jp (ntp.math.s.chiba-u.ac.jp [133.82.132.2])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAM1aAOp015020
	for <1367@HIDDEN>; Fri, 21 Nov 2008 17:36:12 -0800
Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36])
	by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 596FC2C45;
	Sat, 22 Nov 2008 10:36:09 +0900 (JST)
Date: Sat, 22 Nov 2008 10:36:09 +0900
Message-ID: <wlhc60ilti.wl%mituharu@HIDDEN>
From: YAMAMOTO Mitsuharu <mituharu@HIDDEN>
To: Adrian Robert <adrian.b.robert@HIDDEN>, 1367 <at> debbugs.gnu.org
Cc: Harald Hanche-Olsen <hanche@HIDDEN>
Subject: Re: bug#1367: #1367 - 23.0.60;	Mailto service won't work - Emacs bug report logs
In-Reply-To: <9195CB25-E9D7-4C36-99BA-D59160AAB662@HIDDEN>
References: <9195CB25-E9D7-4C36-99BA-D59160AAB662@HIDDEN>
User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8
 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8)
 MULE/5.0 (SAKAKI)
Organization: Faculty of Science, Chiba University
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
Content-Type: text/plain; charset=US-ASCII

>>>>> On Fri, 21 Nov 2008 16:00:47 -0500, Adrian Robert <adrian.b.robert@HIDDEN> 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@HIDDEN




Acknowledgement sent to YAMAMOTO Mitsuharu <mituharu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>, don@HIDDEN. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>, don@HIDDEN:
bug#1367; Package emacs,ns. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-4.2 required=4.0 tests=AWL,BAYES_00,FOURLA
	autolearn=no version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1367) by emacsbugs.donarmstrong.com; 21 Nov 2008 21:01:11 +0000
Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mALL17PJ005874
	for <1367@HIDDEN>; Fri, 21 Nov 2008 13:01:08 -0800
Received: by yx-out-2324.google.com with SMTP id 8so536812yxg.31
        for <1367@HIDDEN>; Fri, 21 Nov 2008 13:01:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:to:content-type
         :content-transfer-encoding:mime-version:subject:date:cc:x-mailer
         :from;
        bh=GmcLiegR39y03PB9RmT0wU4vzc1qlxVKJ25roIxP3XQ=;
        b=kD97xSm7P7/y+o/YANGjQ2bSYsuPmK5uEZj2oIftj68farfRP6OOcC6MhSXcOUNcSO
         pzmGOB8/LF9AzUHECcKRqc3cFjYuJOJKOzRpLXr++OvOMn65sH0lr8VIJrLzU6D3OXAd
         6fYfXd8VMZ7ZMhUW6Dk+8uvaZj4yXQlEQpwRI=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:to:content-type:content-transfer-encoding:mime-version
         :subject:date:cc:x-mailer:from;
        b=YNlCD86noMZ+bB6fptQF+QzfO9ySoYOm47wprn6Y5xam93/kiJcxAnU5HLp9aEEtFo
         YdWFi8n0h5l8PAGoDbO+x8MTbCxYrptoWzrbmMGpon8O5jSFQWENQc876VMsVg8xDN8Y
         NjuY/UjzKJxmZjT2qXXIO3epLbY5SY+GlH8VA=
Received: by 10.151.103.2 with SMTP id f2mr1640483ybm.121.1227301267108;
        Fri, 21 Nov 2008 13:01:07 -0800 (PST)
Received: from ?10.0.1.199? ([72.169.150.82])
        by mx.google.com with ESMTPS id r28sm3888879ele.16.2008.11.21.13.00.59
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Fri, 21 Nov 2008 13:01:06 -0800 (PST)
Message-Id: <9195CB25-E9D7-4C36-99BA-D59160AAB662@HIDDEN>
To: 1367 <at> debbugs.gnu.org
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v929.2)
Subject: #1367 - 23.0.60; Mailto service won't work - Emacs bug report logs
Date: Fri, 21 Nov 2008 16:00:47 -0500
Cc: Harald Hanche-Olsen <hanche@HIDDEN>
X-Mailer: Apple Mail (2.929.2)
From: Adrian Robert <adrian.b.robert@HIDDEN>

Hello,

> I have set the mailto handler to be emacs. If I run the command open mailto:joe.the-plumber@HIDDEN
> ...
>
> At the very least, I would have expected a <ns-spi-service-call>  
> event to be generated

I am unsure about how mailto: works.  However, ns-spi-service-call is  
only generated when items under the "Emacs.app" heading in the  
Services menu are called.  If the mailto: mapping you describe should  
do this (I don't readily see how), then there is a bug.

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.)

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.

-Adrian





Acknowledgement sent to Adrian Robert <adrian.b.robert@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>, don@HIDDEN. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>, don@HIDDEN:
bug#1367; Package emacs,ns. Full text available.
bug reassigned from package `emacs' to `emacs,ns'. Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-7.0 required=4.0 tests=AWL,BAYES_00,FOURLA,
	RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 18 Nov 2008 09:30:43 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAI9UeHw032736
	for <submit@HIDDEN>; Tue, 18 Nov 2008 01:30:41 -0800
Received: from mx10.gnu.org ([199.232.76.166]:57690)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <hanche+bounces@HIDDEN>)
	id 1L2Mum-0002F9-S6
	for emacs-pretest-bug@HIDDEN; Tue, 18 Nov 2008 04:30:32 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <hanche+bounces@HIDDEN>)
	id 1L2Mus-0005AK-Vv
	for emacs-pretest-bug@HIDDEN; Tue, 18 Nov 2008 04:30:39 -0500
Received: from abel.math.ntnu.no ([129.241.15.50]:57914)
	by monty-python.gnu.org with smtp (Exim 4.60)
	(envelope-from <hanche+bounces@HIDDEN>)
	id 1L2Mus-0005A2-Bp
	for emacs-pretest-bug@HIDDEN; Tue, 18 Nov 2008 04:30:38 -0500
Received: (qmail 15361 invoked from network); 18 Nov 2008 09:30:34 -0000
Received: from gauss.math.ntnu.no (HELO localhost) (hanche@HIDDEN)
  by abel.math.ntnu.no with ESMTPA; 18 Nov 2008 09:30:34 -0000
Date: Tue, 18 Nov 2008 10:30:33 +0100 (CET)
Message-Id: <20081118.103033.72184828.hanche@HIDDEN>
To: emacs-pretest-bug@HIDDEN
Subject: 23.0.60; Mailto service won't work
From: Harald Hanche-Olsen <hanche@HIDDEN>
X-URL: http://www.math.ntnu.no/~hanche/
X-Mailer: Mew version 6.1.51 on Emacs 23.0.60 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1)

I have set the mailto handler to be emacs. If I run the command

open mailto:joe.the-plumber@HIDDEN

in a terminal (or click on a mailto link in firefox), emacs is
activated (i.e., it comes to the foreground), but nothing else
happens.

At the very least, I would have expected a <ns-spi-service-call> event
to be generated, but C-h l shows no such event. (In contrast, dragging
selected text from a terminal window onto emacs works as expected, and
leaves <ns-drag-text> in the event history.)

In GNU Emacs 23.0.60.1 (powerpc-apple-darwin9.5.0, NS apple-appkit-949.35)
 of 2008-11-14 on macknife
Windowing system distributor `Apple', version 97.112.112.108.101.45.97.112.112.107.105.116.45.57.52.57.46.51.53
configured using `configure  '--with-ns' '--without-x''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
(irrelevant, apart from the missing <ns-spi-service-call>)






Acknowledgement sent to Harald Hanche-Olsen <hanche@HIDDEN>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1367; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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