Robot case files have .robot extension
Since .txt file can be any text file not only a robot file, it is better to replace this comment statement @http://code.google.com/p/robot-mode/source/browse/trunk/robot-mode.el?r=31 --- ln 8. (add-to-list 'auto-mode-alist '(".txt'" . robot-mode)) it can be rewritten as (add-to-list 'auto-mode-alist '(".robot'" . robot-mode))
I'm not a fan of @madhavan020985's approach, as I prefer not using the extension for this.
Coming from Vim, I used this plugin which could identify Robot files by the file's coding. However, doing the same in Emacs triggers an "Invalid coding system robot'" message, which is understandable. Is there a way of making this work with robot-mode` anyway?
There might be a way of doing that outside of this package, but I'm a newcomer to Emacs/Lisp, so pardon my ignorance.
Thanks!
I have robot-mode.el in ~/.emacs.d-directory and following in my ~/.emacs.d/init.el:
(setq load-path (cons "~/.emacs.d" load-path))
(autoload 'robot-mode "robot-mode")
The first line of all my test files is:
# -*- mode: robot -*-
Now all test files open in robot mode.
This is addressed in PR https://github.com/sakari/robot-mode/pull/8/commits/e5ff714fd12b5deb27b274a9946b744ab77319ee. The Robot Framework user guide says:
The recommended extension for test case files in the plain text format is .robot.
@sakari This project seems unmaintained, correct? If so, I'll go ahead and create a fork of it.