一些文字处理软件(例如 Apple Words)具有支持消失文本的有趣功能。
这种文本在模板文件中用作占位符:如果我从模板开始一个新的报告,一些条目会填充消失的文本,当文本被插入对应于文本或其边界的区域内。此文本还具有特殊外观。
如果可能的话,如何在 Emacs 中实现瞬逝文本?在富文本或 Markdown 缓冲区中支持它可能就足够了。
最佳答案
以下片段可能会给您一个想法。
(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))
关于templates - 如何在 Emacs 中实现瞬逝文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21576499/