Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow addressing multiple people with @ #32

Open
ashnur opened this issue Feb 12, 2014 · 23 comments
Open

Allow addressing multiple people with @ #32

ashnur opened this issue Feb 12, 2014 · 23 comments

Comments

@ashnur
Copy link

ashnur commented Feb 12, 2014

singular, current case:
!somefactoid @ nick1

I think it would be nice to have:

!somefactoid @ nick1, nick2, nick3 too.

@ljharb
Copy link
Member

ljharb commented Feb 12, 2014

Personally I'd prefer multiple @ signs, although that'd be slightly more characters. Both syntaxes would be nice.

@ashnur
Copy link
Author

ashnur commented Feb 12, 2014

@ljharb you mean
!somefactoid @nick1@nick2@nick3 ?

I omitted the whitespace because I am unsure if it's needed at all.

@gkatsev
Copy link
Member

gkatsev commented Feb 12, 2014

whitespace delimited would be best.
!factoid @foo @bar @baz

@ljharb
Copy link
Member

ljharb commented Feb 12, 2014

yes, with the whitespace.

@imbcmdth
Copy link
Member

The commit supports comma and space (and no delimiter since @ isn't valid in nicknames). It does it's best not to capture @ in the "command" portion of the string.

For instance, !g @media will catch @media as an intent (it does that currently, anyway) but it won't catch !g @media queries since the possible intent isn't followed by an intent or the end of a line.

@eligrey
Copy link
Member

eligrey commented Feb 13, 2014

Really good point, maybe we should change the @ syntax to something less ambiguous like @user1 user2 etc !command here

@gkatsev
Copy link
Member

gkatsev commented Feb 13, 2014

We shouldn't change the command for several reasons.

  • familiarity in-channel
  • expectation based on similar usage
  • intuitiveness

@ljharb
Copy link
Member

ljharb commented Feb 13, 2014

Also, the command is required, the user names are optional. Optional things go last.

@robotlolita
Copy link
Contributor

Bracketing the names in an @user would make it unambiguous in all situations, I think:

!g @media @(foo)
foo @(blah)

Edit: can also support multiple users

foo @(user1 user2)

@gkatsev
Copy link
Member

gkatsev commented Feb 13, 2014

Perhaps

!g @media -- @bar
!foo @bar
!something -- @bar

So, the -- would be optional.

@imbcmdth
Copy link
Member

@robotlolita - Except then you can't mindlessly tab-complete. Right now I tend to @so<tab> but that proposal would require @so<tab>) - I can see a lot of people missing the ending ) and screwing up intents.

EDIT: Heck, I just screwed up the intent!

@gkatsev - Would anyone remember the -- since it would be required so very infrequently? It seems to me that complicating the parsing for @media is a bit silly. I can't even think of another "@"-bearing search that would present an issue.. we aren't #css!

@robotlolita
Copy link
Contributor

That seems to work pretty well too, it's also more English-like, rather than Lispy

@gkatsev
Copy link
Member

gkatsev commented Feb 13, 2014

It's how unix lets you pass extra arguments to a subscript that you're running.

@eligrey
Copy link
Member

eligrey commented Feb 13, 2014

@robotlolita parenthesis have query ramifications on google and I sometimes use it for more complex searches

@imbcmdth
Copy link
Member

The only potential issue I see with -- is that it is ambiguous for something like:

>>> var a = 10; setTimeout(print, 1000, a); a-- @nickname

@robotlolita
Copy link
Contributor

Hm, if you make sure there's whitespace before it, it's likely to be less of a problem a -- is still valid, tho.

@gkatsev
Copy link
Member

gkatsev commented Feb 13, 2014

Make it three?

@ashnur
Copy link
Author

ashnur commented Feb 13, 2014

4! :)

@robotlolita
Copy link
Contributor

Yeah, b ---a is still valid :P

@ashnur
Copy link
Author

ashnur commented Feb 14, 2014

--- @ somenick is not

@ashnur
Copy link
Author

ashnur commented Feb 14, 2014

would this maybe work? http://jsbin.com/sivod/1/edit?js,console,output

@ashnur
Copy link
Author

ashnur commented Feb 14, 2014

with delimiter --- and 'g @media' as testcase: http://jsbin.com/sivod/3/

@ashnur
Copy link
Author

ashnur commented Feb 14, 2014

with delimiter @ http://jsbin.com/sivod/5/edit

it would look like !g @media @@somenick @someothernick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants