Skip to content

Instantly share code, notes, and snippets.

@aplaice
Created June 16, 2017 14:40
Show Gist options
  • Select an option

  • Save aplaice/edfd17427a3422e1579ffae879c1955b to your computer and use it in GitHub Desktop.

Select an option

Save aplaice/edfd17427a3422e1579ffae879c1955b to your computer and use it in GitHub Desktop.
Re-definition of IT_DISPLAYING_WHITESPACE allowing wrapping at '/'
#define IT_DISPLAYING_WHITESPACE(it) \
((it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t' || it->c == '/')) \
|| ((STRINGP (it->string) \
&& (SREF (it->string, IT_STRING_BYTEPOS (*it)) == ' ' \
|| SREF (it->string, IT_STRING_BYTEPOS (*it)) == '\t' \
|| SREF (it->string, IT_STRING_BYTEPOS (*it)) == '/')) \
|| (it->s \
&& (it->s[IT_BYTEPOS (*it)] == ' ' \
|| it->s[IT_BYTEPOS (*it)] == '\t' \
|| it->s[IT_BYTEPOS (*it)] == '/')) \
|| (IT_BYTEPOS (*it) < ZV_BYTE \
&& (*BYTE_POS_ADDR (IT_BYTEPOS (*it)) == ' ' \
|| *BYTE_POS_ADDR (IT_BYTEPOS (*it)) == '\t' \
|| *BYTE_POS_ADDR (IT_BYTEPOS (*it)) == '/')))) \
@aplaice

aplaice commented Jun 16, 2017

Copy link
Copy Markdown
Author

Tested with latest emacs — works and surprisingly doesn't cause emacs to crash and burn (despite having been written by blind copying :/). Obviously, this is is not very flexible. Also, IT_DISPLAYING_WHITESPACE becomes a bit of a misnomer...

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