diff options
| author | Eli Zaretskii | 2012-04-26 13:49:29 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-04-26 13:49:29 +0300 |
| commit | 4c3fa1d9adf3dca80e86b45488b0556f5f0fa495 (patch) | |
| tree | f03caadd14c2a1aa810fcbc080b73838e3a31db6 | |
| parent | 1c6900d923647582ea9c2ab90f0ccf1fe41603e0 (diff) | |
| download | emacs-4c3fa1d9adf3dca80e86b45488b0556f5f0fa495.tar.gz emacs-4c3fa1d9adf3dca80e86b45488b0556f5f0fa495.zip | |
Allow word wrap together with whitespace-mode (bug #11341)
src/xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
display element, check also the underlying string or buffer
character.
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8b23806e57f..df0e6135498 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2012-04-26 Eli Zaretskii <eliz@gnu.org> | 1 | 2012-04-26 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded | ||
| 4 | display element, check also the underlying string or buffer | ||
| 5 | character. (Bug#11341) | ||
| 6 | |||
| 3 | * w32menu.c: Include w32heap.h. | 7 | * w32menu.c: Include w32heap.h. |
| 4 | (add_menu_item): If the call to AppendMenuW (via | 8 | (add_menu_item): If the call to AppendMenuW (via |
| 5 | unicode_append_menu) fails, disable Unicode menus only if we are | 9 | unicode_append_menu) fails, disable Unicode menus only if we are |
diff --git a/src/xdisp.c b/src/xdisp.c index 3cbd4b172f4..f2700bd6d25 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -383,11 +383,21 @@ static Lisp_Object Qline_height; | |||
| 383 | #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) 0 | 383 | #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) 0 |
| 384 | #endif /* HAVE_WINDOW_SYSTEM */ | 384 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 385 | 385 | ||
| 386 | /* Test if the display element loaded in IT is a space or tab | 386 | /* Test if the display element loaded in IT, or the underlying buffer |
| 387 | character. This is used to determine word wrapping. */ | 387 | or string character, is a space or a TAB character. This is used |
| 388 | 388 | to determine where word wrapping can occur. */ | |
| 389 | #define IT_DISPLAYING_WHITESPACE(it) \ | 389 | |
| 390 | (it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t')) | 390 | #define IT_DISPLAYING_WHITESPACE(it) \ |
| 391 | ((it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t')) \ | ||
| 392 | || ((STRINGP (it->string) \ | ||
| 393 | && (SREF (it->string, IT_STRING_BYTEPOS (*it)) == ' ' \ | ||
| 394 | || SREF (it->string, IT_STRING_BYTEPOS (*it)) == '\t')) \ | ||
| 395 | || (it->s \ | ||
| 396 | && (it->s[IT_BYTEPOS (*it)] == ' ' \ | ||
| 397 | || it->s[IT_BYTEPOS (*it)] == '\t')) \ | ||
| 398 | || (IT_BYTEPOS (*it) < ZV_BYTE \ | ||
| 399 | && (*BYTE_POS_ADDR (IT_BYTEPOS (*it)) == ' ' \ | ||
| 400 | || *BYTE_POS_ADDR (IT_BYTEPOS (*it)) == '\t')))) \ | ||
| 391 | 401 | ||
| 392 | /* Name of the face used to highlight trailing whitespace. */ | 402 | /* Name of the face used to highlight trailing whitespace. */ |
| 393 | 403 | ||