unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* M-! in dired-mode
@ 2007-11-30 23:15 Paul Pogonyshev
  2007-12-01  0:32 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Pogonyshev @ 2007-11-30 23:15 UTC (permalink / raw)
  To: emacs-devel

Hi,

M-! runs `shell-command' in `dired-mode'.  However, I cannot figure
when it runs on file under point and when without a file at all, it
seems to be completely random.  I mean, the buffer prompt does
unambigously say whether it will be run on a file or not, but that
prompt itself varies for no apparent reason and I couldn't find
anything in help...

Can anyone enlighten me (or just point to correct info node)?

Paul

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

* Re: M-! in dired-mode
  2007-11-30 23:15 M-! in dired-mode Paul Pogonyshev
@ 2007-12-01  0:32 ` Juri Linkov
  2007-12-01  9:28   ` David Kastrup
  2007-12-01 16:17   ` Paul Pogonyshev
  0 siblings, 2 replies; 4+ messages in thread
From: Juri Linkov @ 2007-12-01  0:32 UTC (permalink / raw)
  To: Paul Pogonyshev; +Cc: emacs-devel

> M-! runs `shell-command' in `dired-mode'.  However, I cannot figure
> when it runs on file under point and when without a file at all, it
> seems to be completely random.  I mean, the buffer prompt does
> unambigously say whether it will be run on a file or not, but that
> prompt itself varies for no apparent reason and I couldn't find
> anything in help...
>
> Can anyone enlighten me (or just point to correct info node)?

`M-!' doesn't operate on dired files, but ! operates on files under
point with the prompt displaying their names.  So there is a clear
distinction: `!' works only in dired on its files, and `M-!' is a global
command.  My latest week-old unconfirmed patches provide a default value
for the command `M-!': when it is called in a file buffer then the
default value contains the current buffer's file name.  But it could be
improved also in a way that if `M-!' is called in a dired buffer, then
its default value could be a file under point in dired.

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

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

* Re: M-! in dired-mode
  2007-12-01  0:32 ` Juri Linkov
@ 2007-12-01  9:28   ` David Kastrup
  2007-12-01 16:17   ` Paul Pogonyshev
  1 sibling, 0 replies; 4+ messages in thread
From: David Kastrup @ 2007-12-01  9:28 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel, Paul Pogonyshev

Juri Linkov <juri@jurta.org> writes:

>> M-! runs `shell-command' in `dired-mode'.  However, I cannot figure
>> when it runs on file under point and when without a file at all, it
>> seems to be completely random.  I mean, the buffer prompt does
>> unambigously say whether it will be run on a file or not, but that
>> prompt itself varies for no apparent reason and I couldn't find
>> anything in help...
>>
>> Can anyone enlighten me (or just point to correct info node)?
>
> `M-!' doesn't operate on dired files, but ! operates on files under
> point with the prompt displaying their names.  So there is a clear
> distinction: `!' works only in dired on its files, and `M-!' is a global
> command.

I would have wanted to write the same, however:

    M-! (translated from <escape> !) runs the command dired-smart-shell-command
      which is an interactive compiled Lisp function in `dired-x.el'.
    It is bound to M-!.
    (dired-smart-shell-command CMD &optional INSERT)

    Like function `shell-command', but in the current Virtual Dired directory.

So I don't really know what that does.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: M-! in dired-mode
  2007-12-01  0:32 ` Juri Linkov
  2007-12-01  9:28   ` David Kastrup
@ 2007-12-01 16:17   ` Paul Pogonyshev
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Pogonyshev @ 2007-12-01 16:17 UTC (permalink / raw)
  To: emacs-devel; +Cc: Juri Linkov

Juri Linkov wrote:
> > M-! runs `shell-command' in `dired-mode'.  However, I cannot figure
> > when it runs on file under point and when without a file at all, it
> > seems to be completely random.  I mean, the buffer prompt does
> > unambigously say whether it will be run on a file or not, but that
> > prompt itself varies for no apparent reason and I couldn't find
> > anything in help...
> >
> > Can anyone enlighten me (or just point to correct info node)?
> 
> `M-!' doesn't operate on dired files, but ! operates on files under
> point with the prompt displaying their names.  So there is a clear
> distinction: `!' works only in dired on its files, and `M-!' is a global
> command.  My latest week-old unconfirmed patches provide a default value
> for the command `M-!': when it is called in a file buffer then the
> default value contains the current buffer's file name.  But it could be
> improved also in a way that if `M-!' is called in a dired buffer, then
> its default value could be a file under point in dired.

Ah, that's explain it.  At work I have a keyboard with bad left Alt key,
so it seems randomness just plays when I try to press M-! and it comes
through as just ! (withot Meta).  Somehow I never considered this
possibility.  Sorry for false alarm :-/

Paul

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

end of thread, other threads:[~2007-12-01 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-30 23:15 M-! in dired-mode Paul Pogonyshev
2007-12-01  0:32 ` Juri Linkov
2007-12-01  9:28   ` David Kastrup
2007-12-01 16:17   ` Paul Pogonyshev

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