From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Eure Newsgroups: gmane.emacs.help Subject: Re: emulate bash's M-. in *shell* Date: Tue, 9 Jun 2009 22:44:32 -0700 Message-ID: <9059181A-D950-4A0B-AF86-A6FA61B465E7@digg.com> References: <874oupkpcj.fsf@jidanni.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1244612718 23123 80.91.229.12 (10 Jun 2009 05:45:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jun 2009 05:45:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: jidanni@jidanni.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 10 07:45:14 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MEGca-0006KX-SM for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jun 2009 07:45:13 +0200 Original-Received: from localhost ([127.0.0.1]:33451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEGcZ-00035R-PY for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Jun 2009 01:45:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEGc6-00034m-DX for help-gnu-emacs@gnu.org; Wed, 10 Jun 2009 01:44:42 -0400 Original-Received: from [199.232.76.173] (port=46905 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEGc5-000341-Ky for help-gnu-emacs@gnu.org; Wed, 10 Jun 2009 01:44:41 -0400 Original-Received: from mail.digg.com ([64.191.203.36]:37097) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MEGc5-0002c2-9L for help-gnu-emacs@gnu.org; Wed, 10 Jun 2009 01:44:41 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id 9A585A85760; Tue, 9 Jun 2009 22:44:39 -0700 (PDT) X-Virus-Scanned: amavisd-new at X-Spam-Score: 6.341 Original-Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Uu3HI8H8o7Fk; Tue, 9 Jun 2009 22:44:34 -0700 (PDT) Original-Received: from 169.sub-70-210-236.myvzw.com (169.sub-70-210-236.myvzw.com [70.210.236.169]) by mail.digg.com (Postfix) with ESMTP id 40BD3A85697; Tue, 9 Jun 2009 22:44:34 -0700 (PDT) In-Reply-To: <874oupkpcj.fsf@jidanni.org> X-Mailer: Apple Mail (2.935.3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65107 Archived-At: 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