unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Steven Tamm <steventamm@mac.com>
Cc: emacs-devel ' <emacs-devel@gnu.org>
Subject: Re: Carbon port: setting the creator code (patch)
Date: Fri, 8 Jul 2005 20:04:09 -0700	[thread overview]
Message-ID: <FCD7AFC7-484E-4C3D-979A-86A281540BB6@mac.com> (raw)
In-Reply-To: <14EAA211-1A2F-4534-A504-867C51151104@inf.ed.ac.uk>

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.
>
>
> <mac-set-creator.patch>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2005-07-09  3:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24  9:05 Carbon port: setting the creator code (patch) David Reitter
2005-07-09  3:04 ` Steven Tamm [this message]
2005-07-09  8:11   ` Sébastien Kirche
2005-07-09 13:06   ` David Reitter
2005-07-09 16:08     ` Steven Tamm
2005-07-10  0:56       ` YAMAMOTO Mitsuharu
2005-07-10 11:55         ` David Reitter
2005-07-10 11:16       ` David Reitter
2005-07-10 13:30         ` Benjamin Riefenstahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FCD7AFC7-484E-4C3D-979A-86A281540BB6@mac.com \
    --to=steventamm@mac.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).