[Refdb-cvs] CVS: elisp ris.el,1.3,1.4
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2005-05-07 20:46:06
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28315 Modified Files: ris.el Log Message: added validation for authors, pubdates, reprints Index: ris.el =================================================================== RCS file: /cvsroot/refdb/elisp/ris.el,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- ris.el 31 Dec 2003 07:08:55 -0000 1.3 +++ ris.el 7 May 2005 20:45:55 -0000 1.4 @@ -2,5 +2,5 @@ ;; $Id$ -;; Copyright (C) 2001 Markus Hoenicka +;; Copyright (C) 2001-2005 Markus Hoenicka ;; Author: Markus Hoenicka <ma...@mh...> @@ -26,9 +26,11 @@ ;;; Commentary: -;; Still crude but works. This mode does not attempt to validate the RIS -;; data but provides some convenience for editing RIS datasets. +;; Still crude but works. This mode does not attempt to fully validate the +;; RIS data but it provides visual clues to avoid the most common errors +;; in addition, it provides some convenience commands for editing RIS +;; datasets. ;; ;; To install this mode, move this file somewhere into your load-path -;; (something like /usr/local/share/emacs/site-lisp), and +;; (something like /usr/local/share/emacs/site-lisp), and (optionally) ;; byte-compile-file it. ;; @@ -57,10 +59,22 @@ (make-face 'ris-tag-face) (make-face 'ris-tyer-tag-face) +(make-face 'ris-author-face) +(make-face 'ris-pubyear-face) +(make-face 'ris-reprint-face) + (set-face-foreground 'ris-main-face "maroon") (set-face-foreground 'ris-tag-face "blue") (set-face-foreground 'ris-tyer-tag-face "red") +(set-face-foreground 'ris-author-face "sea green") +(set-face-foreground 'ris-pubyear-face "IndianRed2") +(set-face-foreground 'ris-reprint-face "deep pink") +;; these regexps do the "validation" (defvar ris-font-lock-keywords - '(("^\\(ID\\|T1\\|TI\\|CT\\|BT\\|A1\\|AU\\|Y1\\|PY\\|N1\\|AB\\|KW\\|RP\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\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JFULL\\|JOUR\\|MAP\\|MGZN\\|MPCT\\|MUSIC\\|NEWS\\|PAMP\\|PAT\\|PCOMM\\|RPRT\\|SER\\|SLIDE\\|SOUND\\|STAT\\|THES\\|UNBILL\\|UNPB\\|VIDEO\\)\\)$\\|^\\(ER - \\)$" 0 'ris-tyer-tag-face t)) @@ -139,5 +153,5 @@ ("AD - " 44) ("UR - " 45)) nil t))) - (message (char-to-string (char-before))) +; (message (char-to-string (char-before))) (if (not (equal (char-before) 10)) (progn |