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: Marius Hofert
Subject: Re: dired-guess-shell-alist-user: How to match folders instead of file types?
Date: Thu, 27 Jun 2013 14:25:20 +0200

On Thu, Jun 27, 2013 at 1:48 PM, Stephen Berman <stephen.berman@gmx.net> wrote:
> 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.

Thanks, Steve.

>  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,

Including or excluding the dot '.'? There are rarely directories named
'My.zip", but I could imagine a directory Myzip to exist.

> 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")
>

okay, thanks.

Marius


> Hope that helps.
>
> Steve Berman



reply via email to

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