all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* display zero with space U+200B
@ 2010-09-09 23:48 Florian Kaufmann
  2010-09-09 23:58 ` Florian Kaufmann
  2010-09-10  1:42 ` Pascal J. Bourguignon
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Kaufmann @ 2010-09-09 23:48 UTC (permalink / raw)
  To: help-gnu-emacs

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.


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

* Re: display zero with space U+200B
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Kaufmann @ 2010-09-09 23:58 UTC (permalink / raw)
  To: help-gnu-emacs

of course I meant zero width space


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

* Re: display zero with space U+200B
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Pascal J. Bourguignon @ 2010-09-10  1:42 UTC (permalink / raw)
  To: help-gnu-emacs

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/


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

end of thread, other threads:[~2010-09-10  1:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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.