If your editor of choice should be Emacs or XEmacs, the RIS mode (ris.el) shipped with refdb will make editing RIS datasets a little bit more comfortable. This major mode is still in its infancy, so it will currently do only a few things for you:
Font-locking will help you to spot syntax errors in the tags. Especially the end tag (ER - ) is prone to lack the trailing space if you're not careful. The ris-mode displays regular tags in blue and the special type (TY - ) and end (ER - ) tags in red. Tags will be displayed in the default foreground color if anything is wrong with them, like invalid specifiers, lowercase specifiers, missing or additional spaces.
ris-mode provides three commands to insert datasets ("references") and individual tags as described shortly. All of these commands have in common that they always start a new line after the current line if the cursor is not at the start of a line. Thus you can run these commands from any position of the current line and still get something that makes sense as a RIS dataset.
Run the command insert-set (C-c-C-s) to insert a new skeleton dataset (a "reference"). The function will prompt you to enter the publication type. You can use either the auto-completion feature of the minibuffer to enter a valid type or the history feature to select a previously entered type. The function will create a newline, a type tag with the type you selected, and an end tag.
You can insert a new tag at the beginning of a line with the command insert-tag which is bound to C-c-C-t. Use either the auto-completion feature of the minibuffer to enter a valid tag or the history feature to select a previously entered tag.
You can insert a new line below the current line with the same tag as the current line with the command duplicate-tag. This is bound to M-RET. This command is convenient if you add multiple keywords or authors, each of which have to go on separate tag lines.
You can move between RIS datasets with the commands backward-set (C-x[) and forward-set (C-x]). You can narrow the buffer to the current RIS set with the command narrow-to-set (C-xns). To widen to the full buffer contents again you'd use C-xnw as usual.
Note: ris-mode does not attempt to validate the buffer contents. You can create invalid tags, leave out the essential type or end tags, forget about the newline preceeding each dataset and ris-mode will not complain. However, you can spot most errors by looking at the font colors: If the first and the last line of a dataset are not displayed in red, you have a problem (you might be using a monochrome display but that's not what I mean). If any tag (except TY and ER) is not displayed in blue, you have a problem as well.
To install this mode on your system, follow these simple steps:
Either copy ris.el into a directory which is in your load-path (/usr/local/share/emacs/site-lisp is a common place for such files), or include /usr/local/share/refdb/site-lisp in your load-path.
If you're a speed fanatic, byte-compile ris.el with the Emacs command M-x byte-compile-file path/to/ris.el. You won't notice a difference on systems later than a 486, though.
Put the following code into your ~/.emacs or into the site-wide site-start.el:
;; Turn on syntax coloring (cond ((fboundp 'global-font-lock-mode) ;; Turn on font-lock in all modes that support it (global-font-lock-mode t) ;; maximum colors (setq font-lock-maximum-decoration t))) ;; ris mode (autoload 'ris-mode "ris" "Major mode for RIS bibliography files." t) (or (assoc "\\.ris$" auto-mode-alist) (setq auto-mode-alist (cons '("\\.ris$" . ris-mode) auto-mode-alist))) |