From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Aaron S. Hawley" Newsgroups: gmane.emacs.help Subject: Re: Keyboard macro with Isearch Date: Mon, 22 Aug 2005 13:55:59 -0400 (EDT) Organization: University of Vermont Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1124733799 22755 80.91.229.2 (22 Aug 2005 18:03:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Aug 2005 18:03:19 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 22 20:03:12 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E7GZs-0002Nx-K4 for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Aug 2005 19:59:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E7GcQ-0006YI-0R for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Aug 2005 14:01:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E7Gbb-0006Ob-5h for help-gnu-emacs@gnu.org; Mon, 22 Aug 2005 14:01:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E7GbU-0006Kv-JS for help-gnu-emacs@gnu.org; Mon, 22 Aug 2005 14:01:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E7GbU-0006KT-EK for help-gnu-emacs@gnu.org; Mon, 22 Aug 2005 14:01:00 -0400 Original-Received: from [132.198.101.202] (helo=pony.uvm.edu) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1E7GXI-0002Dn-HT for help-gnu-emacs@gnu.org; Mon, 22 Aug 2005 13:56:40 -0400 Original-Received: from elk.uvm.edu (elk.uvm.edu [132.198.101.63]) by pony.uvm.edu (8.12.11/8.12.11) with ESMTP id j7MHtx9X018999 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 22 Aug 2005 13:56:00 -0400 X-X-Sender: ashawley@elk.uvm.edu Original-To: help-gnu-emacs@gnu.org In-Reply-To: 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:28916 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28916 After the confusion from my original post, I am still looking for a solution to the "keyboard macros with Isearch" problem. Kevin Boyd's response though not helpful for my problem does show exactly what the problem is with Isearch. If one wanted an Emacs macro using Isearch to terminate a search, then one could explicityly add `RET' (or for Kevin `C-m') to terminate the search. But even without `RET', a macro using search terminates the search when the macro ends, rather than keeping the search interactive. I wrote on 9 August 2005: > Isearch doesn't play nice with keyboard macros. > > One of the simplest macros that could use Isearch would to be a simple > call of isearch-forward using C-s. The macro could be created with: > > C-x ( C-s C-x ) C-x C-k b C-. > > or evaluating: > > (global-set-key [?\C-.] "\C-s") > > Unfortunately, calling such a macro causes Isearch to halt taking > input rather than stay "interactive" and take input from the user for > the search string and continue highlighting any matches. > > The above is admittedly not a useful example, but I'm interested how > to store specific interactive searches with Isearch as macros, like > `C-s C-w' or anything more complicated, and then bounding them to > shorter key sequences like `C-.' or . Using the `C-s C-w' > example: > > C-x ( C-s C-w C-x ) C-x C-k b C-. > > or evaluating: > > (global-set-key [?\C-.] "\C-s\C-w") > > The search works by going to the end of the current word, but halts > and gives the message, "Mark saved where search started". > > It's not clear to me how create customizations for calling Isearch, > unless you use not only Emacs Lisp but make hacks useing Isearch's > internals. > > This code in the function isearch-done in file isearch.el looks like > at least one suspect for bias against macros: > > (or executing-kbd-macro (> (minibuffer-depth) 0) > (message "Mark saved where search started")))))) > > /a