GNU bug report logs - #11341
Feature request: make whitespace visible and keep lines wrapped at word boundaries simultaneously

Previous Next

Package: emacs;

Reported by: Matt McClure <matthewlmcclure <at> gmail.com>

Date: Wed, 25 Apr 2012 16:08:02 UTC

Severity: wishlist

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11341 in the body.
You can then email your comments to 11341 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11341; Package emacs. (Wed, 25 Apr 2012 16:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matt McClure <matthewlmcclure <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 25 Apr 2012 16:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Matt McClure <matthewlmcclure <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Feature request: make whitespace visible and keep lines wrapped at
	word boundaries simultaneously
Date: Wed, 25 Apr 2012 09:37:43 -0400
[Message part 1 (text/plain, inline)]
---------- Forwarded message ----------
From: Eli Zaretskii <eliz <at> gnu.org>
Date: Wed, Apr 25, 2012 at 5:57 AM
Subject: Re: whitespace-mode and visual-line-mode
To: help-gnu-emacs <at> gnu.org


> Date: Sun, 22 Apr 2012 20:29:44 -0400
> From: Matt McClure <matthewlmcclure <at> gmail.com>
>
> When I turn on whitespace-mode in a buffer with word-wrap on, e.g., in
> visual-line-mode, lines become wrapped at the right edge of the window
> instead of word boundaries.
>
> How can I make whitespace visible and keep lines wrapped at word
boundaries
> simultaneously?

Customize whitespace-display-mappings so that the whitespace
characters are displayed as themselves, instead of as fancy non-ASCII
glyphs.  (You will still have the faces to show the whitespace.)

For a better solution, please file a feature-request bug report, this
would require changes in the display engine.

-- 
Matt McClure
http://www.matthewlmcclure.com
http://www.mapmyfitness.com/profile/matthewlmcclure
[Message part 2 (text/html, inline)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 26 Apr 2012 10:56:02 GMT) Full text and rfc822 format available.

Notification sent to Matt McClure <matthewlmcclure <at> gmail.com>:
bug acknowledged by developer. (Thu, 26 Apr 2012 10:56:02 GMT) Full text and rfc822 format available.

Message #10 received at 11341-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Matt McClure <matthewlmcclure <at> gmail.com>
Cc: 11341-done <at> debbugs.gnu.org
Subject: Re: bug#11341: Feature request: make whitespace visible and keep
	lines	wrapped at word boundaries simultaneously
Date: Thu, 26 Apr 2012 13:53:58 +0300
> Date: Wed, 25 Apr 2012 09:37:43 -0400
> From: Matt McClure <matthewlmcclure <at> gmail.com>
> 
> > Date: Sun, 22 Apr 2012 20:29:44 -0400
> > From: Matt McClure <matthewlmcclure <at> gmail.com>
> >
> > When I turn on whitespace-mode in a buffer with word-wrap on, e.g., in
> > visual-line-mode, lines become wrapped at the right edge of the window
> > instead of word boundaries.
> >
> > How can I make whitespace visible and keep lines wrapped at word
> boundaries
> > simultaneously?
> 
> Customize whitespace-display-mappings so that the whitespace
> characters are displayed as themselves, instead of as fancy non-ASCII
> glyphs.  (You will still have the faces to show the whitespace.)
> 
> For a better solution, please file a feature-request bug report, this
> would require changes in the display engine.

Fixed in revision 108046 on the trunk (for Emacs 24.2).  The diffs are
below, if you don't want to wait.


=== modified file 'src/ChangeLog'
--- src/ChangeLog	2012-04-26 10:07:35 +0000
+++ src/ChangeLog	2012-04-26 10:49:29 +0000
@@ -1,5 +1,9 @@
 2012-04-26  Eli Zaretskii  <eliz <at> gnu.org>
 
+	* xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
+	display element, check also the underlying string or buffer
+	character.  (Bug#11341)
+
 	* w32menu.c: Include w32heap.h.
 	(add_menu_item): If the call to AppendMenuW (via
 	unicode_append_menu) fails, disable Unicode menus only if we are

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2012-04-20 08:48:50 +0000
+++ src/xdisp.c	2012-04-26 10:49:29 +0000
@@ -383,11 +383,21 @@ static Lisp_Object Qline_height;
 #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) 0
 #endif /* HAVE_WINDOW_SYSTEM */
 
-/* Test if the display element loaded in IT is a space or tab
-   character.  This is used to determine word wrapping.  */
-
-#define IT_DISPLAYING_WHITESPACE(it)				\
-  (it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t'))
+/* Test if the display element loaded in IT, or the underlying buffer
+   or string character, is a space or a TAB character.  This is used
+   to determine where word wrapping can occur.  */
+
+#define IT_DISPLAYING_WHITESPACE(it)					\
+  ((it->what == IT_CHARACTER && (it->c == ' ' || it->c == '\t'))	\
+   || ((STRINGP (it->string)						\
+	&& (SREF (it->string, IT_STRING_BYTEPOS (*it)) == ' '		\
+	    || SREF (it->string, IT_STRING_BYTEPOS (*it)) == '\t'))	\
+       || (it->s							\
+	   && (it->s[IT_BYTEPOS (*it)] == ' '				\
+	       || it->s[IT_BYTEPOS (*it)] == '\t'))			\
+       || (IT_BYTEPOS (*it) < ZV_BYTE					\
+	   && (*BYTE_POS_ADDR (IT_BYTEPOS (*it)) == ' '			\
+	       || *BYTE_POS_ADDR (IT_BYTEPOS (*it)) == '\t'))))		\
 
 /* Name of the face used to highlight trailing whitespace.  */
 





Message #11 received at 11341-done <at> debbugs.gnu.org (full text, mbox):

From: Matt McClure <matthewlmcclure <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "11341-done <at> debbugs.gnu.org" <11341-done <at> debbugs.gnu.org>
Subject: Re: bug#11341: Feature request: make whitespace visible and keep
	lines wrapped at word boundaries simultaneously
Date: Thu, 26 Apr 2012 08:09:07 -0400
On Apr 26, 2012, at 6:55 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> For a better solution, please file a feature-request bug report, this
>> would require changes in the display engine.
>
> Fixed in revision 108046 on the trunk (for Emacs 24.2).

Thanks, Eli!

Matt




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 May 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 357 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.