Tom Pierce's Blog : Let the geek times roll.
Updated: 6/20/04; 3:19:18 PM.

 

Subscribe to "Tom Pierce's Blog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Thursday, October 30, 2003

Have you ever used Emacs Archive mode to open a zip file, edit a file in the zip, and save it back to the zip file automagically? NO?!? You definitely don't know what you're missing.

Today, I wanted to edit 1 file in a WAR file to try out a tweak to the webapp I'm working on. I could have busted the WAR file open, modified the file, and then zipped it (jar) back up. But that all seems so cumbersome.

Instead what I did was use Emacs to open the WAR, find my file, edit its guts, and save it back to the archive. Voila! Ready for deployment.

By default, Emacs will edit zip files (and maybe even jar files), but you don't get support for WAR and EAR out of the box. But wait! Emacs is the world's most extensible editor. Follow the instructions here and add that lisp code to your .emacs file. You'll be in business.

On a related note, check out this Artima thread. Oliver Burn gives the reasons why he uses Emacs over jEdit. Also some good links to helpful extensions.

Finally, if you are using Emacs on a Windows platform and you are using Cygwin, then you may be using "unzip" as a PKZip alternative. If you are, I've found it helpful to make sure that the zip extract command in Archive Zip group has an argument of "-j". This tells Infozip to not extract the file into directories because Archive mode expects the file to be in its temp directory - not a subdirectory of its temp directory.


1:18:52 PM    comment []

© Copyright 2004 Tom Pierce.



Click here to visit the Radio UserLand website.

 


October 2003
Sun Mon Tue Wed Thu Fri Sat
      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  
Sep   Nov

Search

[sgl dagger]
How this works

Emacs Sources
 tsql-indent.el
 user-add-sql-folding-marks
 remove-line-boundary-in-region
 convert-camel-to-underscore

My Subscriptions
 Funny
 KM