unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* dired-view-command-alist
@ 2004-09-27  2:00 Reinhard Kotucha
  2004-09-27  3:44 ` dired-view-command-alist Miles Bader
  2004-09-27 14:54 ` dired-view-command-alist Richard Stallman
  0 siblings, 2 replies; 26+ messages in thread
From: Reinhard Kotucha @ 2004-09-27  2:00 UTC (permalink / 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.
----------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 26+ messages in thread
* dired-view-command-alist
@ 2005-01-03 19:27 Sam Steingold
  2005-01-04  3:38 ` dired-view-command-alist Richard Stallman
  0 siblings, 1 reply; 26+ messages in thread
From: Sam Steingold @ 2005-01-03 19:27 UTC (permalink / raw)


2005-01-01  Richard M. Stallman  <rms@gnu.org>

* dired.el (dired-view-command-alist): Variable deleted.
	(dired-view-file, dired-mouse-find-file-other-window):
	Delete the code to use it.


why?

I want certain files (e.g., html, rtf, doc, pdf) viewed externally
(preferably with the default system tool, like whatever I would get by
clicking on the file in the Gnome file manager)


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
main(a){a="main(a){a=%c%s%c;printf(a,34,a,34);}";printf(a,34,a,34);}

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2005-01-05  3:30 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-27  2:00 dired-view-command-alist Reinhard Kotucha
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

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