{"id":59,"date":"2007-10-22T16:50:32","date_gmt":"2007-10-23T00:50:32","guid":{"rendered":"http:\/\/www.muzeo.com\/wp\/2007\/10\/22\/mac-emacs\/"},"modified":"2007-10-22T16:50:32","modified_gmt":"2007-10-23T00:50:32","slug":"mac-emacs","status":"publish","type":"post","link":"https:\/\/www.aye0.com\/darmablog\/mac-emacs\/","title":{"rendered":"mac emacs"},"content":{"rendered":"<p>I&#8217;m glad that MacOSX is unix-based, but it still hides too much of the guts, making it harder than necessary to accomplish  essential technical activities. \u00a0My first home computer was a Mac (actually, one of the first off the assembly line, with the signatures of team inside of the case &#8212; I recall being a guest on &#8220;Computer Chronicles&#8221; showing off B&#038;W image capture w\/ KoalaVision).  But at\u00a0work, and for any serious web programming, I&#8217;ve\u00a0been\u00a0using\u00a0Linux\u00a0(both SuSe and RedHat) as my platform of choice for\u00a0maybe 5 years now, mostly as a foundation for XEmacs. \u00a0But with all the problems in interfacing with an increasing Micro$oft hegemony, we&#8217;ve reluctently decided to switch to Mac at work too, especially since I <em>should<\/em> still have access to most of the same *nix tools, n&#8217;est pas?<\/p>\n<p><!--more--><\/p>\n<p>Well, it turns out that XEmacs is hopelessly broken\u00a0on\u00a0the\u00a0Mac (it builds alright, but soon crashes and is irretreivably corrupted evermore). \u00a0But\u00a0then there&#8217;s <a href=\"http:\/\/homepage.mac.com\/zenitani\/emacs-e.html\">Carbon Emacs<\/a> which, while missing some of the cools XEmacs features like packages, graphics capability, and improved (I think) menu organization, seems to work pretty\u00a0darned well, and quickly to boot.<\/p>\n<p>Unfortunately, trying to replicate my\u00a0old linux configuration was a real hassle. \u00a0First, my lovingly-crafted-over-a-decade custom.el file was almost completely incompatible with gnu emacs syntax, so I\u00a0had\u00a0to\u00a0basically roll a new one from scratch. \u00a0Missing are all the little tweaks that made life easier, but I expect they will be reimplemented soon.<\/p>\n<p>But things really got hairy after I had installed XSlide. \u00a0Ittook several days\u00a0to\u00a0discover that applications on the Mac don&#8217;t inherit environment variables the way they do in normal *nix through my .profile. There&#8217;s a special xml file which holds parameters for the gui, somewhat like an xinit file (but not).<\/p>\n<p>Case in point: I installed xt\/xp\/sax to do XSL transforms, and added the classpath\u00a0variable to my profile. \u00a0Although  I could perform batch transforms using the command line, using the XSLide tool in Emacs generated a java exception. \u00a0In fact, executing the exact same command from a terminal session and from eshell in Emacs, the latter would fail (and no, it wasn&#8217;t user perms). \u00a0Typing &#8220;printenv&#8221; revealed the problem: my CLASSPATH simply was not set in Emacs.<\/p>\n<p>Information online (and very hidden it seems) suggests that applications need their environment variables set in ~\/.MacOS\/environment.plist. \u00a0To do this, you need to create the directory and then use \/Developer\/Applications\/Utilities\/Property_List_Editor to pupulate the XML file. \u00a0Unfortunately, this didn&#8217;t work either (it *may* work w\/ normal programs, but not w\/ Emacs).<\/p>\n<p>After days of programmer hair-pulling, it turns out the fix was quite simple: simply declare the environment variables in .emacs (sometimes I think I purposely avoid the obvious), thusly:<\/p>\n<blockquote><p>(setenv &#8220;CLASSPATH&#8221; &#8220;\/usr\/local\/xt\/xt.jar:\/usr\/local\/xt\/sax.jar:\/usr\/local\/xp.jar&#8221;)<\/p><\/blockquote>\n<p>Now that that&#8217;s working, let&#8217;s see if I can get my perl, ruby, and html modes to function.<\/p>\n<p>FWIW, you can also use a\u00a0command line trick to make all your unix and dot-files visible from the Finder (although they are always visible from dired): &#8220;defaults write com.apple.Finder AppleShowAllFiles YES&#8221; &#8212; use w\/ care and only if\/when you need it: it turns out that all those DS_store files show up too (one could\u00a0use\u00a0Dired-x\u00a0and\u00a0omit\u00a0special\u00a0files\u00a0\ud83d\ude09 . \u00a0\u00a0Of course, appending &#8220;NO&#8221; will revert to the default.<br \/>\n<a href=\"http:\/\/homepage.mac.com\/zenitani\/emacs-e.html\"><br \/>\n<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m glad that MacOSX is unix-based, but it still hides too much of the guts, making it harder than necessary to accomplish essential technical activities. \u00a0My first home computer was a Mac (actually, one of the first off the assembly line, with the signatures of team inside of the case &#8212; I recall being a&#8230; <a class=\"more-link\" href=\"https:\/\/www.aye0.com\/darmablog\/mac-emacs\/\">Continue reading <span class=\"meta-nav\">&#8594;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,7],"tags":[27,31,34,35,39,50],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-emacs","category-misc","tag-emacs","tag-image","tag-linux","tag-mac","tag-programming","tag-xml"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7fNAG-X","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":0,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}