Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kopoli/robot-mode

Emacs major mode for editing Robot Framework files.
https://github.com/kopoli/robot-mode

Last synced: about 2 months ago
JSON representation

Emacs major mode for editing Robot Framework files.

Awesome Lists containing this project

README

        

Emacs Logo
## robot-mode.el
*Major-mode for Robot Framework files*

---
[![License GPLv3](https://img.shields.io/badge/license-GPL_v3-green.svg)](http://www.gnu.org/licenses/gpl-3.0.html)
[![MELPA](http://melpa.org/packages/robot-mode-badge.svg)](http://melpa.org/#/robot-mode)
[![MELPA Stable](http://stable.melpa.org/packages/robot-mode-badge.svg)](http://stable.melpa.org/#/robot-mode)

### Description

A Robot Framework major mode for Emacs. Robot Framework is a framework for
acceptance testing.

- https://robotframework.org
- https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html

This major mode provides the following:
- Syntax highlighting.
- Indentation.
- Alignment of keyword contents.
- Line continuation in Robot Framework syntax.
- A helper for adding necessary spaces between arguments.

#### Alignment of keyword contents

Align the contents of a keyword, test or task with C-c C-a. It changes the
following code:

Example Keyword
[Documentation] Documents the keyword
[Arguments] ${arg1} ${arg2}
Log ${arg1} ${arg2}

To:

Example Keyword
[Documentation] Documents the keyword
[Arguments] ${arg1} ${arg2}
Log ${arg1} ${arg2}

#### Line continuation

Insert a newline, indentation, ellipsis and necessary spaces at current
point with C-c C-j. For example (| denotes the cursor):

Another Keyword
[Documentation] A very long text| that describes the keyword.

To:

Another Keyword
[Documentation] A very long text
... |that describes the keyword.

#### Add spacing for an argument

Robot framework separates arguments to keywords with 2 or more spaces. The
C-c C-SPC sets the whitespace amount around point to exactly
`robot-mode-argument-separator`. For example (| denotes the cursor):

Example Keyword
[Arguments] ${first}|${second}

To:

Example Keyword
[Arguments] ${first} |${second}

### Limitations

- Currently supports only the Space separated format:
https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#space-separated-format
- Does NOT support the Pipe separated format or the reStructuredText
format.

### Notable changes

Version 0.8.0

- Add `robot-mode-retain-point-on-indent` option to retain point position
when indenting. Currently it is disabled by default, but may be enabled
in the future.
- Prevent indent toggling from interfering with TAB completion when
`tab-always-indent` is set to 'complete and the above point retention is
used.
- Fix several indent toggling bugs:
- Set `electric-indent-inhibit`.
- Disable when aligning by using variable `robot-mode-indent-toggle`.
- Fix syntax highlighting and indentation when a control structure word is
the first word in a keyword.
- Fix various other syntax highlighting bugs.

Version 0.7.0

- Add control structure indentation (IF/WHILE/FOR/TRY etc.).

### Customization Documentation

#### `robot-mode-basic-offset`

The amount of indentation for test and keyword steps.

#### `robot-mode-argument-separator`

The amount of spaces between different arguments to keywords.

#### `robot-mode-retain-point-on-indent`

If the `point` position is after the indentation, retain it when
indenting a line. Otherwise move `point` always `back-to-indentation`.

### Function and Macro Documentation

#### `(robot-mode-syntax-propertize START END)`

Propertize text between START and END.

#### `(robot-mode-indent-line)`

Indent current line in Robot mode.
Used as `indent-line-function` of the mode.

#### `(robot-mode-beginning-of-defun)`

Move the point to the beginning of the current defun.
Defuns are the steps of a keyword, test or task. This is used as
`beginning-of-defun-function` of the mode.

#### `(robot-mode-end-of-defun)`

Move the point to the end of the current defun.
Defuns are the steps of a keyword, test or task. This is used as
`end-of-defun-function` of the mode.

#### `(robot-mode-align BEG END)`

Align the contents of the region between BEG and END.

#### `(robot-mode-align-defun)`

Align the contents current defun.

#### `(robot-mode-align-region-or-defun)`

Call `robot-mode-align` if region is active, otherwise `robot-mode-align-defun`.

#### `(robot-mode-split-continuation)`

Split current line at point and continue in the next line.
Prefix the continuation with indentation, ellipsis and spacing.

#### `(robot-mode-add-argument)`

Add exactly `robot-mode-argument-separator` spaces to point.

-----


Markdown README file generated by
make-readme-markdown.el