20

Is it possible to replace '\emsp' with just plain spaces?

I.e, In Clock reports, there are a lot of these '\emsp's. (See example below.)

I'm able to get rid of them by setting ':indent nil'. But this removes all indent altogether, which is undersirable. I can also get rid of them if I export things. But in the Agenda view I don't export reports and the \emsp's are just a visual distraction.

So far I was able to remove 'TODO' keywords via formatter as described here. But the formatter doesn't seem to see the '\emsp' and can't remove them. It kinda seems like they are added after.

|-----------+-------------------------------------------------------------------+---------+------|
| dev.org   | *File time*                                                       | *9:54*  |      |
|           | Dev                                                               | 9:54    |      |
|           | \emsp Configure VMs for testing [[elisp:(my/goto-parent)][parent]]                            |         | 5:03 |
|           | \emsp test if DND works in outline view in Mars (4.5) Build id: I20150217-0800 has outline view fixed (RHBZ#1012336). |         | 0:16 |
|           | \emsp GtkMenuItem directly instead of GtkImageMenuItem            |         | 1:28 |
|           | \emsp Bug 459487 - [GTK] Replace deprecated gtk_arrow_* with gtk_image |         | 1:31 |
|           | \emsp General                                                     |         | 1:36 |
1
  • Boutros' answer is correct, just be sure not to put it in a file called org-table.el, or your tables will explode.
    – Dr Bombay
    Jun 5, 2015 at 19:02

2 Answers 2

27

This is a bug, IMO. Someone complained that the old indentation markers upset table layout in latex output so someone replaced them with these latex instruction. Now of course it is a mess on screen.

I thought the new prettify-symbols-mode might be a handy way to switch out the \emsp for something else, but that can only replace with a single character and it upsets the layout of the table due to the changing width.

So there's nothing for it but to redefine the indentation code:

(defun my-org-clocktable-indent-string (level)
  (if (= level 1)
      ""
    (let ((str "^"))
      (while (> level 2)
        (setq level (1- level)
              str (concat str "--")))
      (concat str "-> "))))

(advice-add 'org-clocktable-indent-string :override #'my-org-clocktable-indent-string)

Change the indent markers to taste.

5
  • Too bad about the inconsitencies. It would be nice to have it fixed someday. The function above does fix things for me, thank you for posting. Feb 24, 2015 at 20:14
  • It looks like I need emacs 24.4 to get this working. Le me upgrading from Fedora 20 to 21. Feb 25, 2015 at 4:52
  • Works in Emacs 24.4 Feb 26, 2015 at 15:26
  • 1
    this is basically fixed in org-mode 8.3, so you can reuse that function instead: orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-clock.el#n2685
    – anarcat
    May 5, 2016 at 1:03
  • I’m using this with ╰ as initial marker and ─ instead of dashes (M-x insert-char BOX DRAWINGS LIGHT ARC UP AND RIGHT and BOX DRAWINGS LIGHT HORIZONTAL). It looks pretty good - thank you! ╰─> E-Mails lesen Dec 21, 2017 at 13:59
4

The manual on Special Symbols says

If you would like to see entities displayed as UTF-8 characters, use the following command:

C-c C-x \

Toggle display of entities as UTF-8 characters. This does not change the buffer content which remains plain ASCII, but it overlays the UTF-8 character for display purposes only.

You can turn this on by default by setting the variable org-pretty-entities, or on a per-file base with the option #+STARTUP: entitiespretty.

1
  • 1
    Can I thank myself for posting this! I needed it 6 months later :P
    – Bae
    Jul 14, 2017 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.