什么是组合两个Emacs主要模式的简单方法,还是改变现有模式? [英] What is a simple way to combine two Emacs major modes, or to change an existing mode?

查看:171
本文介绍了什么是组合两个Emacs主要模式的简单方法,还是改变现有模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



问题1:有没有一种简单的方式来写一个主要模式文件结合了两种主要模式?



详细信息:




    <这个语言被称为brew(而不是Binary Runtime Environment for Wireless的BREW)。


  • 的语言R和Latex,其模式是R模式和胶乳模式。


  • R代码出现在标签<%和%>之间。一切都是乳胶。


  • 我如何写一个brew-mode.el文件? (或者是已经可以使用了?)




我从这个发布,是使用Latex模式,并将格式<%...%>的代码视为注释。

解决方案

解决方案可让您一次使用多种主要模式。请参阅Emacs Wiki以获取多种模式。我个人对他们没有经验,不能推荐一个。


In Emacs, I'm working with a file that is a hybrid of two languages.

Question 1: Is there a simple way to write a major mode file that combines two major modes?

Details:

  • The language is called "brew" (not the "BREW" of "Binary Runtime Environment for Wireless").

  • brew is made up of the languages R and Latex, whose modes are R-mode and latex-mode.

  • The R code appears between the tags <% and %>. Everything else is Latex.

  • How can I write a brew-mode.el file? (Or is one already available?)

One idea, which I got from this posting, is to use Latex mode, and treat the code of the form <% ... %> as a comment.

解决方案

A number of folks have written solutions enabling you to use multiple major modes at once. See the Emacs Wiki for Multiple Modes. I personally have no experience with them and cannot recommend one over another.

这篇关于什么是组合两个Emacs主要模式的简单方法,还是改变现有模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆