help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: dired-guess-shell-alist-user: How to match folders instead of file t


From: Stephen Berman
Subject: Re: dired-guess-shell-alist-user: How to match folders instead of file types?
Date: Thu, 27 Jun 2013 13:48:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

On Thu, 27 Jun 2013 13:22:00 +0200 Marius Hofert <marius.hofert@math.ethz.ch> 
wrote:

> ... I was too fast. It does indeed work now for the point being on
> directories. However, for the other assignments (like using unzip on
> .zip files) I don't get the corresponding suggestion anymore...
>
> I put your code in the beginning of 'dired-guess-shell-alist-user' as you 
> said.

Sorry, I made a silly mistake: the regexp `.*' matches any file, so the
entry needs to be the *last* one in dired-guess-shell-alist-user.  But
then you have to be sure that none of the preceding entries match a
directory.  This will probably be true of any file ending in `.zip',
`.tgz', etc.  If you do have any directories whose names have endings
that could also be used for non-directory files, you could wrap the command
expresion in the corresponding entry in an `unless' form, e.g.:
(".xyz" (unless (file-directory-p (dired-get-filename)) "shell-command") 

Hope that helps.

Steve Berman



reply via email to

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