templates - 如何在 Emacs 中实现瞬逝文本?

标签 templates emacs

一些文字处理软件(例如 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/

相关文章:

模板和非模板类的C++符号范围搜索顺序不同?

Emacs 重新排列拆分 Pane

Emacs 组织模式,小细节

emacs - 在 Emacs 中显示所有打开的缓冲区

c++ - 推断函数指针的模板参数

django - 如何将参数传递给 Django 中模板变量的方法?

C++ 模板性能包含模型和内联模型

Emacs Helm 完成 : how to turn off persistent-help_line?

linux - 我可以在我的计算机上使用 emacs 通过 ssh 将 C 代码编译到 linux 终端吗?

json - 对一个 JSON 模板进行多项更改