[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proposal for improvement in arc-mode.el

From: Daniel M Coffman
Subject: Proposal for improvement in arc-mode.el
Date: Mon, 19 Apr 2004 14:38:50 -0400

Dear sirs,

      I have recently begun emacs 21.3 to peruse and edit some large
archive files, specifically .war files.  I discovered
that if the .war files contain a .jar themselves, I am unable to open files
within these "secondary" .jar files.  I traced the
problem to the function archive-maybe-copy in arc-mode.el  This function
assumes that the file from the secondary .jar file may be
copied to the root of the previously created temporary directory.  However,
both the original .war and the secondary
.jar files may contain an additional quasi directory structure themselves
and so this copy will fail.  I have found
that adding the following code alleviates this problem.  It creates the
required additional directories in sequence.

        ;; DMC change.  3-17-2004
        ;;   This procedure for creating the appropriate directory seems
        ;;   as the archive-name itself may contain directory
specifications.  To
        ;;   improve this ...
        ;;   First, make the base directory
        (make-directory archive-tmpdir t)

        ;;   Now parse apart archive-name and remove any directory
specifications, separated by "/"
        (let ((archive-temp-name archive-name) (archive-temp-tmpdir
archive-tmpdir) (seperator-index nil))
          (while (setq seperator-index (string-match "/"
            (setq archive-temp-tmpdir
                (concat archive-temp-tmpdir "/" (substring
archive-temp-name 0 seperator-index)))
            (setq archive-temp-name (substring archive-temp-name (1+

            ;; Make the subdirectories in turn.
            (make-directory archive-temp-tmpdir t)))
        ;; End DMC change

This code should be added at line 800 of the arc-mode.el file distributed
with emacs 21.3.
I have tested this code under Windows 2000 and Windows NT 4.0 and under
AIX 5.

I look forward to your response.
With best regards,
Dan Coffman
IBM Research

reply via email to

[Prev in Thread] Current Thread [Next in Thread]