From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steven Tamm Newsgroups: gmane.emacs.devel Subject: Re: Carbon port: setting the creator code (patch) Date: Fri, 8 Jul 2005 20:04:09 -0700 Message-ID: References: <14EAA211-1A2F-4534-A504-867C51151104@inf.ed.ac.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v730) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1120879856 20333 80.91.229.2 (9 Jul 2005 03:30:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Jul 2005 03:30:56 +0000 (UTC) Cc: emacs-devel ' Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 09 05:30:53 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dr632-0000LA-Tc for ged-emacs-devel@m.gmane.org; Sat, 09 Jul 2005 05:30:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dr64U-00021r-FQ for ged-emacs-devel@m.gmane.org; Fri, 08 Jul 2005 23:32:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dr61q-00018G-ST for emacs-devel@gnu.org; Fri, 08 Jul 2005 23:29:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dr61l-000150-BQ for emacs-devel@gnu.org; Fri, 08 Jul 2005 23:29:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dr61h-0000sp-Gi for emacs-devel@gnu.org; Fri, 08 Jul 2005 23:29:13 -0400 Original-Received: from [17.250.248.84] (helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dr5kX-0000yN-Ij for emacs-devel@gnu.org; Fri, 08 Jul 2005 23:11:29 -0400 Original-Received: from mac.com (smtpin01-en2 [10.13.10.146]) by smtpout.mac.com (Xserve/8.12.11/smtpout08/MantshX 4.0) with ESMTP id j6934O5b028848; Fri, 8 Jul 2005 20:04:24 -0700 (PDT) Original-Received: from [10.0.1.201] ([67.174.235.79]) (authenticated bits=0) by mac.com (Xserve/smtpin01/MantshX 4.0) with ESMTP id j6934ITX025404; Fri, 8 Jul 2005 20:04:19 -0700 (PDT) In-Reply-To: <14EAA211-1A2F-4534-A504-867C51151104@inf.ed.ac.uk> Original-To: David Reitter X-Mailer: Apple Mail (2.730) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:40670 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40670 Sorry for the delay in reply, but it seems to me that using SetFile would be easier, and more flexible. (defun mac-set-creator-code-for-file () (call-process shell-file-name nil nil t shell-command-switch (concat "/Developer/Tools/SetFile -c EMAx " buffer-file-name)) ) (add-hook 'after-save-hook 'mac-set-creator-code-for-file) -Steven On Jun 24, 2005, at 2:05 AM, David Reitter wrote: > I'm posting some code that introduces a function "mac-set-creator" > in the Mac (Carbon) port. The function sets the creator code > (metadata information) of a file to 'EMAx'. That enables > LaunchServices to start up Emacs whenever the file is double-clicked. > > In the Aquamacs distribution, I use it as follows: > > (defun mac-set-creator-code-for-file () > (if (and aquamacs-set-creator-codes-after-writing-files > buffer-file-name > (fboundp 'mac-set-creator) > ) > (mac-set-creator buffer-file-name) > ) > ) > > (add-hook 'after-save-hook 'mac-set-creator-code-for-file) > > This contains some free code from Apple. > > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel