[OS X Emacs] Re: Switching from Carbon Emacs to Emacs.app
Peter Dyballa
Peter_Dyballa at Web.DE
Fri Jan 11 15:51:24 EST 2008
Am 11.01.2008 um 20:42 schrieb Nathaniel Cunningham:
> I have found it handy to use the RCEnvironment preference pane (
> http://www.rubicode.com/Software/RCEnvironment/ ) to edit
> environment.plist .
You can also use Apple's Property List Editor from the Developer
Tools metapackage (the open or a double-click will load the file). Or
PrefSetter (http://homepage.mac.com/darkshadow02/
apps.htm#prefsetter). Or GNU Emacs:
(add-to-list 'auto-mode-alist '("\\.plist\\'" . visit-bplist))
(add-to-list 'auto-mode-alist '("\\.nib\\'" . visit-bplist))
(defvar plist-converted-binary nil
"Buffer local variable indicating if file came from binary-plist.")
(make-variable-buffer-local 'plist-converted-binary)
(defun visit-bplist ()
(interactive)
(when (string-match "^bplist" (buffer-string))
(message "Reading in binary plist")
(shell-command-on-region
(point-min) (point-max)
(format "plutil -convert xml1 -o /dev/stdout %s"
(shell-quote-argument (buffer-file-name))) t t)
(save-excursion
(goto-char (point-max)) (previous-line 1)
(if (looking-at "/dev/stdout: Operation not supported") (kill-
line 1)))
(xml-mode)
(set-buffer-modified-p nil)
(setq buffer-undo-list nil)
(setq plist-converted-binary t)))
(defadvice save-buffer (after convert-plist (&optional args))
(when plist-converted-binary
(shell-command
(format "plutil -convert binary1 %s"
(shell-quote-argument (buffer-file-name))) nil nil)
(message "Wrote bplist %s" (buffer-file-name))))
(ad-activate 'save-buffer)
This code also works with binary PLIST (property list) files in ~/
Library/Preferences. It's not my code, I found it somewhere ... A bit
of fontification would be fine. RCEnvironment is nice Preferences
Pane, anyway.
From the command line one can use defaults. Or the PLTools (http://
www.macorchard.com/PLTools/).
--
Greetings
Pete
I hope to die before I *have* to use Microsoft Word.
- Donald E. Knuth, 2001-10-02 in Tübingen.
More information about the MacOSX-Emacs
mailing list