about photos bookshelf portfolio blog home
Begin main content

Pretty Printing objective C with GNU a2ps

a2ps includes a stylesheet for objective c, but it's not mapped to anything. Plus, the .m extension is mapped to "octave" files (which I guess is some music notation format system...).

To have a2ps recognise and nicely print your Objective C source files, you just need to make the following changes to /usr/share/a2ps/sheets/sheets.map

Search for "octave" and comment out those lines like so:

# octave files
#octave:	/*.octavescript/
#	/*.m/
Then add a line for objective c like so:

# objective C
objc: /*.m/
If you also want your header files to be highlighted with the objective c stylesheet (instead of the default c stylesheet), use the following entry instead:

# objective C
objc: /*.m/
      /*.h/

01:17 PM, 17 Aug 2005 by Mark Aufflick Permalink | Comments (0)

XML

Blog Categories

software (4)
  ..heads up 'tunes (4)

Notifications

Icon of Envelope Request notifications

Syndication Feed

XML

Recent Comments

  1. Mark Aufflick: all good ideas
  2. Unregistered Visitor: Excellent!
  3. Mark Aufflick: Hey thanks
  4. Unregistered Visitor: Fantastic entry
  5. Mark Aufflick: Bah - dashboard widgets
  6. Unregistered Visitor: Nice
  7. Mark Aufflick: elegant maths (as opposed to elegant rabbit)
  8. Unregistered Visitor: Does that really matter?
  9. Mark Aufflick: Inspiration
  10. Unregistered Visitor: Perhaps...