dyalog-mode for GNU Emacs

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

dyalog-mode for GNU Emacs

Postby harsman on Tue Aug 09, 2011 9:46 pm

I just published dyalog-mode, a major mode for GNU Emacs. If you ever edit or view Dyalog APL source in Emacs, you'll probably find it useful.

It currently supports basic syntax highlighting and indentation. It doesn't actually parse the code, but relies on somewhat hacky regular expressions to do its job, so it isn't perfect but it works well enough.

I and several of my colleagues use Emacs to view diffs of source code changes and dyalog-mode gives us syntax highlighting, better diffs due to it's built in lexer, and automatic indentation when making small edits during merges.

To install, just download dyalog-mode.el and place it somewhere in your load path. Then add something like the following to your Emacs init file:

Code: Select all
(autoload 'dyalog-mode "dyalog-mode" "Edit Dyalog APL" t)
(add-to-list 'auto-mode-alist '("\\.apl\\'" . dyalog-mode))
(add-to-list 'auto-mode-alist '("\\.dyalog$" . dyalog-mode))


If you use Ediff to view diffs of Dyalog APL source code (e.g from some sort of SCM like SVN, Git or Mercurial), you can get dyalog-mode to lex the source. It does a better jobb than Ediff's generic lexer which leads to better diffs. Add something like this to your Emacs init file:

Code: Select all
(autoload 'dyalog-ediff-forward-word "dyalog-mode" "Dyalog mode" t)
(setq ediff-forward-word-function 'dyalog-ediff-forward-word)


If you don't use Emacs, dyalog-mode probably isn't for you.
harsman
 
Posts: 27
Joined: Thu Nov 26, 2009 12:21 pm

Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest