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

Emojify source code #10

Closed
ryanprior opened this issue Nov 22, 2015 · 6 comments
Closed

Emojify source code #10

ryanprior opened this issue Nov 22, 2015 · 6 comments

Comments

@ryanprior
Copy link

Some languages such as Javascript, Swift, PHP and Java allow Unicode emoji outside of comments and strings. You might see code like this:

for(💜 in 💕) { 🎵(💜); }

Those should be emojified. We could fix this by making emojify-prog-contexts restrictions apply only to ASCII- and github-style emojis.

@iqbalansari
Copy link
Owner

I agree with @ryanprior's suggestion, @cpitclaudel what do you think?

@cpitclaudel
Copy link

Works for me! Sorry for opening a duplicate. I like @ryanprior's suggestion.
It could also work to add a setting to emojify-prog-contexts to emojify everywhere.

@ryanprior
Copy link
Author

I can't picture wanting emojification of ascii or fenced styles in source code for anything except comments and maaaaybe strings. Is that reasonable? Do you see somebody wanting to legitimately name a variable :rainbow: or define #-) as an operator and expect those to automatically be emojified?

I do expect to see people increasingly use emoji in source code, but I picture Unicode and extensions like prettify-symbols as the preferred ways of accomplishing that.

@cpitclaudel
Copy link

I can't picture wanting emojification of ascii or fenced styles in source code for anything except comments and maaaaybe strings. Is that reasonable? Do you see somebody wanting to legitimately name a variable :rainbow: or define #-) as an operator and expect those to automatically be emojified?

No, not really.

I do expect to see people increasingly use emoji in source code, but I picture Unicode and extensions like prettify-symbols as the preferred ways of accomplishing that.

I sometimes use prettify-symbols-mode to display the self keyword in python as 👤. Having it show an actual emoji, instead of the outline that Symbola provides, would be nice.

For me this package is superior to prettify-symbols for certain use cases, as it allows me to prettify a string into an image, instead of prettifying it into a Unicode character. If Emacs had support for displaying color Emojis embedded in a font all would be good for me, but it doesn't on Linux, so this package definitely fills a gap.

@iqbalansari
Copy link
Owner

@ryanprior, @cpitclaudel I have pushed some changes to master which make this possible. Please do try it out when MELPA builds and report back problems if any.

Thanks

@mohkale
Copy link

mohkale commented Mar 5, 2020

Just curious if there's a way to enable github styles emojis in code outside of strings? For example, I'd like to be able to use my scratch buffer to test out different emojis, but it only renders github style emojis when their in a string. Seeing as lisp-interaction-mode is kind of in between a program-mode and a text-mode, I think there should be an in-between solution.

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

4 participants