unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: relation between `dired-guess-default' and `mailcap-file-default-commands'
Date: Sun, 25 Jan 2009 03:04:35 +0200	[thread overview]
Message-ID: <87r62suqys.fsf@jurta.org> (raw)
In-Reply-To: <000d01c97e79$a4098640$0200a8c0@us.oracle.com> (Drew Adams's message of "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?

`mailcap-file-default-commands' is superior since it provides real
commands available on the system.  But it's not clear what to do with
`dired-guess-default': either combine its commands with commands
from `mailcap-file-default-commands' or remove completely.

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

Commands from MIME types are based on system information from mailcap files
whereas a built-in list in dired-guess-shell-alist-default is fixed.

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

Refactoring is already done, so now dependency is minimal.
Please see http://thread.gmane.org/gmane.emacs.devel/80123/focus=80485

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

-- 
Juri Linkov
http://www.jurta.org/emacs/




  reply	other threads:[~2009-01-25  1:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-24 23:15 relation between `dired-guess-default' and `mailcap-file-default-commands' Drew Adams
2009-01-25  1:04 ` Juri Linkov [this message]
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=87r62suqys.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=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).