In EBCDIC we trust.

February 28, 2010

Selective service

I like to change Emacs' selective display indicator—the hidden-line ellipsis in outline and org mode—so it stands out more. But in emacs 23, my original recipe (derived from here) failed because it relied on hardcoded bit-shifting. Below is an improved version that uses glyphs and works in both emacs 22 and 23. It changes the indicator from "..." to " >>>" in yellow text:

(make-face 'invisible-text-ellipsis-face)  ;; arbitrary name
(set-face-foreground 'invisible-text-ellipsis-face "yellow")
(set-face-background 'invisible-text-ellipsis-face nil)
(let ((dot (make-glyph-code ?> 'invisible-text-ellipsis-face)))
    (set-display-table-slot standard-display-table 'selective-display
                            (vector ?\  dot dot dot)))