From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Visher Newsgroups: gmane.emacs.help Subject: `universal-argument` from isearch minibuffer? Date: Thu, 30 May 2013 22:25:19 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1369967170 25485 80.91.229.3 (31 May 2013 02:26:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 May 2013 02:26:10 +0000 (UTC) To: emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 31 04:26:12 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UiF2i-00048M-M9 for geh-help-gnu-emacs@m.gmane.org; Fri, 31 May 2013 04:26:12 +0200 Original-Received: from localhost ([::1]:39131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiF2h-0003Uk-T1 for geh-help-gnu-emacs@m.gmane.org; Thu, 30 May 2013 22:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiF2X-0003UN-Qm for help-gnu-emacs@gnu.org; Thu, 30 May 2013 22:26:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UiF2W-0001x7-Ns for help-gnu-emacs@gnu.org; Thu, 30 May 2013 22:26:01 -0400 Original-Received: from mail-vb0-x22d.google.com ([2607:f8b0:400c:c02::22d]:60376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiF2W-0001x2-D7 for help-gnu-emacs@gnu.org; Thu, 30 May 2013 22:26:00 -0400 Original-Received: by mail-vb0-f45.google.com with SMTP id 12so688324vbf.32 for ; Thu, 30 May 2013 19:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=XgcsOlcUDijRoH8+dd2rts9wk3y+Pq1HmviTE2vQdT0=; b=RIowrW0+yxL6ARGsUuxMV5DpBh2INMstDfnE1bLUm8/e1zbJJtVDhcJXaX66H+yMTI 2LVYR2mBKJAdONLz2pOoKnPXQhNMxgSyyCDxZrHs7aw3/mdR7/Mi99YwgKCD8myYyv/4 NRFILIugHBtLy3ull0FkYABIiBqS4PZvRSF5dhB5wZx7LLZ77FKihLkOtJyU6819BDFY bs5i5EVjR17mQTe7vT9KTJ4rF6tlMvsFHaIdZFmrVMhrhXSVs4rir8I5lEogEylDjiOu 224LMgcODK0hv21rhPLNnO7EOgjNW2g15YqFGvu9/WgfeYIn6u9mP+9KAImQEd9q8i7A 4qIQ== X-Received: by 10.52.233.199 with SMTP id ty7mr6788017vdc.122.1369967159871; Thu, 30 May 2013 19:25:59 -0700 (PDT) Original-Received: by 10.220.57.201 with HTTP; Thu, 30 May 2013 19:25:19 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c02::22d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91191 Archived-At: Hi All, I'm hacking up a way to get my current isearch term into the ack prompt: https://gist.github.com/timvisher/5682600 My question is whether or not it's possible to affect the current-prefix-arg when you're already in the isearch minibuffer. `ack` behaves differently when the prefix arg is set differently so my hope was to be able to press C-s search-term [C-u]* C-c r g and get my prompt. Unfortunately, `C-u` promptly exits isearch. I've included the code below that is available in the gist for easy reference. Thanks in advance! (defun timvisher/ack-from-root (arg regexp) (interactive "P") (let ((current-prefix-arg (cond ((not arg) 4) ((= 4 (car arg)) 16) ((<= 16 (car arg)) nil)))) (call-interactively 'ack))) (defun timvisher/isearch-ack-from-root (arg regexp) (interactive (list current-prefix-arg (cond ((functionp isearch-word) (funcall isearch-word isearch-string)) (isearch-word (word-search-regexp isearch-string)) (isearch-regexp isearch-string) (t (regexp-quote isearch-string))))) (let ((ack-command (concat "ag " regexp)) (current-prefix-arg 4)) (isearch-done nil) (isearch-clean-overlays) (call-interactively 'ack))) (define-key isearch-mode-map (kbd "C-c r g") 'timvisher/isearch-ack-from-root) -- In Christ, Timmy V. http://blog.twonegatives.com/ http://five.sentenc.es/ -- Spend less time on mail