一些文字处理软件(例如Apple Words)具有支持消逝文本的有趣功能。
这种类型的文本在模板文件中用作占位符:如果我从一个模板开始一个新的报告,一些条目会填充消失的文本,当文本被插入到与文本或其边界相对应的区域中时,这些文本就会消失。此文本也以特殊外观标识。
如果可能的话,我如何在Emacs中实现消逝的文本?它可能足以在富文本或标记缓冲区中支持它。
发布于 2014-02-05 22:37:28
下面的代码片段可能会让您有所了解。
(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))https://stackoverflow.com/questions/21576499
复制相似问题