all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Reinhard Kotucha <reinhard.kotucha@web.de>
Subject: dired-view-command-alist
Date: Mon, 27 Sep 2004 04:00:32 +0200	[thread overview]
Message-ID: <16727.29760.450838.453550@zarniwoop.ms25.local> (raw)

Hi,
I recently installed a CVS version of emacs.  There is obviously a new
feature: if you press "v" in dired mode then a program is launched
according to the entries in dired-view-command-alist.

The idea is not bad, but I think the user interface is.

1.  It is IMO wrong to execute a program depending on the file name
    extension without asking the user.  In most cases you want to run
    Perl on .pl files but you certainly do not want to do this if the
    .pl file is a TeX font property list.

2.  It makes the features of the view mode unavailable for files that
    appear in dired-view-command-alist.  The alternative is to use the
    function find-file-read-only but this very inconvenient as
    compared to view-mode.

Some years ago, when emacs-20 was released, I wrote a small function
which provides a similar feature but does not make other features
unavailable.

I just copied the function dired-do-shell-command to an other file,
changed it's name, added some code and then bound it to the key "!".

It behaves like this:

1.  If you press "!" and there is no entry in shell-command-alist for
    the particular file, it behaves as usual.

2.  If you have marked more than one file it behaves as usual.

3.  If you have marked one or no file (in the latter case the position
    of the cursor is relevant), it adds something like 
    (default: gv -antialias) to the minibuffer.

    Instead of
        "! on example.ps:"
    you get
	"! on example.ps (default: gv -antialias):"
    in the minibuffer.

4.  If you just press the return key the default program (from
    shell-command-alist) is executed.  But if you enter a program
    name before pressing the return key, this program is executed.
    The command history is still available.

This has some advantages:

1.  view-mode always works.

2.  You can execute any program you want.  The patch just provides a
    default, you can make use of it if you want or enter another
    program name or make use of the command history.

I think that view-mode is quite useful and should behave as it behaved
all the years, I don't want to miss it.  So as a quick fix I added
(setq dired-view-command-alist nil) to my ~/.emacs.

But dired-do-shell-command can be improved.  It does not have command
completion, maybe this can be added in the future.  But it is a great
help to have an alist which provides some defaults.  I think that
something like dired-view-command-alist should better be integrated in
dired-do-shell-command.

And it should not execute any program without asking the user.

It would be nice if you consider to change the user interface as
described.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha@web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------

             reply	other threads:[~2004-09-27  2:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-27  2:00 Reinhard Kotucha [this message]
2004-09-27  3:44 ` dired-view-command-alist Miles Bader
2004-09-27 14:54 ` dired-view-command-alist Richard Stallman
2004-10-02 20:33   ` dired-view-command-alist Juri Linkov
2004-10-04 15:17     ` dired-view-command-alist Richard Stallman
2004-10-05  0:31       ` dired-view-command-alist Reinhard Kotucha
2004-10-05  7:43         ` dired-view-command-alist Miles Bader
2004-10-05  8:05           ` dired-view-command-alist David Kastrup
2004-10-05  8:42             ` dired-view-command-alist Miles Bader
2004-10-05 21:14             ` dired-view-command-alist Reinhard Kotucha
2004-10-06 17:10             ` dired-view-command-alist Richard Stallman
2004-10-05 13:38           ` dired-view-command-alist Robert J. Chassell
2004-10-05 21:41           ` dired-view-command-alist Reinhard Kotucha
2004-10-06  1:31             ` dired-view-command-alist Miles Bader
2004-10-06  5:29         ` dired-view-command-alist Richard Stallman
2004-10-06 19:17           ` dired-view-command-alist Reinhard Kotucha
2004-10-07 16:45             ` dired-view-command-alist Richard Stallman
2004-10-07  6:00         ` dired-view-command-alist Juri Linkov
2004-10-08 15:51         ` dired-view-command-alist Kai Grossjohann
2004-10-08 18:48           ` dired-view-command-alist Juri Linkov
  -- strict thread matches above, loose matches on Subject: below --
2005-01-03 19:27 dired-view-command-alist Sam Steingold
2005-01-04  3:38 ` dired-view-command-alist Richard Stallman
2005-01-04  9:03   ` dired-view-command-alist Juri Linkov
2005-01-05  3:30     ` dired-view-command-alist Richard Stallman
2005-01-04 14:38   ` dired-view-command-alist Sam Steingold
2005-01-04 19:54     ` dired-view-command-alist Richard Stallman

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

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

  git send-email \
    --in-reply-to=16727.29760.450838.453550@zarniwoop.ms25.local \
    --to=reinhard.kotucha@web.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.