How to implement evanescent text in Emacs?

emacs, templates

Solution

The following snippet might give you an idea.

(defun remove-evanescent (oldpos newpos)
  "We need that later on to remove evanescent text. We could also remove the superfluous space here."
  (remove-text-properties newpos
              (next-property-change newpos)
              '(display nil point-entered nil)))

;; An elisp-snippet to be tried in the *scratch* buffer:
(insert (propertize " " 'display "Help"
            'point-entered 'remove-evanescent))

Problem

Some word processing software (e.g. Apple Words) has the interesting feature of supporting evanescent text. This kind of text is used as placeholder in template files: if I start a new Report from a template, some entries are filled with evanescent text which disappears when text is inserted within the region corresponding to the text or its boundary. This text is also identified with a special appearance. How can I implement evanescent text in Emacs, if at all possible? It might be enough to support it in rich-text or markdown buffers.

Original source