如何为新语言编写 emacs 模式? [英] How to write an emacs mode for a new language?

查看:19
本文介绍了如何为新语言编写 emacs 模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为 4GL 编写一个 Emacs 主模式.有人可以给我看教程吗?就我用谷歌搜索而言,我只能找到这个坏的:

I would like to write an Emacs major mode for a 4GL. Can someone show me a tutorial? As far as I googled I was able to find only this broken:

链接 http://two-wugs.net/emacs/mode-tutorial.html

推荐答案

如果你很懒,一个简单的方法是扩展 generic-mode 以了解你的新语言:

If you're lazy, one easy way is to extend generic-mode to know about your new language:

http://emacswiki.org/emacs/GenericMode

我经常为应用程序的配置文件执行此操作,我经常使用这些文件来获得体面的语法突出显示.这是一个我为以很久以前的星号PBX为例.

I do this a lot for config files for applications that I work with a lot to get decent syntax highlighting. Here's one I did for the asterisk PBX a long time ago as an example.

这篇关于如何为新语言编写 emacs 模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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