unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: relation between `dired-guess-default' and `mailcap-file-default-commands'
Date: Sat, 24 Jan 2009 15:15:25 -0800	[thread overview]
Message-ID: <000d01c97e79$a4098640$0200a8c0@us.oracle.com> (raw)

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	other threads:[~2009-01-24 23:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-24 23:15 Drew Adams [this message]
2009-01-25  1:04 ` relation between `dired-guess-default' and `mailcap-file-default-commands' Juri Linkov
2009-01-25  3:06   ` Drew Adams
2009-01-25 21:55     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000d01c97e79$a4098640$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).