From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: despen@verizon.net Newsgroups: gmane.emacs.help Subject: Re: emulate readline Date: Wed, 06 Apr 2011 19:44:57 -0400 Organization: A noiseless patient Spider Message-ID: References: <83bp0juult.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1302138143 16512 80.91.229.12 (7 Apr 2011 01:02:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2011 01:02:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 07 03:02:17 2011 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.69) (envelope-from ) id 1Q7dc0-00079I-Ju for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Apr 2011 03:02:16 +0200 Original-Received: from localhost ([127.0.0.1]:48645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7dGq-0006FZ-3r for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Apr 2011 20:40:24 -0400 Original-Path: usenet.stanford.edu!news-transit.tcx.org.uk!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Injection-Info: mx02.eternal-september.org; posting-host="jHG/q4CDuHQ12inYDCpZIQ"; logging-data="1961"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zborTkKp6Yo8EmVCzUeEbKiUJJ46nq1Q=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:/A87jdEq8aGs5/dpm8FGB80vgmU= sha1:wBqrcDpY06ISE+UVA8Kdxq5h2vs= Original-Xref: usenet.stanford.edu gnu.emacs.help:186534 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:80646 Archived-At: fork writes: > verizon.net> writes: > >> By default the up arrow just goes to the previous element. > > Yes. > >> This is close but not right: >> >> (define-key minibuffer-local-map [(up)] 'previous-matching-history-element) > > Cool! > > Is there a way to pass the text currently in the minibuffer to a function (which > would be bound to "up" like the above)? Well, I just tried what seemed "intuitive" and it seems to work. I typed: M-x then m C-r That gave me a prompt for isearch backwards with the "m" already in place. I hit C-r again and it pulled out the command I was looking for "man". Then I hit return and got the completed M-x prompt where I could then run the command. Try it. I think there's an option about nesting commands in the mini-buffer that you may have to enable. I have this: (setq minibuffer-max-depth nil)