GNU ELPA - cobol-mode


Mode for editing COBOL code
cobol-mode-1.1.tar (.sig), 2024-Mar-31, 90.0 KiB
Edward Hart <>
Atom feed
Browse repository
CGit or Gitweb

To install this package from Emacs, use package-install or list-packages.

Full description

This file should not be confused with Rick Bielawski's cobol-mode.el
(, which this mode attempts to

This COBOL mode features syntax highlighting for most modern COBOL dialects,
indentation, code skeletons, rulers and basic formatting functions.
Highlighting changes with the code format, which can be specified using the
M-x customize menu.


To install cobol-mode.el, save it to your .emacs.d/ directory and add the
following to your .emacs:
(autoload 'cobol-mode "cobol-mode" "Major mode for highlighting COBOL files." t nil)

To automatically load cobol-mode.el upon opening COBOL files, add this:
(setq auto-mode-alist
       '(("\\.cob\\'" . cobol-mode)
         ("\\.cbl\\'" . cobol-mode)
         ("\\.cpy\\'" . cobol-mode))

Finally, I strongly suggest installing auto-complete-mode, which makes typing
long keywords and variable names a thing of the past.  See

Known bugs:

* Switching source formats requires M-x customize settings to be changed,
  saved and cobol-mode to be unloaded then reloaded.
* Copying-and-pasting content in fixed-format sometimes results in content
  being pasted in column 1 and spaces inserted in the middle of it.
* The indentation code leaves a lot of trailing whitespace.
* Periods on their own line are sometimes indented strangely.
* String continuation does not work.

Missing features:

* Switch between dialect's reserved word lists via M-x customize (without
  unloading cobol-mode).
* Allow users to modify easily reserved word lists.
* Expand copybooks within a buffer.
* String continuation (see above).
* Allow users to modify start of program-name area.

Old versions

cobol-mode-1.0.0.el.lz2017-Jan-1418.2 KiB


- A new submenu for skeletons.
- cobol-mode is now orphaned :-(
  We're looking for a generous soul willing to give it loving care.