Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using bzip2 instead of gz

2 views
Skip to first unread message

Deepak Dinesh

unread,
Feb 18, 2002, 11:52:44 AM2/18/02
to
How can I use bzip2 for all the compression tasks in emacs instead of
gzip ? Is there a variable I can set for this purpose ? I use bzip2
for almost all the tasks from the command line, but I have to use gzip
when in dired mode. Any help is appreciated.

DD
--
Please reply to the newsgroup. If you are sending direct email,
include 22489775 somewhere in the subject or leave this sig intact.

Eli Zaretskii

unread,
Feb 18, 2002, 1:41:30 PM2/18/02
to
Deepak Dinesh wrote:
>
> How can I use bzip2 for all the compression tasks in emacs instead of
> gzip ? Is there a variable I can set for this purpose ?

I'm not sure I understand the problem: are you talking about
auto-compression mode? If so, it already supports bzip2.

If that doesn't help, please tell what commands force you to use gzip.

Deepak Dinesh

unread,
Feb 18, 2002, 4:16:55 PM2/18/02
to
When I press Z in dired, it gzips the file. I want it to use bzip2
instead.

TIA.

Eli Zaretskii

unread,
Feb 19, 2002, 1:03:28 AM2/19/02
to
Deepak Dinesh wrote:
>
> When I press Z in dired, it gzips the file. I want it to use bzip2
> instead.

Dired's Z command can uncompress .bz2 files, but it only compresses with
gzip, AFAICS. Feel free to submit a change that makes the program a
defcustom, or ask for that on gnu.emacs.bug.

Dominic Mitchell

unread,
Feb 19, 2002, 1:46:38 AM2/19/02
to


If he only wants to use bzip2, I guess he could just change the
invocation of gzip for bzip2 in dired-aux.el and change the file
extensions to be attached to the file compressed.

In emacs-20.7 this only implies something like:

;; (condition-case nil
;; (if (not (dired-check-process (concat "Compressing " file)
;; "gzip" "-f" file))
;; (let ((out-name
;; (if (file-exists-p (concat file ".gz"))
;; (concat file ".gz")
;; (concat file ".z"))))
(condition-case nil
(if (not (dired-check-process (concat "Compressing " file)
"bzip2" "-f" file))
(let ((out-name
(if (file-exists-p (concat file ".bz2"))
(concat file ".bz2")
(concat file ".bz2"))))


Cheers.

Dominic.

Deepak Dinesh

unread,
Feb 19, 2002, 10:49:34 AM2/19/02
to
Dominic Mitchell <dom...@videotron.ca> writes:

> If he only wants to use bzip2, I guess he could just change the
> invocation of gzip for bzip2 in dired-aux.el and change the file
> extensions to be attached to the file compressed.
>
> In emacs-20.7 this only implies something like:

Thanks a lot. I hope this does not change anything else. I tested it out and
it works.

Jason Rumney

unread,
Feb 19, 2002, 2:37:21 PM2/19/02
to
Dominic Mitchell <dom...@videotron.ca> writes:

> If he only wants to use bzip2, I guess he could just change the
> invocation of gzip for bzip2 in dired-aux.el and change the file
> extensions to be attached to the file compressed.

But then, next time he upgrades Emacs, he has to remember all such
customizations he made, and make them again. So Eli's suggestion is a
better long-term solution.

> > Dired's Z command can uncompress .bz2 files, but it only
> > compresses with gzip, AFAICS. Feel free to submit a change that
> > makes the program a defcustom, or ask for that on gnu.emacs.bug.

--
Jason Rumney

Dominic Mitchell

unread,
Feb 19, 2002, 3:34:55 PM2/19/02
to

Definitely... I am not disagreeing, but this is an easy and rapid
solution for him in the short-term. I would argue that this is not
difficult to remember though. After the upgrade he quickly
recognize it is not working to his liking. He then just has to go in
dired mode and do C-h b to find out that Z is binded to
dired-do-compress which is using the function
dired-compress-file. He then just has to do the simple
modification to dired-compress-file.

I am not by any mean a lisp programmer so I think it is not too
hard.

Cheers.

Dominic.

Lee Sau Dan

unread,
Feb 20, 2002, 3:29:41 AM2/20/02
to
>>>>> "Dominic" == Dominic Mitchell <dom...@videotron.ca> writes:

Dominic> He then just has to go in dired mode and
Dominic> do C-h b to find out that Z is binded to
............................................^^^^^^
Dominic> dired-do-compress

Much quicker: go in dired mode and C-h k Z

C-h k is very very useful in such circumstances! :)

Dominic> I am not by any mean a lisp programmer so I think it is
.............................^^^^
Dominic> not too hard.

Isn't "means" also the singular form?
And BTW, isn't the past participle of "bind" "bound"?


--
Lee Sau Dan 李守敦(Big5) ~{@nJX6X~}(HZ)

E-mail: dan...@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

Deepak Dinesh

unread,
Feb 20, 2002, 10:33:55 AM2/20/02
to
Lee Sau Dan <dan...@informatik.uni-freiburg.de> writes:

> Much quicker: go in dired mode and C-h k Z
>
> C-h k is very very useful in such circumstances! :)

I did all this a while ago, but I wasn't sure what else I would break
if I changed it. Anyway, I think dired mode is one where a lot of
stuff could be added to make it more useful as a file manager.

Dominic Mitchell

unread,
Feb 20, 2002, 12:49:56 PM2/20/02
to


Lee Sau Dan <dan...@informatik.uni-freiburg.de> writes:

> >>>>> "Dominic" == Dominic Mitchell <dom...@videotron.ca> writes:
>
> Dominic> He then just has to go in dired mode and
> Dominic> do C-h b to find out that Z is binded to
> ............................................^^^^^^
> Dominic> dired-do-compress
>
> Much quicker: go in dired mode and C-h k Z
>
> C-h k is very very useful in such circumstances! :)

Yes, I learn new details everyday.

>
>
>
> Dominic> I am not by any mean a lisp programmer so I think it is
> .............................^^^^
> Dominic> not too hard.
>
> Isn't "means" also the singular form?
> And BTW, isn't the past participle of "bind" "bound"?

Thanks for your english pointers ... As you can guess I am not an
english native.

Cheers.

Dominic.

Lee Sau Dan

unread,
Feb 25, 2002, 2:49:09 AM2/25/02
to
>>>>> "Dominic" == Dominic Mitchell <dom...@videotron.ca> writes:

Dominic> I am not by any mean a lisp programmer so I think it is
>> ......................^^^^
Dominic> not too hard.
>> Isn't "means" also the singular form? And BTW, isn't the past
>> participle of "bind" "bound"?

Dominic> Thanks for your english pointers ... As you can guess I
Dominic> am not an english native.

Don't worry. Neither am I. :)

Lee Sau Dan

unread,
Feb 25, 2002, 2:49:09 AM2/25/02
to
>>>>> "Deepak" == Deepak Dinesh <sig...@yahoo.com> writes:

>> C-h k is very very useful in such circumstances! :)

Deepak> I did all this a while ago, but I wasn't sure what else I
Deepak> would break if I changed it.

If you don't try, how could you know?


Deepak> Anyway, I think dired mode is
Deepak> one where a lot of stuff could be added to make it more
Deepak> useful as a file manager.

I want an easier way (API) for me to add new functions to dired-mode.
The source code isn't very helpful (perhaps because I didn't have the
patience to study it when I'm needing a feature urgently). For
example, I want to easily get the list of tagged files, so that I can
write my own LISP functions to process these files. Then, I can bind
these new functions to those "unused" keys for quick access. The
function should be there already.

Eli Zaretskii

unread,
Feb 25, 2002, 6:20:49 AM2/25/02
to
Lee Sau Dan wrote:
>
> For
> example, I want to easily get the list of tagged files, so that I can
> write my own LISP functions to process these files. Then, I can bind
> these new functions to those "unused" keys for quick access. The
> function should be there already.

Yes, it is; see dired-map-over-marks. (I only needed 20 seconds of
patience to find it by grepping dired.el for "marked".)

Lee Sau Dan

unread,
Feb 25, 2002, 11:22:04 AM2/25/02
to
>>>>> "Eli" == Eli Zaretskii <el...@is.elta.co.il> writes:

Eli> Lee Sau Dan wrote:
>> For example, I want to easily get the list of tagged files, so
>> that I can write my own LISP functions to process these files.
>> Then, I can bind these new functions to those "unused" keys for
>> quick access. The function should be there already.

Eli> Yes, it is; see dired-map-over-marks. (I only needed 20
Eli> seconds of patience to find it by grepping dired.el for
Eli> "marked".)

Oh! How come I could not find it in my last few attempts (at
intervals of several months)? :P

0 new messages