The most actively updated Cobol mode for Emacs is [https://elpa.gnu.org/packages/cobol-mode.html cobol-mode] (GNU ELPA). It provides:

* Syntax highlighting for Cobol 85, 2002, 2012, 2014, and dialects supported by Micro Focus
* (Rudimentary) indentation for fixed or free style formats.
* Skeleton templates for some language structures.
* Rulers and basic formatting functions,

== Usage ==

You can use ##M-x customize-group cobol## to browse settings. In particular, see ##cobol-format-style## and ##cobol-source-format##.

From then on, you can 

== Other Cobol Modes ==

There is a [https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol Che4z Language Server] for Cobol, though it is untested on [[Eglot]].

An older version of cobol-mode can be found at [https://gist.github.com/Edward-H/6768e7dc53ea3dd2adca its original site].

-----

[http://www.emacswiki.org/cgi-bin/wiki/Rick_Bielawski I'm] writing these
because I didn't like the only other Cobol mode I could find.  I'm not a
COBOL programmer but can/must maintain such programs periodically.  I
believe comments and strings are being handled correctly and keyword
highlighting is starting to take shape.  Both versions are being
developed for Tandem/Guardian/NSK source files.  That is, for use with
Scobol and Tandem Cobol so these modes should handle the extensions
implemented by those compilers.  They may fail to correctly handle
features not implemented by those compilers.  Help appreciated.

* ANSII:    Lisp:cobol-mode.el
* TANDEM:  Lisp:nmcobol-mode.el

To install it, put the ##.el## file into a directory in your LoadPath and add
the appropriate lines to your ##~/.emacs## file:

{{{
(autoload 'cobol-mode    "cobol-mode"    "A major mode for editing ANSI Cobol/Scobol files."    t nil)
(autoload 'NMCobol-mode "nmcobol-mode" "A major mode for editing Tandem format Cobol files." t nil)
}}}

When you are visiting a Cobol or Scobol source file you can use ##M-x
cobol-mode## or ##M-x nmcobol-mode## to activate the appropriate mode.

For the best performance you could [[CompiledFile|byte compile]] these files, but it's not required.  

See the TandemNskSupport page for a method of automatically recognizing
the language of Tandem files since they don't have an extension and
coders often can't stick a ##-*-cobol-*-## comment in line 1.

-------

*Another cobol-mode* (aka clomo).

You can find it on the Azundris site but I don't think it's a good idea
to put a link to it here.  It has a malicious bug that deletes periods
and commas somewhat randomly from your source.  I reported it and since
it wasn't fixed I worry that it is intentionally malicious.

You can fix the bug by changing the syntax properties of period and comma
in the mode's syntax table.  You may also need to comment out the line
(font-lock-unset-defaults) to make it work under GNU Emacs 22.0.50.  It
doesn't have anything close to
[http://www.emacswiki.org/cgi-bin/wiki/cobol-mode.el my] version's
handling of comments and strings but it does do a great many things that
my new one doesn't.  After fixing it's syntax table a given individual
may decide either is the lesser of two evils.

----
There is ##cobol.el## from the
[http://sourceforge.net/projects/cobolforgcc/ COBOL for GCC] project,
with syntax highlighting. It is based on an older ##cobol.el## dated
June 21, 1988, which is itself based on a FORTRAN mode for Emacs.


----
ProgrammingModes
