unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jorge Alberto Garcia <jorge.garcia.gonzalez@gmail.com>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: [PATCH] add emacsclient support to open with file:linum syntax
Date: Fri, 8 Jan 2016 08:11:10 -0600	[thread overview]
Message-ID: <CAPfrtUcwZZMKR6x1xdKoszFcqcD0=-5S1W7xwA6oVGH01ED_bA@mail.gmail.com> (raw)
In-Reply-To: <CAP_d_8Uhbx_LUzRpf9G5Hc-xVw2y-ocTe7p7dDLo8qtA8GA03w@mail.gmail.com>

On Fri, Jan 8, 2016 at 2:59 AM, Yuri Khan <yuri.v.khan@gmail.com> wrote:
> On Fri, Jan 8, 2016 at 2:08 PM, Jorge Alberto Garcia
>> We could extend the meaning of  '+' to indicate a linenum:column will
>> be present,
>> So we could use one of these syntax:
>>
>> (new)      emacsclient  +  filepath:LINENUM:COL
>> (current) emacsclient  +LINENUM:COL filepath
>
> Or, you could solve your specific use case with a wrapper script and
> keep emacsclient’s CLI simple and unambiguous and avoid the need to
> invent more syntax.
>
> The script could look like this (which is not sophisticated enough to
> handle :DIGITS in options and may especially interfere with the
> --display option, but will get you a long way):
>
> ```
> #!/usr/bin/python
>
> import itertools
> import re
> import sys
> import subprocess
>
> RE_LINE_COL = re.compile(r'^(.*?)((?::[0-9]+){,2})$')
>
> sys.exit(subprocess.call(itertools.chain(
>     ['emacsclient'],
>     *[['+%s' % line_col[1:], filename] if line_col else [filename]
>        for arg in sys.argv[1:]
>        for filename, line_col in RE_LINE_COL.findall(arg)]))
> ```

I actually like this approach, I wrote and similar wrapper some time
ago tho this one
is more sophisticate


I guess this was my reason of why I wrote this patch, this way people
don't need to write scripts for something
like that, that as you mention can be more complex due to the digits handling.



  reply	other threads:[~2016-01-08 14:11 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 22:35 [PATCH] add emacsclient support to open with file:linum syntax Jorge Alberto Garcia
2016-01-08  7:42 ` Yuri Khan
2016-01-08  8:08   ` Jorge Alberto Garcia
2016-01-08  8:59     ` Yuri Khan
2016-01-08 14:11       ` Jorge Alberto Garcia [this message]
2016-01-08  9:03   ` Eli Zaretskii
2016-01-08 14:13     ` Jorge Alberto Garcia
2016-01-08 15:39       ` Eli Zaretskii
2016-01-08 15:54         ` Kaushal Modi
2016-01-08 16:13           ` Jorge Alberto Garcia
2016-01-08 16:38             ` Kaushal Modi
2016-01-08 16:44               ` Jorge Alberto Garcia
2016-01-08 16:54                 ` Kaushal Modi
2016-01-08 17:52                   ` Jorge Alberto Garcia
2016-01-08 19:06                     ` Eli Zaretskii
2016-01-08 19:05                   ` Eli Zaretskii
2016-01-12 21:04                     ` John Wiegley
2016-01-12 21:26                       ` Jorge Alberto Garcia
2016-01-13  0:10                         ` John Wiegley
2016-01-13  0:46                           ` Jorge Alberto Garcia
2016-03-29 16:22                             ` Kaushal Modi
2016-03-29 17:30                               ` Jorge Alberto Garcia
2016-03-29 21:27                                 ` Paul Eggert
2016-03-29 22:35                                   ` Kaushal Modi
2016-03-29 23:08                                     ` Paul Eggert
2016-03-29 23:29                                       ` Jorge Alberto Garcia
2016-03-30  0:37                                         ` Paul Eggert
2016-03-30 14:21                                           ` Kaushal Modi
2016-03-30 16:42                                             ` Jorge Alberto Garcia
2016-03-31 12:31                                             ` Stefan Monnier
2016-03-31 14:24                                               ` Jorge Alberto Garcia
2016-01-08 19:19                   ` David Caldwell
2016-01-08 19:43                     ` Eli Zaretskii
2016-01-08 19:52                       ` David Caldwell
2016-01-08 20:33                         ` Jorge Alberto Garcia
2016-01-09 22:51                           ` Jorge Alberto Garcia
2016-01-10  8:22                             ` Yuri Khan
2016-01-10  8:37                               ` Jorge Alberto Garcia
2016-01-12 16:24                                 ` Jorge Alberto Garcia
2016-01-08 16:10         ` Jorge Alberto Garcia
  -- strict thread matches above, loose matches on Subject: below --
2017-02-09  9:58 Toon Claes
2017-02-09 13:22 ` Stefan Monnier
2017-02-14 13:57   ` Toon Claes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPfrtUcwZZMKR6x1xdKoszFcqcD0=-5S1W7xwA6oVGH01ED_bA@mail.gmail.com' \
    --to=jorge.garcia.gonzalez@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).