emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Greg Minshall <minshall@acm.org>
Cc: Org Mode List <emacs-orgmode@gnu.org>,
	Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: non-space, paste, (???) character for inline results
Date: Wed, 31 Jan 2018 17:52:01 +0000	[thread overview]
Message-ID: <CAFyQvY2fE=kHGEaV3M0uva0f8fcAdxAw+pgd-FBqyTi4t_6U9Q@mail.gmail.com> (raw)
In-Reply-To: <4143.1517420497@minshall-apollo.minshall.org>


[-- Attachment #1.1: Type: text/plain, Size: 2066 bytes --]

On Wed, Jan 31, 2018 at 12:44 PM Greg Minshall <minshall@acm.org> wrote:

>
> ah.  how does one enter a zero-width space in emacs/org-mode?


By default, you can do C-x 8 RET and type ZERO WIDTH SPACE and the 0x200b
character will be inserted.

I use it once in a while, so I have bound it to C-x 8 0 [1].


>   also, i'm
> curious about how it looks on the screen.  (for me, i'd want it to look,
> on the screen, *very* obvious that *something* is there.)
>

I have been bit by ZERO WIDTH SPACE characters present in Org buffer and
getting wrong fontification.. and so I came up with [2]:

(defun modi/highlight-confusing-chars ()
  "Highlight confusing characters in different glyphs + face.

EN DASH          -> 2 Hyphens
EM DASH          -> 3 Hyphens
ZERO WIDTH SPACE -> ∅

All glyphs are shown in `modi/highlight-confusing' face."
  (let* ((glyph-en-dash (make-glyph-code ?- 'modi/highlight-confusing))
;HYPHEN-MINUS follows that ?
         (glyph-em-dash glyph-en-dash)  ;HYPHEN-MINUS follows that ?
         (glyph-zws (make-glyph-code ?∅ 'modi/highlight-confusing)))
    (when (not buffer-display-table)
      (setq buffer-display-table (make-display-table)))
    (aset buffer-display-table ?– `[,glyph-en-dash ,glyph-en-dash]) ;EN
DASH follows that ?
    (aset buffer-display-table ?— `[,glyph-em-dash ,glyph-em-dash
,glyph-em-dash]) ;EM DASH follows that ?
    (aset buffer-display-table ?​ `[,glyph-zws])))
(dolist (hook '(prog-mode-hook
                org-mode-hook))
  (add-hook hook #'modi/highlight-confusing-chars))

It's not evident in the above code, but there' actually a ZERO WIDTH SPACE
char after the ? in the third aset form.. and it looks like this (image
pasted below) to me :)

[image: image.png]



[1]:
https://github.com/kaushalmodi/.emacs.d/blob/d8877836b8566a8831c735a8ec2000133230ad41/setup-files/setup-unicode.el#L40
[2]:
https://github.com/kaushalmodi/.emacs.d/blob/d8877836b8566a8831c735a8ec2000133230ad41/setup-files/setup-visual.el#L617-L635
-- 

Kaushal Modi

[-- Attachment #1.2: Type: text/html, Size: 3146 bytes --]

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 69053 bytes --]

  reply	other threads:[~2018-01-31 17:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30  8:29 non-space, paste, (???) character for inline results Greg Minshall
2018-01-30  9:15 ` Nicolas Goaziou
2018-01-30 13:06   ` Greg Minshall
2018-01-30 20:55     ` Nicolas Goaziou
2018-01-31  1:19       ` Greg Minshall
2018-01-31 11:13         ` Nicolas Goaziou
2018-01-31 15:12           ` Greg Minshall
2018-01-31 16:19             ` Nicolas Goaziou
2018-01-31 17:41               ` Greg Minshall
2018-01-31 17:52                 ` Kaushal Modi [this message]
2018-01-31 17:54                   ` Kaushal Modi
2018-01-31 18:09                 ` Nicolas Goaziou
2018-02-01  6:23                   ` Greg Minshall
2018-02-03 14:01                     ` Nicolas Goaziou
2018-02-03 14:27                       ` Greg Minshall
2018-02-03 14:31                         ` Nicolas Goaziou
2018-02-03 14:41                           ` Greg Minshall
2018-02-03 23:33                             ` Nicolas Goaziou
2018-02-05 23:15                               ` Greg Minshall

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to='CAFyQvY2fE=kHGEaV3M0uva0f8fcAdxAw+pgd-FBqyTi4t_6U9Q@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    --cc=minshall@acm.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 public inbox

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

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).