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

Allowing smiley (or frowny) faces when preceded by : in strict mode #713

Closed
dakrone opened this issue Feb 26, 2017 · 6 comments
Closed

Allowing smiley (or frowny) faces when preceded by : in strict mode #713

dakrone opened this issue Feb 26, 2017 · 6 comments

Comments

@dakrone
Copy link

dakrone commented Feb 26, 2017

I think it would be great if smartparens' strict-mode would detect that a smiley or frowny face was being inserted and still allow it in certain modes.

For instance, in email composing modes, it's quite common that I'll have (| indicates cursor position):

Have a nice day :|

And then type ) only to receive We can not insert unbalanced closing delimiter in strict mode.

Or, alternatively:

That stinks :|

And type ( only to get:

That stinks :()

Which can be confusing if I don't catch it :)

@Fuco1
Copy link
Owner

Fuco1 commented Feb 27, 2017

:D I've had a feature request for this in my notes for good 3 years now, but then I stopped using ert for irc and just somehow abandoned the idea.

I think it would be nice in text modes, emails and similar. Could you maybe compile a list of modes where this bothers you, then I'll add mine and we can cook something up. Or maybe just add all text-mode derived modes?

I'll leave this up for a discussion for a bit, but I'm definitely all for this.

@Fuco1
Copy link
Owner

Fuco1 commented Feb 27, 2017

Implementation-wise, it should be enough to add a filter on the pair to disable the check if certain pairs are preceded by the colon, so if someone wants to start PR right away, I won't get mad :P

@dakrone
Copy link
Author

dakrone commented Feb 27, 2017

Could you maybe compile a list of modes where this bothers you

Sure, it's mostly in emails mu4e-compose-mode, message-mode, and erc-mode for IRC, as well as whatever mode twittering uses for composing tweets (I'm not sure what major mode that is).

Other than that I can deal with it, those are the big ones

@Fuco1
Copy link
Owner

Fuco1 commented Jul 1, 2017

Note: this might be a great use-case for the new feature of named-configuration sets: http://smartparens.readthedocs.io/en/latest/pair-management.html#named-pair-definitions-buffer-local

@Fuco1
Copy link
Owner

Fuco1 commented Jul 16, 2017

Wow, so I've decided to implement this feature and it led me down the slippery slope of having to rewrite half the balance checking routines, during which I've discovered several bugs (#774 being one of the more serious). Good stuff.

Anyway, I almost have it sorted out so expect this to land soon :)

@Fuco1 Fuco1 closed this as completed in 8987c40 Jul 16, 2017
@dakrone
Copy link
Author

dakrone commented Jul 17, 2017

Thanks for fixing this @Fuco1!

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

No branches or pull requests

2 participants