Skip to content

Sebagabones/cicode-mode.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cicode-mode is a major mode for Emacs.

I wrote this as my current job involves writing Cicode, and the only editor that had some support for it (aside from the, er, terrible built in editor that came with Citect/PlantSCADA) was Notepad++.

As an Emacs user, this would not do, and so I quickly made cicode-mode. It is not particularly good, and any contributions are welcome. Do note that this is my first attempt at making a mode for Emacs, and I do not think that I am very good at elisp.

Installation

Using use-package:

(use-package cicode-mode
  :straight (cicode-mode :type git :host github :repo "Sebagabones/cicode-mode.el")
  :ensure t  )

Example:

doc/example.png

Or an example using the “recommended” Cicode formatting from johnwiltshire.com: doc/example2.png

Features

  • There is indentation
  • There is colour
  • There is not much else

Known Bugs/Limitations

  • Indentation is not brilliant, please see Indentation issues
  • SELECT CASE indentation is very broken
  • ! style comments are not supported (but // line comments and /* */ block comments are)
  • I have not tried to implement support for any of the :# syntax
  • Some of the inbuilt functions are picked up as inbuilts, but I doubt all of them are.
  • There are a few bugs with the syntax highlighting

Indentation issues

Indentation seems to work fine for the suggested format of cicode. That said, the suggested formatting of cicode is painful at best, and doesn’t lend itself well to find cicode function definitions (the way I currently do this is with ripgrep, searching for "ION <function name>").

That said, indentation with the style I do does not work perfectly - when creating a function, the first line underneath the function definition does not indent correctly (or at all). I find the best way to work around this is to manually indent this line, and then make a blank line (which also does not indent correctly), and then to start writing the rest of the function (see the first screenshot for an example of what I mean). This method is not perfect, but at least it lends itself well to having a separation between all of the variable initialisation (which all need to be done at the start of the function anyway) and the logic of the function.

I think the issue with the second line inside of the function not indenting also applies to the suggested formatting style.

About

Emacs major mode for the Cicode programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •