emacs-devel
[Top][All Lists]
Advanced

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

relation between `dired-guess-default' and `mailcap-file-default-command


From: Drew Adams
Subject: relation between `dired-guess-default' and `mailcap-file-default-commands'
Date: Sat, 24 Jan 2009 15:15:25 -0800

After filing bug #2028 about `dired-guess-default', I came across similar uses
of `mailcap-file-default-commands'. I'm a bit lost in the code, but it looks
like these two functions might be doing double-duty to some extent. IIUC, each
returns a list of shell commands that might be appropriate for a given set of
target files.

The former is used by `dired-guess-shell-command' (hence indirectly by
`dired-read-shell-command' and `dired-man'). The latter is used by
`minibuffer-default-add-shell-commands' and
`minibuffer-default-add-dired-shell-commands' (hence indirectly by
`dired-smart-shell-command', which is presumably something similar to functions
that employ `dired-guess-shell-command').

The means by which `dired-guess-default' and `mailcap-file-default-commands'
produce their lists of shell commands that target files seem to be quite
different. Perhaps one of them is superior, or perhaps they should be combined?

It's not clear to me, for instance, why `dired-read-shell-command' would guess
shell commands based on file-type alists and `read-shell-command' would guess
shell commands based on file MIME types.

It also seems a bit odd that simple.el and dired-aux.el would look to GNUS code
for their utility functions. Seems like some code refactoring or cleanup might
be in order here.

If this code organization and seeming duplication or overlap is intentional,
then I would like to understand the rationale (purpose), to better decide which
of these functions to use in my own code in different contexts. The Elisp manual
is no help here. If intentional, perhaps the doc strings or commentary could be
improved to better explain what each of these is for, that is, explain their
difference in terms of purpose and applicability.

Summary: Why are there two, and what is the difference in terms of intended use?
Should they be combined in some way?





reply via email to

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