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

* Re: dired-view-command-alist
  2004-09-27  2:00 dired-view-command-alist Reinhard Kotucha
@ 2004-09-27  3:44 ` Miles Bader
  2004-09-27 14:54 ` dired-view-command-alist Richard Stallman
  1 sibling, 0 replies; 26+ messages in thread
From: Miles Bader @ 2004-09-27  3:44 UTC (permalink / raw)
  Cc: emacs-devel

Reinhard Kotucha <reinhard.kotucha@web.de> writes:
> 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.

Hmmm, I agree with this argument.

-Miles
-- 
`Cars give people wonderful freedom and increase their opportunities.
 But they also destroy the environment, to an extent so drastic that
 they kill all social life' (from _A Pattern Language_)

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

* Re: dired-view-command-alist
  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 ` Richard Stallman
  2004-10-02 20:33   ` dired-view-command-alist Juri Linkov
  1 sibling, 1 reply; 26+ messages in thread
From: Richard Stallman @ 2004-09-27 14:54 UTC (permalink / raw)
  Cc: emacs-devel

Your change in ! sounds useful.  One improvement would be, if you have
marked several files but they all correspond to the same command,
propose that command anyway.

I would be glad to install this change instead of the v feature
that we have currently added.

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

* Re: dired-view-command-alist
  2004-09-27 14:54 ` dired-view-command-alist Richard Stallman
@ 2004-10-02 20:33   ` Juri Linkov
  2004-10-04 15:17     ` dired-view-command-alist Richard Stallman
  0 siblings, 1 reply; 26+ messages in thread
From: Juri Linkov @ 2004-10-02 20:33 UTC (permalink / raw)
  Cc: Reinhard Kotucha, emacs-devel

Richard Stallman <rms@gnu.org> writes:
> Your change in ! sounds useful.  One improvement would be, if you have
> marked several files but they all correspond to the same command,
> propose that command anyway.
>
> I would be glad to install this change instead of the v feature
> that we have currently added.

This proposal describes what ! with dired-x loaded already does.
Wouldn't it be better to move the relevant code from dired-x.el
to dired.el or dired-aux.el (ca. 300 lines)?

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

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

* Re: dired-view-command-alist
  2004-10-02 20:33   ` dired-view-command-alist Juri Linkov
@ 2004-10-04 15:17     ` Richard Stallman
  2004-10-05  0:31       ` dired-view-command-alist Reinhard Kotucha
  0 siblings, 1 reply; 26+ messages in thread
From: Richard Stallman @ 2004-10-04 15:17 UTC (permalink / raw)
  Cc: reinhard.kotucha, emacs-devel

    This proposal describes what ! with dired-x loaded already does.
    Wouldn't it be better to move the relevant code from dired-x.el
    to dired.el or dired-aux.el (ca. 300 lines)?

The reason for dired-x.el was so that someone else (Sebastian Kremer)
could add features to it without my having to do the things that were
needed for incorporating them properly into Dired itself.  So I have
never looked at it.  I didn't know it already had this feature.

It sounds like a good idea to merge this code into Dired.  Would you
like to prepare a patch and show it to me?  It needs to include
etc/NEWS and the manual.

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

* Re: dired-view-command-alist
  2004-10-04 15:17     ` dired-view-command-alist Richard Stallman
@ 2004-10-05  0:31       ` Reinhard Kotucha
  2004-10-05  7:43         ` dired-view-command-alist Miles Bader
                           ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Reinhard Kotucha @ 2004-10-05  0:31 UTC (permalink / raw)
  Cc: Juri Linkov, emacs-devel

>>>>> "Richard" == Richard Stallman <rms@gnu.org> writes:

    > It sounds like a good idea to merge this code into Dired.  Would
    > you like to prepare a patch and show it to me?  It needs to
    > include etc/NEWS and the manual.

I tried it and it looks good.  I'd like to suggest a small change,
though.

When more then one file is marked, it displays something like

! on * [3 files]: {3 guesses} [ghostview]

in the minibuffer.  The string "[3 files]" can be omitted because at
the same time the names of the marked files are displayed in a
separate window.  Thus "! on *:" is sufficient.  

It's very important to know whether you marked several files or none.
Suppose you marked some files.  In a large directory the marked files
might be outside the visible part of the buffer.  If you now type "!"
and you do not remember that some files are marked, you expect that
you run the command on the file under the cursor.  So it's useful to
be warned that "!" will act on more than one file but the number of
files is absolutely irrelevant.

It is not necessary to display the number of guesses because if the
first guess is not what you want, you'll intuitively look for a better
guess in the history.

Some commands have a lot of options and it would be nice if
unnecessary stuff can be omitted from the minibuffer.

Furthermore, I think that "[ghostcript]" should be displayed only
after you pressed "!" and should disappear as soon as you press the
<up> key.

For instance, I get this:

keystroke: !
minibuffer: ! on * [3 files]: {3 guesses} [ghostview]
keystroke: <up>
minibuffer: ! on * [3 files]: {3 guesses} [ghostview] ghostview
keystroke: <up>
minibuffer: ! on * [3 files]: {3 guesses} [ghostview] xloadimage
keystroke: <up>
minibuffer: ! on * [3 files]: {3 guesses} [ghostview] lpr
keystroke: <down>
minibuffer: ! on * [3 files]: {3 guesses} [ghostview] xloadimage
keystroke: <down>
minibuffer: ! on * [3 files]: {3 guesses} [ghostview] ghostview
keystroke: <down>
minibuffer: ! on * [3 files]: {3 guesses} [ghostview]

The string "[ghostview]" is quite misleading except where it occurs
the first time (where you just has to press the RET key if you want).

I prefer that:

keystroke: !                        ;; line 1
minibuffer: ! on *: [ghostview]:    ;; line 2
keystroke: <up>                     ;; line 3
minibuffer: ! on *: ghostview       ;; line 4
keystroke: <up>                     ;; line 5
minibuffer: ! on *: xloadimage      ;; line 6
keystroke: <up>                     ;; line 7
minibuffer: ! on *: lpr             ;; line 8
keystroke: <down>                   ;; line 9
minibuffer: ! on *: xloadimage      ;; line 10
keystroke: <down>                   ;; line 11
minibuffer: ! on *: ghostview       ;; line 12
keystroke: <down>                   ;; line 13
minibuffer: ! on *:                 ;; line 14

In line 2 and 14 the last colon means that you can enter a command.
And "[ghostview]" in line 2 means that you can press <RET> instead.

If you move into the history (lines 3...12) you can still execute any
command but you have to remove the command provided by the history
before.  So I think that it's useful to provide an empty line if you
come back from the history (line 14).  

Well, if you need something different from the defaults, progname
completion would be quite useful.  Since shell-mode already has this
feature I suppose that it's not too difficult to make use of it in
dired-do-shell-command.

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

* Re: dired-view-command-alist
  2004-10-05  0:31       ` dired-view-command-alist Reinhard Kotucha
@ 2004-10-05  7:43         ` Miles Bader
  2004-10-05  8:05           ` dired-view-command-alist David Kastrup
                             ` (2 more replies)
  2004-10-06  5:29         ` dired-view-command-alist Richard Stallman
                           ` (2 subsequent siblings)
  3 siblings, 3 replies; 26+ messages in thread
From: Miles Bader @ 2004-10-05  7:43 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

On Tue, Oct 05, 2004 at 02:31:21AM +0200, Reinhard Kotucha wrote:
> When more then one file is marked, it displays something like
> 
> ! on * [3 files]: {3 guesses} [ghostview]
> 
> in the minibuffer.  The string "[3 files]" can be omitted because at
> the same time the names of the marked files are displayed in a
> separate window.  Thus "! on *:" is sufficient.  

I disagree -- I find the "[3 files]" info useful.  Despite the filenames
being displayed in a separate, the presence of that string in the prompt is
more noticeable (maybe that sounds surprising, but when I give a command that
I know is going to prompt me, I tend to focus on the minibuffer, so a warning
there is much more likely to wake me up than a new window).

The presence of the actual number of files seems to have a similar effect:
because it's not a fixed string, it's somehow more noticeable than for
instance a simple "[multiple files]" would be.

So I'd say keep the "[<N> files]" stuff in the prompt.

-Miles
-- 
Freedom's just another word, for nothing left to lose   --Janis Joplin

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

* Re: dired-view-command-alist
  2004-10-05  7:43         ` dired-view-command-alist Miles Bader
@ 2004-10-05  8:05           ` David Kastrup
  2004-10-05  8:42             ` dired-view-command-alist Miles Bader
                               ` (2 more replies)
  2004-10-05 13:38           ` dired-view-command-alist Robert J. Chassell
  2004-10-05 21:41           ` dired-view-command-alist Reinhard Kotucha
  2 siblings, 3 replies; 26+ messages in thread
From: David Kastrup @ 2004-10-05  8:05 UTC (permalink / raw)
  Cc: Juri Linkov, Reinhard Kotucha, rms, emacs-devel

Miles Bader <miles@gnu.org> writes:

> On Tue, Oct 05, 2004 at 02:31:21AM +0200, Reinhard Kotucha wrote:
>> When more then one file is marked, it displays something like
>> 
>> ! on * [3 files]: {3 guesses} [ghostview]
>> 
>> in the minibuffer.  The string "[3 files]" can be omitted because at
>> the same time the names of the marked files are displayed in a
>> separate window.  Thus "! on *:" is sufficient.  
>
> I disagree -- I find the "[3 files]" info useful.  Despite the filenames
> being displayed in a separate, the presence of that string in the prompt is
> more noticeable (maybe that sounds surprising, but when I give a command that
> I know is going to prompt me, I tend to focus on the minibuffer, so a warning
> there is much more likely to wake me up than a new window).
>
> The presence of the actual number of files seems to have a similar effect:
> because it's not a fixed string, it's somehow more noticeable than for
> instance a simple "[multiple files]" would be.
>
> So I'd say keep the "[<N> files]" stuff in the prompt.

An a different tack, one of my proposals was to bind * to inserting a
text propertied string showing <marked files> or so.  Perhaps it would
be more straightforward to just insert the file names themselves
(shell-quoted, of course).

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: dired-view-command-alist
  2004-10-05  8:05           ` dired-view-command-alist David Kastrup
@ 2004-10-05  8:42             ` Miles Bader
  2004-10-05 21:14             ` dired-view-command-alist Reinhard Kotucha
  2004-10-06 17:10             ` dired-view-command-alist Richard Stallman
  2 siblings, 0 replies; 26+ messages in thread
From: Miles Bader @ 2004-10-05  8:42 UTC (permalink / raw)
  Cc: Juri Linkov, Reinhard Kotucha, rms, emacs-devel

David Kastrup <dak@gnu.org> writes:
>> So I'd say keep the "[<N> files]" stuff in the prompt.
>
> An a different tack, one of my proposals was to bind * to inserting a
> text propertied string showing <marked files> or so.  Perhaps it would
> be more straightforward to just insert the file names themselves
> (shell-quoted, of course).

The problem that comes to mind is that the resulting command will then
be less useful for re-use via command history (I very often repeatedly
execute the same command on different files using ! and command history).

-Miles
-- 
Quidquid latine dictum sit, altum viditur.

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

* Re: dired-view-command-alist
  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 13:38           ` Robert J. Chassell
  2004-10-05 21:41           ` dired-view-command-alist Reinhard Kotucha
  2 siblings, 0 replies; 26+ messages in thread
From: Robert J. Chassell @ 2004-10-05 13:38 UTC (permalink / raw)


    > ....  The string "[3 files]" can be omitted because at the same time
    > the names of the marked files are displayed in a separate window.
    > Thus "! on *:" is sufficient.

    I disagree -- I find the "[3 files]" info useful.  

Same here.  Less than a day ago, I made changes to 111 files all at
once and then a different change to a different set of 68 files.
Please keep the string.

-- 
    Robert J. Chassell                         
    bob@rattlesnake.com                         GnuPG Key ID: 004B4AC8
    http://www.rattlesnake.com                  http://www.teak.cc

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

* Re: dired-view-command-alist
  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             ` Reinhard Kotucha
  2004-10-06 17:10             ` dired-view-command-alist Richard Stallman
  2 siblings, 0 replies; 26+ messages in thread
From: Reinhard Kotucha @ 2004-10-05 21:14 UTC (permalink / raw)
  Cc: Juri Linkov, emacs-devel, rms, Miles Bader

>>>>> "David" == David Kastrup <dak@gnu.org> writes:

    > Perhaps it would be more straightforward to just insert the file
    > names themselves (shell-quoted, of course).

If you have marked hundreds of files I think that it is confusing if
they all appear in the minibufer.

I must admit that this is more straightforward, but in my opinion the
minibuffer shouldn't be larger than one line if possible.

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

* Re: dired-view-command-alist
  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 13:38           ` dired-view-command-alist Robert J. Chassell
@ 2004-10-05 21:41           ` Reinhard Kotucha
  2004-10-06  1:31             ` dired-view-command-alist Miles Bader
  2 siblings, 1 reply; 26+ messages in thread
From: Reinhard Kotucha @ 2004-10-05 21:41 UTC (permalink / raw)
  Cc: Juri Linkov, Reinhard Kotucha, rms, emacs-devel

>>>>> "Miles" == Miles Bader <miles@gnu.org> writes:

    > I disagree -- I find the "[3 files]" info useful.  Despite the
    > filenames being displayed in a separate, the presence of that
    > string in the prompt is more noticeable (maybe that sounds
    > surprising, but when I give a command that I know is going to
    > prompt me, I tend to focus on the minibuffer, so a warning there
    > is much more likely to wake me up than a new window).

In my example the separate window displayed the three files within one
line followed by two empty lines.  

Maybe the two empty lines are the reason it didn't attract your
attention.

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

* Re: dired-view-command-alist
  2004-10-05 21:41           ` dired-view-command-alist Reinhard Kotucha
@ 2004-10-06  1:31             ` Miles Bader
  0 siblings, 0 replies; 26+ messages in thread
From: Miles Bader @ 2004-10-06  1:31 UTC (permalink / raw)
  Cc: Juri Linkov, rms, emacs-devel

Reinhard Kotucha <reinhard.kotucha@web.de> writes:
> In my example the separate window displayed the three files within one
> line followed by two empty lines.  
>
> Maybe the two empty lines are the reason it didn't attract your
> attention.

No, I don't think so -- though it may contribute.  It's simply that a
marker in the prompt is _much_ more noticeable when your attention is
focused there.

This is a fairly important issue, BTW.  It's not that hard to
inadvertantly use a command intending for it to be used on the current
file without realizing that you had some marks set, and the possibility
for damage is great.

-Miles
-- 
I'd rather be consing.

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

* Re: dired-view-command-alist
  2004-10-05  0:31       ` dired-view-command-alist Reinhard Kotucha
  2004-10-05  7:43         ` dired-view-command-alist Miles Bader
@ 2004-10-06  5:29         ` Richard Stallman
  2004-10-06 19:17           ` dired-view-command-alist Reinhard Kotucha
  2004-10-07  6:00         ` dired-view-command-alist Juri Linkov
  2004-10-08 15:51         ` dired-view-command-alist Kai Grossjohann
  3 siblings, 1 reply; 26+ messages in thread
From: Richard Stallman @ 2004-10-06  5:29 UTC (permalink / raw)
  Cc: juri, emacs-devel

    ! on * [3 files]: {3 guesses} [ghostview]

What does {3 guesses} mean here?

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

* Re: dired-view-command-alist
  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             ` Richard Stallman
  2 siblings, 0 replies; 26+ messages in thread
From: Richard Stallman @ 2004-10-06 17:10 UTC (permalink / raw)
  Cc: juri, reinhard.kotucha, emacs-devel, miles

    An a different tack, one of my proposals was to bind * to inserting a
    text propertied string showing <marked files> or so.

The problem is for ?.  We could make ? appear as <one file>,
and * as <all files> for consistency.   This does not depend on
faces, so it will always work.

What do people think of that?

							  Perhaps it would
    be more straightforward to just insert the file names themselves
    (shell-quoted, of course).

That is too long, and anyway it would not work for `?'.

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

* Re: dired-view-command-alist
  2004-10-06  5:29         ` dired-view-command-alist Richard Stallman
@ 2004-10-06 19:17           ` Reinhard Kotucha
  2004-10-07 16:45             ` dired-view-command-alist Richard Stallman
  0 siblings, 1 reply; 26+ messages in thread
From: Reinhard Kotucha @ 2004-10-06 19:17 UTC (permalink / raw)
  Cc: juri, emacs-devel

>>>>> "Richard" == Richard Stallman <rms@gnu.org> writes:

    >     ! on * [3 files]: {3 guesses} [ghostview] 

    > What does {3 guesses} mean here?

It means that there are 3 commands in the history for the particular
type of files.

In this case (for *.ps) that are ghostview, xloadimage and lpr.
If you press RET you get ghostview, but you can get the other ones if
you go into the command history.

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

* Re: dired-view-command-alist
  2004-10-05  0:31       ` dired-view-command-alist Reinhard Kotucha
  2004-10-05  7:43         ` dired-view-command-alist Miles Bader
  2004-10-06  5:29         ` dired-view-command-alist Richard Stallman
@ 2004-10-07  6:00         ` Juri Linkov
  2004-10-08 15:51         ` dired-view-command-alist Kai Grossjohann
  3 siblings, 0 replies; 26+ messages in thread
From: Juri Linkov @ 2004-10-07  6:00 UTC (permalink / raw)
  Cc: rms, emacs-devel

Reinhard Kotucha <reinhard.kotucha@web.de> writes:
> Furthermore, I think that "[ghostcript]" should be displayed only
> after you pressed "!" and should disappear as soon as you press the
> <up> key.

Just use minibuffer-electric-default-mode.

However, it doesn't work correctly with the current dired-x prompt
due to its non-standard syntax.  minibuffer-electric-default-mode
changes this prompt:

! on * [3 files]: {3 guesses} [ghostview]

into

! on * 

i.e. it deletes everything between the first and the last bracket.

I think with omitting the useless number of guesses, the prompt
should look like:

! on * (3 files) [ghostview]: 

or

! on * {3 files} (default ghostview): 

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

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

* Re: dired-view-command-alist
  2004-10-06 19:17           ` dired-view-command-alist Reinhard Kotucha
@ 2004-10-07 16:45             ` Richard Stallman
  0 siblings, 0 replies; 26+ messages in thread
From: Richard Stallman @ 2004-10-07 16:45 UTC (permalink / raw)
  Cc: juri, emacs-devel

	> What does {3 guesses} mean here?

    It means that there are 3 commands in the history for the particular
    type of files.

Now I understand.  However, I think people often won't understand.
Inserting `command ' before `guesses' would make it clearer, if there
is room.

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

* Re: dired-view-command-alist
  2004-10-05  0:31       ` dired-view-command-alist Reinhard Kotucha
                           ` (2 preceding siblings ...)
  2004-10-07  6:00         ` dired-view-command-alist Juri Linkov
@ 2004-10-08 15:51         ` Kai Grossjohann
  2004-10-08 18:48           ` dired-view-command-alist Juri Linkov
  3 siblings, 1 reply; 26+ messages in thread
From: Kai Grossjohann @ 2004-10-08 15:51 UTC (permalink / raw)


Reinhard Kotucha <reinhard.kotucha@web.de> writes:

> Furthermore, I think that "[ghostcript]" should be displayed only
> after you pressed "!" and should disappear as soon as you press the
> <up> key.

I think the now-standard way for providing a "default" value is to
make it accessible via M-n.  Perhaps dired could make several commands
accessible via M-n?  M-n once would get the default one, M-n twice
would get the next one and so on.

Another idea is to provide "ghostscript" as the default contents of
the minibuffer, ready for editing.

What do people think?

Kai

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

* Re: dired-view-command-alist
  2004-10-08 15:51         ` dired-view-command-alist Kai Grossjohann
@ 2004-10-08 18:48           ` Juri Linkov
  0 siblings, 0 replies; 26+ messages in thread
From: Juri Linkov @ 2004-10-08 18:48 UTC (permalink / raw)
  Cc: emacs-devel

Kai Grossjohann <kai@emptydomain.de> writes:
> I think the now-standard way for providing a "default" value is to
> make it accessible via M-n.  Perhaps dired could make several commands
> accessible via M-n?  M-n once would get the default one, M-n twice
> would get the next one and so on.

I already provided a patch for that some time ago:

http://lists.gnu.org/archive/html/emacs-devel/2004-05/msg01755.html

and Richard agreed to install it if the manual and NEWS are updated
accordingly.  But I haven't installed it yet because I started to
look for other places where multiple default values could be useful.
So far I collected a few cases like C-x b providing a list of recent
buffers accessible via M-n (which required some changes in .c and .h
files) and so on.

I think the best plan for now is to install basic changes with updates
in NEWS and documentation, and consider patches for separate cases later.

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

^ 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

* Re: dired-view-command-alist
  2005-01-03 19:27 dired-view-command-alist Sam Steingold
@ 2005-01-04  3:38 ` Richard Stallman
  2005-01-04  9:03   ` dired-view-command-alist Juri Linkov
  2005-01-04 14:38   ` dired-view-command-alist Sam Steingold
  0 siblings, 2 replies; 26+ messages in thread
From: Richard Stallman @ 2005-01-04  3:38 UTC (permalink / raw)
  Cc: emacs-devel

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

    why?

The plan is to replace that with a better implementation that already
exists.

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

* Re: dired-view-command-alist
  2005-01-04  3:38 ` dired-view-command-alist Richard Stallman
@ 2005-01-04  9:03   ` Juri Linkov
  2005-01-05  3:30     ` dired-view-command-alist Richard Stallman
  2005-01-04 14:38   ` dired-view-command-alist Sam Steingold
  1 sibling, 1 reply; 26+ messages in thread
From: Juri Linkov @ 2005-01-04  9:03 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:
> The plan is to replace that with a better implementation that already
> exists.

The plan to replace that with Gnus mailcap functions has
several problems:

1. Moving MIME-related files out of Gnus and eliminating the
dependencies is a too drastic change.

Maybe at least now we could put code that uses Gnus functions
in dired.el and call it conditionally when `mailcap' and `mm-decode'
are available?

2. Mailcap may contain different commands for viewing a file.
Before running one of them, dired should ask the user which command to run.
Even if there is only one command, dired should ask for confirmation
and allow the user to edit that command.

A user interface for that already exists in `dired-guess-default' in
dired-x.el.  But there is one difference: dired uses ? and *
to substitute file names in shell commands, while mailcap uses %s.
Using %s instead of special markers ? and * in Dired shell commands
might solve the problem of their ambiguity where the same symbol
is used for the list of Dired file names or shell wildcards.

3. Usually a list of commands in mailcap is incomplete.
Dired should provide an option to extend it.  A good starting point
is `dired-guess-shell-alist-default' in dired-x.

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

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

* Re: dired-view-command-alist
  2005-01-04  3:38 ` dired-view-command-alist Richard Stallman
  2005-01-04  9:03   ` dired-view-command-alist Juri Linkov
@ 2005-01-04 14:38   ` Sam Steingold
  2005-01-04 19:54     ` dired-view-command-alist Richard Stallman
  1 sibling, 1 reply; 26+ messages in thread
From: Sam Steingold @ 2005-01-04 14:38 UTC (permalink / raw)
  Cc: emacs-devel

> * Richard Stallman <ezf@tah.bet> [2005-01-03 22:38:23 -0500]:
>
>     * dired.el (dired-view-command-alist): Variable deleted.
> 	    (dired-view-file, dired-mouse-find-file-other-window):
> 	    Delete the code to use it.
>
>     why?
>
> The plan is to replace that with a better implementation that already
> exists.

So, what exactly do I use instead of `dired-view-command-alist'?

PS.  etc/NEWS still mentions it.

-- 
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>
Experience comes with debts.

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

* Re: dired-view-command-alist
  2005-01-04 14:38   ` dired-view-command-alist Sam Steingold
@ 2005-01-04 19:54     ` Richard Stallman
  0 siblings, 0 replies; 26+ messages in thread
From: Richard Stallman @ 2005-01-04 19:54 UTC (permalink / raw)
  Cc: emacs-devel

    So, what exactly do I use instead of `dired-view-command-alist'?

The replacement is not installed yet.  The idea is to move the code in
gnus-dired.el and mailcap.el out of Gnus and make ordinary Dired use
it.  This feature is much better than dired-view-command-alist.

We're waiting for someone to make the change.
Would you like to work on it?

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

* Re: dired-view-command-alist
  2005-01-04  9:03   ` dired-view-command-alist Juri Linkov
@ 2005-01-05  3:30     ` Richard Stallman
  0 siblings, 0 replies; 26+ messages in thread
From: Richard Stallman @ 2005-01-05  3:30 UTC (permalink / raw)
  Cc: emacs-devel

    1. Moving MIME-related files out of Gnus and eliminating the
    dependencies is a too drastic change.

Why do you think so?

    2. Mailcap may contain different commands for viewing a file.
    Before running one of them, dired should ask the user which command to run.
    Even if there is only one command, dired should ask for confirmation
    and allow the user to edit that command.

I agree.

    A user interface for that already exists in `dired-guess-default' in
    dired-x.el.  But there is one difference: dired uses ? and *
    to substitute file names in shell commands, while mailcap uses %s.

    Using %s instead of special markers ? and * in Dired shell commands
    might solve the problem of their ambiguity where the same symbol
    is used for the list of Dired file names or shell wildcards.

It might be a good solution, but this is a substantial incompatibility.
Not big enough that I should reject it immediately, but big enough
we need to see what other people think about the change.

What do others think?

^ 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 --
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
  -- strict thread matches above, loose matches on Subject: below --
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

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