all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: display zero with space U+200B
Date: Fri, 10 Sep 2010 03:42:20 +0200	[thread overview]
Message-ID: <87bp869xxf.fsf@kuiper.lan.informatimago.com> (raw)
In-Reply-To: 460c5513-10aa-45f5-9449-11fca22068b5@z25g2000vbn.googlegroups.com

Florian Kaufmann <sensorflo@gmail.com> writes:

> I have a file containing zero with space characters (unicode code
> point U+200B). Any idea how I can get a visual feedback where they
> are? I tried to customize whitespace-display-mappings of whitespace.el
> like this:
>
> (defcustom whitespace-display-mappings '( (space-mark ?\x200B [?\xB7]
> [?.]) ...
>
> But I still don't see it. Normal spaces are displayed as intented by
> whitespace.el.

My advice would be to delete them from the file.


Since they have a null width, you cannot see them, obviously.
But you could show the characters that are around them.

(let ((zws ?\u200b))
  (re-search-forward (format "\\(^%c.\\|.%c.\\|.%c$\\|^%c$\\)" zws zws zws zws)))



Another way to do it would involve compose-region:

(font-lock-add-keywords nil
  `((,(format "\\(%c\\)" ?\u200b) ; #\ZERO_WIDTH_SPACE
     (1 (progn (compose-region (match-beginning 1) (match-end 1)
                               ?\u2b1b ; #\BLACK_LARGE_SQUARE
                               'decompose-region)
                nil)))))


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


      parent reply	other threads:[~2010-09-10  1:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 23:48 display zero with space U+200B Florian Kaufmann
2010-09-09 23:58 ` Florian Kaufmann
2010-09-10  1:42 ` Pascal J. Bourguignon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bp869xxf.fsf@kuiper.lan.informatimago.com \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.