From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorge Alberto Garcia Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] add emacsclient support to open with file:linum syntax Date: Fri, 8 Jan 2016 10:13:01 -0600 Message-ID: References: <838u40qw8j.fsf@gnu.org> <837fjkozax.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1452269640 30050 80.91.229.3 (8 Jan 2016 16:14:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Jan 2016 16:14:00 +0000 (UTC) Cc: Eli Zaretskii , Yuri Khan , Emacs developers To: Kaushal Modi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 08 17:13:59 2016 Return-path: Envelope-to: ged-emacs-devel@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 1aHZfq-0000Xh-Kc for ged-emacs-devel@m.gmane.org; Fri, 08 Jan 2016 17:13:58 +0100 Original-Received: from localhost ([::1]:37078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHZfp-00027H-Rv for ged-emacs-devel@m.gmane.org; Fri, 08 Jan 2016 11:13:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHZfc-000279-A7 for emacs-devel@gnu.org; Fri, 08 Jan 2016 11:13:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHZfb-0004gz-A0 for emacs-devel@gnu.org; Fri, 08 Jan 2016 11:13:44 -0500 Original-Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:34078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHZfZ-0004gl-J5; Fri, 08 Jan 2016 11:13:41 -0500 Original-Received: by mail-oi0-x229.google.com with SMTP id k206so13629763oia.1; Fri, 08 Jan 2016 08:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=W6AWbKmoVI9QnyahbyhmhHu5ZWqdq6OhJBDYnvHZ9To=; b=Sm3r6+6jFY/16I4ygA8pEiAvTEMXrWggkB0mfaRl2KFlzg2QdvJE7e89W543IGZkPr LvdTHgAXMBurPZMr6pY1LPfnKJfD8TE5eUN7/LjsSHowZbac7Z04hg12Pm8W9XXJa7Kd 7V6A53CC19gLRedFmu/CxFU+sZZ4PmCzFXBhd79R6rkNxh0XEPpLu+LepFVLI8FTgX5f ATHtE2holH5Hv0Hy7Veo9j4U6pzgCplMQj3KPVY+/p8X16Y58ZtMyzn5+Fgvndbhpihm 7RZU4atdaN+8MexJvVDtQjjKwxWgHnKIxDeJrsyWfnWPcVN5qedbOAVABRKhOqyXQMp4 jQ2Q== X-Received: by 10.202.221.65 with SMTP id u62mr79897957oig.30.1452269621199; Fri, 08 Jan 2016 08:13:41 -0800 (PST) Original-Received: by 10.202.92.213 with HTTP; Fri, 8 Jan 2016 08:13:01 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197836 Archived-At: On Fri, Jan 8, 2016 at 9:54 AM, Kaushal Modi wrote: > As Yuri said, I just have a wrapper to provide the line number to > emacsclient appropriately. > > Here's my csh alias: > > ===== > > # (P)ercol $SEARCHLOG created by (AG)/ack and open emacs at matched (L)ine > # below alias helps quickly open one of the files from the list of files > # that matched the last 'ag'. Awesomeness is that the file opens in emacs > # at the matched line! > alias pagl 'cat ${SEARCHLOG} | percol --query=\!* | \\ > (e2 `awk -F: '"'"'{ if ( $2 ) {print "+" $2 " " $1} else {print} > }'"'"'` &)' > > ===== > Hi!, I think you got it right and I would like to provide this awesomeness to all users like us who will be happy to use it on emacsclient directly. > (1) > > $SEARCHLOG is a temporary file containing the output of ag[1] > > Here's a sample $SEARCHLOG file: > > setup-misc.el:226: ("C-t" toggle-theme) > setup-htmlize.el:23: ;; theme, the squiggly underlines can either show > up in the html file > setup-fci.el:66:Running this function after changing themes updates the fci > rule color in > setup-linum.el:41:background color to that of the theme." > setup-visual.el:13:;; Themes > setup-visual.el:46:(defvar dark-theme t > setup-visual.el:47: "Variable to store the nature of theme whether it is > light or dark. > setup-visual.el:48:This variable is to be updated when changing themes.") > > (2) > > percol[2] is a command line utility to allow ido-vertical-like selection > from terminal > > (3) > > e2 is my alias for "emacsclient -a '' \!* >& /dev/null" > > (4) > > That awk snippet is what rearranges the FILE:LINENUM in $SEARCHLOG to > +LINENUM FILE when providing the arguments to e2. > > [1]: https://github.com/ggreer/the_silver_searcher > [2]: https://github.com/mooz/percol > >