More Apple X11.app wierdness
Well, sort of. It throws around all the windows correctly; and when you click one it comes to the top; but it doesn't change X11's window stacking order because front clicks are sent through to the window that used to be on top instead of the one that Quartz has now placed on top.
07:02 PM, 22 Aug 2004 by Mark Aufflick Permalink | Comments (0)
Sensible Emacs usage with Apple's XCode
But hallelujah, XCode supports emacs integration! And, it's quite smart - but yet not quite smart enough :/
It uses my all time favourite gnuserv/gnuclient (with the gnuserv-compat.el library so it can run in GNU emacs), and Apple have put a Darwin compatible gnuserv binary in /usr/bin/gnuserv. This is handy even if you (like me) run fink installed emacsen.
But this is a Mac, so you don't want terminal emacs... Carbon emacs is nice, but I want to use X11 GNU Emacs. Problem is, the way XCode interacts with gnuclient is a bit annoying.
First up, it executes /usr/bin/emacs with no arguments inside a Terminal.app window. You have to configure your .emacs file to start gnuserv-start as per these release notes.
One easy thing you can do, is start gnuserv by hand in your X version (M-x gnuserv-start) and not in your .emacs file. Then, when you double click a file in XCode, it will start a (useless) console emacs, and use gnuclient to open the file in your X11 Emacs.
So far so good - but two emacs processes is heavy, so i replaced /usr/bin/emacs with a hard link to /usr/bin/true ;)
See Update 3 below for the right way to do this!
This only leaves two problems:
- A Terminal.app window is brought to the foreground each time, but we want X11 brought to the foreground instead
- XCode asks gnuclient to open the file in the same frame but I want it in a new frame. Presumably this is because GNU Emacs doesn't support multiple frames (ie. across multiple ptys) in console mode, which is all the Apple supplied emacs supports.
The emacs support seems hard coded - I can't find any scripts that do the work to hack away at. Maybe I can replaec Terminal.app with an AppleScript compiled .app that ignores the calls that XCode is making and thus just leave the gnuclient calls (which appears to be executed by XCode directly - not via Terminal.app), but also to tell X11.app to come to the foreground when (the new) Terminal.app is asked to go to the foreground.
Seems like a lot of work. And I don't do any commercial Mac development, so I probably won't bother!
Annoying though...
UPDATE
It seems the link to /usr/bin/true didn't work - XCode must realise that emacs wasn't started.
What does work though is to move aside /usr/bin/emacs and replace it with a symlink to your X11 version (eg. /sw/bin/emacs-21.2).
Still have both of the bulleted problems abouve though.
Then I had the great idea to move gnuclient to gnuclient-bin, replace gnuclient with dtemacs (hard coding DISPLAY to :0.0). I thought it might fail if XCode exec-ed the binary directly, but it didn't seme to make any difference, so perhaps the gnuclient protocol is coded into XCode??
If an Apple developer on the XCode team reads this - please give us an option to tune the system calls for emacs :)
UPDATE 2
Ok, so this is REALLY bogus, but if the bazillion Terminal windows annoy you, here is what you can do:
- Symlink your X11 emacs binary to /usr/bin/emacs
- Have your .emacs (gnuserv-start) as per above
- Fire up an XCode project, and open a file with emacs as the external editor
- [Terminal.app will launch your X11 emacs, and subsequently the frame will have the file opened in it by the gnuclient call]
- Minimise the Terminal.app window, but leave it running.
- in a shell, rename /Applications/Utilities/Terminal.app to something else.
- Yes you heard me! Rename the sucker.
- Now you can double-click in XCode and open the file in your running X11 Emacs process in the front-most frame with being annoyed by Terminal.app windows
Unfortunately you will have to repeat these steps every time. Also, if you symlink X11.app to Terminal.app it will get raised, but none of it's windows will so that kinda defeats the purpose.
If the next version of XCode doesn't help, I'll come up with some Applescript wizardry for a replacement .app and a script menu entry to do all the stupid renaming etc.
UPDATE 3
You can actually tell Xcode which emacs binary to start up using the Expert preferences. Simply run the following in a shell with the path to your custom installed emacs:
defaults write com.apple.Xcode PBXEmacsPath /opt/bin/emacs
Still doesn't address the Terminal problem though.
12:13 PM, 22 Aug 2004 by Mark Aufflick Permalink | Comments (2)
Trackpad scrolling for Mac Laptops [www.ragingmenace.com]
It's even more addictive than a scroll wheel since your trackpad is right under your hands at all times.
Well, now you can get this on your OSX Mac laptop as well thanks to a very smart Control Panel called SideTrack from Alex Harper (RagingMenace.com<.a>). It's currently in public Beta, but I have yet to see any SideEffects on my original TiBook running Panther.5 This guy also provided some enhancements to uControl—another of my (very few) essential OSX addons.
12:08 AM, 18 Aug 2004 by Mark Aufflick Permalink | Comments (0)
Emacs on MacOS X goodness
However, coercign Xcode to talk to a running X11 emacs using gnuserv seems to be tricky, so I'm investigating Aqua emacs. Apparently cvs builds of emacs can now generate a .dmg emacs installer for Aqua. My cvs tree is still downloading so we will see.
Since Applescript is still handy even on OSX, the emacs lisp functions to call applescript from within emacs may be useful (on Steve Wainstead's advogato blog).
Elsewhere on Steve's blog is an excellent lisp func that starts tailing a logfile in a new shell buffer and frame in one easy step (here).
Many more great tips here: http://www.emacswiki.org/cgi-bin/wiki/MacOSTweaks
03:19 AM, 15 Aug 2004 by Mark Aufflick Permalink | Comments (0)
Logged Query Analysis for Postgres [pqa.projects.postgresql.org]
- The most expensive (slowest) queries
- The most frequently run queries
- The queries that took the most aggregate time
Very simple - but very beneficial when you have to optimise a large amount of code pumping the database as fast as it can.
The biggest deficiency it has is that it doesn't log which database is involved - I'll take a look at the code and the logs to see if that is possible, but it's written in ruby...
Maybe I should port it to perl, but then I'd have to maintain it...
03:08 AM, 13 Aug 2004 by Mark Aufflick Permalink | Comments (0)
Web CMS Face-Off [www.eweek.com]
Bricolage rated as many "Good" and "Excellent" rankings as TeamSite and it's "Cons" section was shorter.
So why would anyone shell out $40k USD for TeamSite? It's not like their support is amazing or that its easier to find TeamSite developers than Perl/Mason developers...
09:23 PM, 11 Aug 2004 by Mark Aufflick Permalink | Comments (0)
PowerPC : An Architectural History [arstechnica.com]
If you're into processor design you will love this series. The same author has apparently written a more in depth history of the Pentium line, but I like my processors in RISC thanks ;)
04:18 AM, 05 Aug 2004 by Mark Aufflick Permalink | Comments (0)
Archive
| August 2004 | ||||||
| S | M | T | W | T | F | S |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
March 2012
February 2012
November 2011
October 2011
April 2011
March 2011
January 2011
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
Blog Categories
software (40)..cocoa (21)
..heads up 'tunes (5)
..ruby (6)
..lisp (4)
..perl (4)
..openacs (1)
mac (21)
embedded (2)
..microprocessor (2)
..avr (1)
electronics (3)
design (1)
photography (26)
..black and white (6)
..A day in Sydney (18)
..The Daily Shoot (6)
food (2)
Book Review (2)
Notifications
Request notifications






