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: Keyboard macro with Isearch Date: Tue, 09 Aug 2005 22:40:38 -0400 Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1123642596 26894 80.91.229.2 (10 Aug 2005 02:56:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Aug 2005 02:56:36 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 10 04:56:34 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E2gko-0003tG-AK for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Aug 2005 04:55:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2gnt-0002kp-5x for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Aug 2005 22:58:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E2gnD-0002eO-6T for help-gnu-emacs@gnu.org; Tue, 09 Aug 2005 22:58:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E2gn3-0002YT-Ba for help-gnu-emacs@gnu.org; Tue, 09 Aug 2005 22:58:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2gn3-0002XW-1L for help-gnu-emacs@gnu.org; Tue, 09 Aug 2005 22:58:01 -0400 Original-Received: from [132.198.104.164] (helo=webteam-dvd) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E2gnn-0007du-R3 for help-gnu-emacs@gnu.org; Tue, 09 Aug 2005 22:58:48 -0400 Original-Received: from ashawley by webteam-dvd with local (Exim 3.36 #1 (Debian)) id 1E2gWE-0005tZ-00 for ; Tue, 09 Aug 2005 22:40:38 -0400 Original-To: help-gnu-emacs@gnu.org 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:28604 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