GNU bug report logs -
#14110
24.3.50; Add command to open files outside of Emacs (use xdg-open, open etc)
Previous Next
Reported by: Jambunathan K <kjambunathan <at> gmail.com>
Date: Mon, 1 Apr 2013 07:02:02 UTC
Severity: wishlist
Found in version 24.3.50
Done: Jambunathan K <kjambunathan <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> (Hint: The COMMAND is a sexp. It can theoretically be a `cond'
>> or a `case' statement.)
>
> If you want such customizability, then please use a function:
> funcall/apply is great, but eval is evil.
(It will be improper for me to provide a patch.)
Leo suggests `dired-guess-shell-alist-user'. COMMAND there is a sexp,
btw. So the above variable is also evil.
There is one another reason why `dired-guess-shell-alist-user' will be
improper to be used for Open semantics. IIRC, running a shell command
.tex file compiles it. So equating shell command with open is
confusing, btw.
,----[ C-h v dired-guess-shell-alist-user RET ]
| dired-guess-shell-alist-user is a variable defined in `dired-x.el'.
| Its value is nil
|
| Documentation:
| User-defined alist of rules for suggested commands.
| These rules take precedence over the predefined rules in the variable
| `dired-guess-shell-alist-default' (to which they are prepended).
|
| Each element of this list looks like
|
| (REGEXP COMMAND...)
|
| where each COMMAND can either be a string or a Lisp expression that evaluates
| to a string. If several COMMANDs are given, the first one will be the default
| and the rest will be added temporarily to the history and can be retrieved
| with M-x previous-history-element (M-p) .
|
| The variable `dired-guess-shell-case-fold-search' controls whether
| REGEXP is matched case-sensitively.
|
| You can set this variable in your ~/.emacs. For example, to add rules for
| `.foo' and `.bar' files, write
|
| (setq dired-guess-shell-alist-user
| '(("\\.foo\\'" "FOO-COMMAND")
| ("\\.bar\\'"
| (if condition
| "BAR-COMMAND-1"
| "BAR-COMMAND-2"))))
|
| You can customize this variable.
|
| [back]
`----
> Stefan
This bug report was last modified 11 years and 249 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.