Emacs 有好的 Object Pascal 模式吗?

发布于 2024-10-08 04:39:05 字数 232 浏览 0 评论 0原文

我最近一直在做一些Object Pascal,但我一直无法找到一个好的模式。我尝试过 delphi-mode 和 pascal-mode,它们都试图提供太多帮助;当他们无法理解 Object Pascal 语法时,很难强迫他们正确格式化代码。我一直在使用 Geany,但我想念我的 Emacs。我还应该尝试另一种 Pascal 模式吗?

编辑

这是在 Free Pascal 中实现的 Object Pascal。

I've been doing some Object Pascal lately, and I've been unable to find a good mode for it. I've tried delphi-mode and pascal-mode, both of which try to help too much; when they fail to understand Object Pascal syntax, it's very difficult to force them to format the code correctly. I've been using Geany, but I miss my Emacs. Is there another Pascal mode I should try?

Edit

This is Object Pascal as implemented in Free Pascal.

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

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

发布评论

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

评论(1

野稚 2024-10-15 04:39:05

这是一个 Emacs 问题。从代码编辑器的角度来看,Delphi模式下的FPC与Delphi没有太大区别。

我发现的一个好方法(Google 是我们的朋友)是 "A Pascal mode for emacs "

  1. 它知道如何缩进所有类型的 Pascal 语句。
  2. 有知道的移动、杀戮、标记和转调功能
    关于程序、句子和表达。
  3. 所有 Pascal 结构如“begin end”、“if then else”等都可以插入
    在模板的帮助下。这是通过插入两个命令“Mp”来完成的
    模板和在模板中的字段之间移动的“Mn”。
  4. 什么时候 ';'插入后光标将立即移回到开头
    以“;”结尾的句子。
    如果 pascal-auto-newline 为非 nil(默认为 nil),则 ';'在一行的末尾
    将执行“RET”来插入并缩进新行。

This is an Emacs question. From the code editor point of view, there is quite no difference between FPC in Delphi mode and Delphi.

A good one I found out (Google was our friend) is "A Pascal mode for emacs":

  1. It knows how to indent all types of Pascal statements.
  2. There are movement, killing, marking and transposing functions that know
    about procedure, sentence and expression.
  3. All Pascal constructs like 'begin end', 'if then else' etc. can be inserted
    with the help of templates. This is done by two commands 'M-p' that inserts
    templates and 'M-n' that move between fields in the templates.
  4. When ';' is inserted the cursor will momentarily move back to the beginning
    of the sentence that was ended by the ';'.
    If pascal-auto-newline is non-nil (default nil), ';' at the end of a line
    will do a 'RET' to insert and indent a new line.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文