[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to setup default program to launch directory?
From: |
Michael Heerdegen |
Subject: |
Re: How to setup default program to launch directory? |
Date: |
Thu, 14 Oct 2021 02:18:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Jean Louis <bugs@gnu.support> writes:
> I would like to launch programs on directories, is there any way to
> set it up by default? This is also useful to launch videos on
> directory.
In each entry (REGEXP COMMAND...) in `dired-guess-shell-alist-user',
COMMAND
| can either be a string or a Lisp expression that evaluates to a
| string. If this expression needs to consult the name of the file for
| which the shell commands are being requested, it can access that file
| name as the variable `file'.
(quoting from the docstring). This is what you want to use. Use a
catchall REGEXP and make COMMAND an expression that returns something
for directories, and nil else. AFAICT COMMAND is also allowed to return
a list of strings.
I made it so that the expression also looks inside the directory, and
when it's full of images or media files, I return appropriate viewers.
Michael.