all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emulate bash's M-. in *shell*
@ 2009-06-09 22:35 jidanni
  2009-06-10  5:44 ` Ian Eure
  0 siblings, 1 reply; 3+ messages in thread
From: jidanni @ 2009-06-09 22:35 UTC (permalink / raw)
  To: help-gnu-emacs

In bash I can do ESC . which outputs the last line's last item.
How can I do that in emacs *shell*?


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

* Re: emulate bash's M-. in *shell*
  2009-06-09 22:35 emulate bash's M-. in *shell* jidanni
@ 2009-06-10  5:44 ` Ian Eure
  2009-06-10  5:59   ` jidanni
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Eure @ 2009-06-10  5:44 UTC (permalink / raw)
  To: jidanni; +Cc: help-gnu-emacs

On Jun 9, 2009, at 3:35 PM, jidanni@jidanni.org wrote:

> In bash I can do ESC . which outputs the last line's last item.
> How can I do that in emacs *shell*?
Use the !$ event:

ieure!electron:~$ mkdir /tmp/foo
ieure!electron:~$ ls -ld !$
ls -ld /tmp/foo
drwxr-xr-x 2 ieure wheel 68 2009-06-09 22:37 /tmp/foo/
ieure!electron:~$

You can also use !^ for the first argument, or !!:N for the Nth last  
argument. Section 9.3.2 of the bash manual has the full rundown,  
though it's somewhat lacking in practical examples.

  - Ian




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

* Re: emulate bash's M-. in *shell*
  2009-06-10  5:44 ` Ian Eure
@ 2009-06-10  5:59   ` jidanni
  0 siblings, 0 replies; 3+ messages in thread
From: jidanni @ 2009-06-10  5:59 UTC (permalink / raw)
  To: ian; +Cc: help-gnu-emacs

Ian Eure <ian@digg.com> writes:
>> In bash I can do ESC . which outputs the last line's last item.
>> How can I do that in emacs *shell*?
> Use the !$ event:
> You can also use !^ for the first argument, or !!:N for the Nth last

Thanks but being half a century old, M-. is already embedded in my
brain, so I wish to make emacs act like bash in this area.

Furthermore, I turned off all that ! stuff in bash long ago, as maybe
back in csh it was needed, but now with readline, all it did was add
landmines.

But true, M-. is just the measly last argument, the ! stuff gives one
all of them.

Wait,
  C-c . runs the command comint-insert-previous-argument
  ...This command is like `M-.' in bash.

OK, I'll just rebind that. Thanks. Bye.




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

end of thread, other threads:[~2009-06-10  5:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-09 22:35 emulate bash's M-. in *shell* jidanni
2009-06-10  5:44 ` Ian Eure
2009-06-10  5:59   ` jidanni

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.