使用组织模式的“org-edit-special”;编辑 HTML 中嵌入的 javascript/css

发布于 2025-01-05 01:37:02 字数 487 浏览 0 评论 0原文

在组织模式下,当该点位于 exsrc 块内时,我可以按 Cc ' 在另一个窗口中编辑该部分具有正确缩进和突出显示的相应主要模式。我想重用此功能以使编辑 HTML 变得更容易。

在有人提出 MMM 模式、mumamo 等之前。它们对我不起作用。如果有人知道如何在多模式设置中使缩进和字体锁定正常工作,我也很乐意研究这一点。

要求(其中大部分正是 org-edit-special 所做的:

  1. 当在
  2. 在原始 HTML 缓冲区中添加一个覆盖层,以显示该部分正在编辑,并
  3. 的原始缩进是正确的,并在编辑完成后用那么多空格填充整个块。

假设第一行 知道类似的用法org-mode 似乎迫在眉睫。

In org-mode when the point is inside an ex or src block, I can ppress C-c ' to edit the section in another window in the respective major-mode with correct indenting and highlighting. I would like to reuse this functionality to make editing HTML easier.

Before anyone brings up MMM-mode, mumamo, etc. They don't work for me. If anyone knows how to get indentation and font-locking working right in a multi-mode setup, I'll gladly look into that as well.

Requirements (most of this is exactly what org-edit-special does:

  1. when in <script> and <style> block, open block in indirect buffer in the proper respective major-mode.
  2. an overlay is added to the original HTML buffer to show that this section is being edited.
  3. assume the original indentation of the first line is correct, and pad the whole block with that many spaces when editing is finished.

Does anyone know of a similar usage of org-mode? It seems imminently feasible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

属性 2025-01-12 01:37:02

我不能说这对你有多有效(它今天才发布到邮件列表)但是 邮件列表上的此线程可能会为您提供解决方案。

它应该完全按照您所描述的方式进行,仅缺少正则表达式来正确定义代码块(以扩展它以适应您正在使用的文件类型)

I cannot say how well this would work for you (it was only just posted to the mailing-list today) but this thread on the mailing list may provide you with the solution.

It is supposed to do exactly what you describe, lacking only the regexps to properly define the code blocks perhaps (to extend it to fit the filetype you're working with)

随风而去 2025-01-12 01:37:02

我已经按照我在这里描述的方式实现了它:

https://github.com/lewang/generic-edit-special

不过,Jonathan Leech-Pepin 比我先一步宣布了我自己的项目。 :(

I've implemented it pretty much exactly as I've described here:

https://github.com/lewang/generic-edit-special

Jonathan Leech-Pepin beat me to the bunch announcing my own project, though. :(

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文