unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* whitespace-mode and visual-line-mode
@ 2012-04-23  0:29 Matt McClure
  2012-04-25  9:57 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Matt McClure @ 2012-04-23  0:29 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 370 bytes --]

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?

Matt

-- 
Matt McClure
http://www.matthewlmcclure.com
http://www.mapmyfitness.com/profile/matthewlmcclure

[-- Attachment #2: Type: text/html, Size: 614 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: whitespace-mode and visual-line-mode
       [not found] <mailman.452.1335141019.751.help-gnu-emacs@gnu.org>
@ 2012-04-25  8:16 ` Xah Lee
  0 siblings, 0 replies; 7+ messages in thread
From: Xah Lee @ 2012-04-25  8:16 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 22, 5:29 pm, Matt McClure <matthewlmccl...@gmail.com> wrote:
> 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?
>
> Matt

good catch. I don't know the answer offhand... but hoping someone
would bug report.

 Xah


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: whitespace-mode and visual-line-mode
  2012-04-23  0:29 whitespace-mode and visual-line-mode Matt McClure
@ 2012-04-25  9:57 ` Eli Zaretskii
  2012-04-25 14:17   ` Matt McClure
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2012-04-25  9:57 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 22 Apr 2012 20:29:44 -0400
> From: Matt McClure <matthewlmcclure@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.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: whitespace-mode and visual-line-mode
  2012-04-25  9:57 ` Eli Zaretskii
@ 2012-04-25 14:17   ` Matt McClure
  2012-04-25 14:31     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Matt McClure @ 2012-04-25 14:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2295 bytes --]

On Wed, Apr 25, 2012 at 5:57 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Sun, 22 Apr 2012 20:29:44 -0400
> > From: Matt McClure <matthewlmcclure@gmail.com>
> >
> > 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.)
>

Hm. I tried, but Emacs still didn't wrap at word boundaries.

Here's my custom value after copy/paste/editing the value from
whitespace.el to my emacs.el:

 '(whitespace-display-mappings (quote (
    (space-mark   ?\     [?.]     [?.]) ; space - centered dot
    (space-mark   ?\xA0  [?_]     [?_]) ; hard space - currency
    (space-mark   ?\x8A0 [?_]      [?_]) ; hard space - currency
    (space-mark   ?\x920 [?_]      [?_]) ; hard space - currency
    (space-mark   ?\xE20 [?_]      [?_]) ; hard space - currency
    (space-mark   ?\xF20 [?_]      [?_]) ; hard space - currency
    ;; NEWLINE is displayed using the face `whitespace-newline'
    (newline-mark ?\n    [?$ ?\n]) ; eol - dollar sign
    ;; (newline-mark ?\n    [?\u21B5 ?\n] [?$ ?\n]) ; eol - downwards arrow
    ;; (newline-mark ?\n    [?\u00B6 ?\n] [?$ ?\n]) ; eol - pilcrow
    ;; (newline-mark ?\n    [?\x8AF ?\n]  [?$ ?\n]) ; eol - overscore
    ;; (newline-mark ?\n    [?\x8AC ?\n]  [?$ ?\n]) ; eol - negation
    ;; (newline-mark ?\n    [?\x8B0 ?\n]  [?$ ?\n]) ; eol - grade
    ;;
    ;; WARNING: the mapping below has a problem.
    ;; When a TAB occupies exactly one column, it will display the
    ;; character ?\xBB at that column followed by a TAB which goes to
    ;; the next TAB column.
    ;; If this is a problem for you, please, comment the line below.
    (tab-mark     ?\t    [?\\ ?\t] [?\\ ?\t]) ; tab - left quote mark
    )))

Incidentally, `M-x customize-variable RET whitespace-display-mappings`
complains when I try to set a value in any fashion: "This field should
contain a single character".

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

Done.

-- 
Matt McClure
http://www.matthewlmcclure.com
http://www.mapmyfitness.com/profile/matthewlmcclure

[-- Attachment #2: Type: text/html, Size: 4138 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: whitespace-mode and visual-line-mode
  2012-04-25 14:17   ` Matt McClure
@ 2012-04-25 14:31     ` Eli Zaretskii
       [not found]       ` <CAJELnLGRG9XPtqnwWNErZwfzsku=4iCD_Pxq5BXh6UeSLOPz+Q@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2012-04-25 14:31 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Wed, 25 Apr 2012 10:17:07 -0400
> From: Matt McClure <matthewlmcclure@gmail.com>
> Cc: help-gnu-emacs@gnu.org
> 
> > 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.)
> >
> 
> Hm. I tried, but Emacs still didn't wrap at word boundaries.

Try this:

    (setq whitespace-display-mappings
	  '(
	    (space-mark   ?\     [?\ ]     [?.])
	    (space-mark   ?\xA0  [?\u00A4] [?_])
	    (space-mark   ?\x8A0 [?\x8A4]  [?_])
	    (space-mark   ?\x920 [?\x924]  [?_])
	    (space-mark   ?\xE20 [?\xE24]  [?_])
	    (space-mark   ?\xF20 [?\xF24]  [?_])
	    (newline-mark ?\n    [?$ ?\n])
	    (tab-mark     ?\t    [?\t] [?\\ ?\t])))

The main point is to have the space and TAB be displayed as
themselves.  You tried to display a '.' instead of a space, which
won't fly with word wrap: it needs to see the space character to break
the line.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: whitespace-mode and visual-line-mode
       [not found]         ` <83397rg7e2.fsf@gnu.org>
@ 2012-04-25 15:41           ` Matt McClure
  2012-04-25 15:45             ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Matt McClure @ 2012-04-25 15:41 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

On Wed, Apr 25, 2012 at 11:26 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Wed, 25 Apr 2012 11:13:52 -0400
> > From: Matt McClure <matthewlmcclure@gmail.com>
> >
> > Got it. That works. But I want to see space and TAB as visible glyphs.
> ;-)
> > I guess that will have to wait for a resolution to the feature request I
> > sent.
>
> Yes.
>

Got a link to the relevant code, in case I get motivated to hack it myself?

-- 
Matt McClure
http://www.matthewlmcclure.com
http://www.mapmyfitness.com/profile/matthewlmcclure

[-- Attachment #2: Type: text/html, Size: 1096 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: whitespace-mode and visual-line-mode
  2012-04-25 15:41           ` Matt McClure
@ 2012-04-25 15:45             ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2012-04-25 15:45 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Wed, 25 Apr 2012 11:41:13 -0400
> From: Matt McClure <matthewlmcclure@gmail.com>
> 
> Got a link to the relevant code, in case I get motivated to hack it myself?

You need to change the definition of the IT_DISPLAYING_WHITESPACE
macro.  It is defined in xdisp.c.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-25 15:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-23  0:29 whitespace-mode and visual-line-mode Matt McClure
2012-04-25  9:57 ` Eli Zaretskii
2012-04-25 14:17   ` Matt McClure
2012-04-25 14:31     ` Eli Zaretskii
     [not found]       ` <CAJELnLGRG9XPtqnwWNErZwfzsku=4iCD_Pxq5BXh6UeSLOPz+Q@mail.gmail.com>
     [not found]         ` <83397rg7e2.fsf@gnu.org>
2012-04-25 15:41           ` Matt McClure
2012-04-25 15:45             ` Eli Zaretskii
     [not found] <mailman.452.1335141019.751.help-gnu-emacs@gnu.org>
2012-04-25  8:16 ` Xah Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).