]> code.delx.au - gnu-emacs-elpa/blob - packages/arbitools/arbitools.el
packages/arbitools: Added new functions
[gnu-emacs-elpa] / packages / arbitools / arbitools.el
1 ;;; arbitools.el --- Package for chess tournaments administration
2
3 ;; Copyright 2016 Free Software Foundation, Inc.
4
5 ;; Author: David Gonzalez Gandara <dggandara@member.fsf.org>
6 ;; Version: 0.53
7
8 ;; This program is free software: you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
12 ;;
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
17 ;;
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 ;;; Commentary:
22
23 ;; REQUIRES:
24 ;; ---------------------------
25 ;; Some functions require the arbitools python package, you can install
26 ;; it by: "pip3 install arbitools"
27 ;; "pdflatex" is necessary in case you want to get pdfs.
28 ;;
29 ;; USAGE:
30 ;; ---------------------------
31 ;; arbitools.el is an interface for the python package "arbitools",
32 ;; designed to manage chess tournament reports. If you don't install the
33 ;; python package you can still have the syntax colouring and some native
34 ;; functions. In the future, all the functions will be translated to ELISP.
35 ;;
36 ;; FEATURES:
37 ;; ----------------------------
38 ;; - Syntax colouring for the official trf FIDE files. This facilitates
39 ;; manual edition of the files.
40 ;;
41 ;; - Updating the players ratings. - with python
42 ;;
43 ;; - Adding players to an existing file. - with python
44 ;;
45 ;; - Getting standings from a tournament file. -with python
46 ;;
47 ;; - Getting IT3 Tournament report form. - with python
48 ;;
49 ;; - Deleting a round. - Native
50 ;;
51 ;; - Insert result. - Native
52 ;;
53 ;; - Insert player. - Native
54 ;;
55 ;; - Get the pairing or results of a round - Native
56 ;;
57 ;; - Get the list of the players - Native
58 ;;
59 ;; - Delete player. Adjust all rank numbers - Native
60 ;;
61 ;; TODO:
62 ;; ---------------------------------
63 ;;
64 ;; - Automatically purge all players who didn't play any games.
65 ;;
66 ;; - Insert results from a results file created with a pairing program.
67 ;; Add the date in the "132" line and the results in the "001" lines.
68 ;;
69 ;; - Add empty round. Ask for date create empty space in the players lines.
70 ;; Add the date in the "132" line.
71 ;;
72 ;; - Add the rank number and the position automatically when adding players.
73 ;;
74 ;; - Add team.
75 ;;
76 ;; - Add player to team. Prompt for team and player number.
77 ;;
78 ;; - Generate pgn file for a round or the whole tournament.
79 ;;
80 ;; - Adjust points for each player, according to results of rounds
81 ;;
82 ;; - Reorder the ranking
83 ;;
84 ;; - Reorder the players list
85 ;;
86 ;; - Print Stantings
87 ;;
88 ;; You will find more information in www.ourenxadrez.org/arbitools.htm
89
90 ;;; Code:
91
92
93 (defun arbitools-update (elolist)
94 "Update the players ratings in a database file based on a elo list file."
95 (interactive "selolist:")
96 ;; FIXME: What if `list' is "foo; bar"?
97 (call-process "arbitools-run.py" nil "Arbitools-output" nil "update" buffer-file-name "-l" elolist))
98
99 (defun arbitools-add (addfile)
100 "Add players to an existing database file."
101 (interactive "faddfile: ")
102 ;; FIXME: What if `addlist' is "foo; bar"?
103 (call-process "arbitools-add.py" nil "Arbitools-output" nil "-a" addfile "-i" buffer-file-name))
104
105 (defun arbitools-list-pairing (round)
106 "Get the pairings and/or results of the given round"
107 (interactive "sround: ")
108 (beginning-of-buffer)
109 (arbitools-list-players)
110 (save-excursion
111 (re-search-forward "^012" nil t)
112 (let* ((linestring (thing-at-point 'line))
113 (tournamentnamestring (substring linestring 4)))
114 (with-current-buffer "Pairings List"
115 (erase-buffer)
116 (insert (format "%s" tournamentnamestring)))))
117 (with-current-buffer "Pairings List"
118 (insert (format "Pairings for round %s\n\n" round)) )
119 (let* ((paired '()))
120
121 (while (re-search-forward "^001" nil t)
122 (let* ((namestring nil)
123 (linestring (thing-at-point 'line))
124 (playerlinestring nil)
125 (opponentlinestring nil)
126 (rankstring (substring linestring 4 8))
127 (opponent (substring linestring (+ 91 (* (- (string-to-number round) 1)10 ))
128 (+ 95(* (- (string-to-number round) 1)10 ))))
129 (color (substring linestring (+ 96 (* (- (string-to-number round) 1)10 ))
130 (+ 97(* (- (string-to-number round) 1)10 ))))
131 (result (substring linestring (+ 98 (* (- (string-to-number round) 1)10 ))
132 (+ 99(* (- (string-to-number round) 1)10 )))))
133 (with-current-buffer "Arbitools-output"
134 (insert (format "%s\n" paired))
135 (insert (format "-%s-" rankstring))
136 (insert (format "%s\n" (member " 1" paired))))
137 (unless (or (member rankstring paired) (member opponent paired))
138 (with-current-buffer "List of players"
139 (beginning-of-buffer)
140 (re-search-forward (concat "^" (regexp-quote rankstring)))
141 (setq playerlinestring (thing-at-point 'line))
142 (setq namestring (substring playerlinestring 4 37))
143 (beginning-of-buffer)
144 (unless (or (string= opponent "0000") (string= opponent " "))
145 (re-search-forward (concat "^" (regexp-quote opponent))))
146 (setq opponentlinestring (thing-at-point 'line))
147 (setq opponentstring (substring opponentlinestring 4 37))
148 (when (or (string= opponent "0000")(string= opponent " "))
149 (setq opponentstring "-"))
150 (add-to-list 'paired rankstring))
151 (with-current-buffer "Pairings List"
152 (cond ((string= color "w") ;; TODO: change the ranknumber with the name
153 (cond ((string= result "1")
154 (insert (format "%s 1-0 %s\n" namestring opponentstring)))
155 ((string= result "0")
156 (insert (format "%s 0-1 %s\n" namestring opponentstring)))
157 ((string= result "+")
158 (insert (format "%s + - %s\n" namestring opponentstring)))
159 ((string= result "-")
160 (insert (format "%s - + %s\n" namestring opponentstring)))
161 ((string= result "=")
162 (insert (format "%s 1/2 %s\n" namestring opponentstring)))))
163 ((string= color "b")
164 (cond ((string= result "1")
165 (insert (format "%s 0-1 %s\n" opponentstring namestring)))
166 ((string= result "0")
167 (insert (format "%s 1-0 %s\n" opponentstring namestring)))
168 ((string= result "+")
169 (insert (format "%s - + %s\n" opponentstring namestring)))
170 ((string= result "-")
171 (insert (format "%s + - %s\n" opponentstring namestring)))
172 ((string= result "=")
173 (insert (format "%s 1/2 %s\n" opponentstring namestring))))))))))))
174
175
176 (defun arbitools-standings ()
177 "Get standings and report files from a tournament file."
178 (interactive)
179 ;; (shell-command (concat (expand-file-name "arbitools-standings.py") " -i " buffer-file-name))) ;this is to use the actual path
180 (call-process "arbitools-run.py" nil "Arbitools-output" nil "standings" buffer-file-name))
181
182 (defun arbitools-list-players ()
183 "Put the list of players in two buffers, one in plain text and another in a beautiful LaTeX"
184 ;; TODO: the beautiful LaTeX
185 (interactive)
186 (save-excursion
187 (beginning-of-buffer)
188 (while (re-search-forward "^001" nil t)
189 (let* ((linestring (thing-at-point 'line))
190 (rankstring (substring linestring 5 8)))
191
192 (with-current-buffer "List of players"
193 (insert (format " %s " rankstring))))
194
195 (let* ((name (thing-at-point 'word))
196 (linestring (thing-at-point 'line))
197 (namestring (substring linestring 14 47)))
198
199 (with-current-buffer "List of players"
200 (insert (format "%s " namestring))))
201
202 (let* ((linestring (thing-at-point 'line))
203 (elostring (substring linestring 48 52)))
204
205 (with-current-buffer "List of players"
206 (insert (format "%s\n" elostring))))))
207 (with-current-buffer "List of players"
208 (remove-text-properties (point-min)(point-max) '(face nil))))
209
210 (defun arbitools-new-trf ()
211 "Create an empty trf file"
212 (interactive)
213 (generate-new-buffer "New trf")
214 (switch-to-buffer "New trf")
215 (set-buffer "New trf")
216 (arbitools-mode)
217 (insert "012 NAME OF THE TOURNAMENT\n")
218 (insert "022 PLACE\n")
219 (insert "032 FEDERATION\n")
220 (insert "042 STARTING DATE (YYYY/MM/DD)\n")
221 (insert "052 ENDING DATE (YYYY/MM/DD)\n")
222 (insert "062 NUMBER OF PLAYERS\n")
223 (insert "072 NUMBER OF RATED PLAYERS\n")
224 (insert "082 NUMBER OF TEAMS\n")
225 (insert "092 TYPE OF TOURNAMENT\n")
226 (insert "102 CHIEF ARBITER\n")
227 (insert "112 DEPUTY CHIEF ARBITER\n")
228 (insert "122 ALLOTED TIMES PER MOVE/GAME\n")
229 (insert "132 DATES YY/MM/DD YY/MM/DD\n")
230 ;; (insert "001 000 GTIT NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN RAT. FED 0000000000 YYYY/MM/DD 00.0 RNK 0000 C R 0000 C R\n")
231 ;; (insert "013 NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 0000 0000\n")
232 )
233
234 (defun aribitools-number-of-rounds ()
235 "Get the number of rounds in the tournament"
236 ;; FIXME: EXPERIMENTAL
237 (let ((numberofrounds 0))
238 (save-excursion
239 (beginning-of-buffer)
240 (re-search-forward "^132" nil t)
241 (let* ((linestringrounds (thing-at-point 'line))
242 (actualround " ")
243 (beginning-of-round 91)
244 (end-of-round 99)
245 (continue t))
246
247 (with-current-buffer "Arbitools-output" (insert (format "rounds: %s" linestringrounds)))
248 (with-current-buffer "Arbitools-output" (insert (format "length: %s" (- (length linestringrounds) 4))))
249 ;; For some reason, the length of the string is 4 characters longer than the real line
250 (while continue
251 (if (< end-of-round (length linestringrounds))
252
253 (progn
254 (setq actualround (substring-no-properties linestringrounds beginning-of-round end-of-round))
255 (setq numberofrounds (+ numberofrounds 1))
256 (setq beginning-of-round (+ beginning-of-round 10))
257 (setq end-of-round (+ end-of-round 10)))
258
259 (setq continue nil))))))
260 (numberofrounds))
261
262 (defun arbitools-delete-player (player)
263 "Delete a player. Adjust all the rank numbers accordingly."
264 (interactive "splayer: ")
265 (let ((numberofrounds 0)
266 (elo ""))
267
268 (save-excursion
269 (beginning-of-buffer)
270 (re-search-forward "^132" nil t)
271 (let* ((linestringrounds (thing-at-point 'line))
272 (actualround " ")
273 (beginning-of-round 91)
274 (end-of-round 99)
275 (continue t))
276 (while continue
277 (if (< end-of-round (length linestringrounds))
278 (progn
279 (setq actualround (substring-no-properties linestringrounds beginning-of-round end-of-round))
280 (setq numberofrounds (+ numberofrounds 1))
281 (setq beginning-of-round (+ beginning-of-round 10))
282 (setq end-of-round (+ end-of-round 10)))
283 (setq continue nil)))))
284 (save-excursion
285 (beginning-of-buffer)
286 (while (re-search-forward "^001" nil t)
287 (let* ((linestring (thing-at-point 'line))
288 (rankstring (substring linestring 5 8)))
289 (when (= (string-to-number rankstring) (string-to-number player))
290 (forward-char 1)
291 (delete-char 4)
292 (insert " DEL")
293 (setq elo (substring linestring 48 52))
294 (with-current-buffer "Arbitools-output" (insert (format "%s" elo))))
295 (when (> (string-to-number rankstring)(string-to-number player))
296 (forward-char 1)
297 (delete-char 4)
298 (insert-char ?\s (- 4 (length (format "%s" (- (string-to-number rankstring) 1)))))
299 (insert (format "%s" (- (string-to-number rankstring) 1)))
300 (save-excursion
301 (beginning-of-buffer)
302 (while (re-search-forward "^001" nil t)
303 (let* ((linestring2 (thing-at-point 'line))
304 (actualroundopponent (string-to-number (substring linestring2 91 94)))
305 (roundcount 1)
306 (testmessage ""))
307 (forward-char (+ 91 (* (- roundcount 1) 10)))
308 (setq testmessage (thing-at-point 'word))
309 (while (< roundcount numberofrounds)
310 (beginning-of-line)
311 (forward-char (+ 95 (* (- roundcount 1) 10)))
312 (when (string= (format "%s" (string-to-number rankstring)) (thing-at-point 'word))
313 (forward-char -4) ;; go back to the beginning of the opponent's number
314 (delete-char 4) ;; remove the original opponent's number
315 (insert-char ?\s (- 4 (length (format "%s" (- (string-to-number rankstring) 1)))))
316 (insert (format "%s" (- (string-to-number rankstring) 1))))
317 (setq roundcount (+ roundcount 1))))))))))
318 ;;(condition-case nil ;; TODO: fix teams info
319 ;; (while (re-search-forward "^013")
320 ;; (let* ((linestringteam (thing-at-point 'line)))
321 ;; ;; go through team line and read the integrants
322 ;; ;; when integrant equals rankstring rankstring -1
323 ;; ))
324 ;; (error "No teams information"))
325 (save-excursion ;; Actually delete the player's line
326 (beginning-of-buffer)
327 (while (re-search-forward "^001 DEL" nil t)
328 (beginning-of-line)
329 (let ((beg (point)))
330 (forward-line 1)
331 (delete-region beg (point)))))
332 ;; TODO delete the rank from teams section
333 ;; TODO change number of players and number of rated players
334 (save-excursion
335 (with-current-buffer "Arbitools-output" (insert (format "%s" elo)))
336 (beginning-of-buffer)
337 (re-search-forward "^062 ")
338 (let* ((linestring (thing-at-point 'line))
339 (numberofplayers (substring linestring 4)))
340 (delete-char (length numberofplayers))
341 (setq numberofplayers (string-to-number numberofplayers))
342 (setq numberofplayers (- numberofplayers 1))
343 (insert (concat (number-to-string numberofplayers) "\n")))
344 (re-search-forward "^072 ")
345 (let* ((linestring (thing-at-point 'line))
346 (numberofratedplayers (substring linestring 4)))
347 (unless (< (length elo) 2) ;; if elo is 0 or nonexistent
348 (delete-char (length numberofratedplayers))
349 (setq numberofratedplayers (string-to-number numberofratedplayers))
350 (setq numberofratedplayers (- numberofratedplayers 1))
351 (insert (concat (number-to-string numberofratedplayers) "\n")))))))
352
353 (defun arbitools-delete-round (round)
354 "Delete a round." ;; FIXME: it breaks when round is the last
355 (interactive "sround: ")
356 (save-excursion
357 (beginning-of-buffer)
358 (while (re-search-forward "^001" nil t)
359 (forward-char (+ 88 (* (- (string-to-number round) 1) 10)))
360 (delete-char 10)
361 (insert " "))))
362
363 (defun arbitools-replace-empty ()
364 "Replace non played games with spaces"
365 (interactive)
366 (save-excursion
367 (replace-string "0000 - 0" " ")))
368
369 (defun arbitools-insert-player (sex title name elo fed idfide year)
370 "Insert a player"
371 ;; TODO: automatically insert the rank.
372 (interactive "ssex: \nstitle: \nsname: \nselo: \nsfed: \nsidfide: \nsyear: ")
373 (let ((playerlinelength nil)
374 (thislinelength nil))
375 (save-excursion
376 (beginning-of-buffer)
377 (re-search-forward "^001 ")
378 (let* ((linestring (thing-at-point 'line)))
379 (setq playerlinelength (length linestring))))
380 (insert (format "001 RANK %s" sex))
381 (when (= (length sex) 0) (insert " ")) ;; add extra space if the sex string is empty
382 (insert-char ?\s (- 3 (length title)))
383 (insert (format "%s " title))
384 (insert (format "%s" name))
385 (insert-char ?\s (- 34 (length name)))
386 (insert (format "%s " elo))
387 (when (= (length elo) 0) (insert " ")) ;; add extra space if the elo is empty
388 (when (= (length elo) 1) (insert " ")) ;; add extra space if the elo is a "0"
389 (insert (format "%s" fed))
390 (when (= (length fed) 0) (insert " ")) ;; add extra space if fed is empty
391 (insert-char ?\s (- 12 (length idfide)))
392 (insert (format "%s " idfide))
393 (insert (format "%s " year))
394 (when (= (length year) 0) (insert " ")) ;; TODO: improve this to make it support different data formats
395 (insert (format " 0.0 POS"))
396 (setq thislinelength (length (thing-at-point 'line)))
397 (insert-char ?\s (- playerlinelength thislinelength)))
398 (save-excursion
399 (beginning-of-buffer)
400 (re-search-forward "^062 ")
401 (let* ((linestring (thing-at-point 'line))
402 (numberofplayers (substring linestring 4)))
403 (delete-char (length numberofplayers))
404 (setq numberofplayers (string-to-number numberofplayers))
405 (setq numberofplayers (+ 1 numberofplayers))
406 (insert (concat (number-to-string numberofplayers) "\n")))
407 (re-search-forward "^072 ")
408 (let* ((linestring (thing-at-point 'line))
409 (numberofratedplayers (substring linestring 4)))
410 (unless (< (length elo) 2)
411 (delete-char (length numberofratedplayers))
412 (setq numberofratedplayers (string-to-number numberofratedplayers))
413 (setq numberofratedplayers (+ 1 numberofratedplayers))
414 (insert (concat (number-to-string numberofratedplayers) "\n"))))))
415
416 (defun arbitools-insert-result (round white black result)
417 "Insert a result."
418 (interactive "sround: \nswhite: \nsblack: \nsresult: ")
419 (save-excursion
420 (beginning-of-buffer)
421 (while (re-search-forward "^001" nil t)
422 (forward-char 4) ;; rank number
423 (when (string= white (thing-at-point 'word))
424 ;;go to first round taking into account the cursor is in the rank number
425 (forward-char (+ 85 (* (- (string-to-number round) 1) 10)))
426 (insert " ") ;; replace the first positions with spaces
427 (delete-char 2) ;; delete the former characters
428 ;; make room for bigger numbers
429 (cond ((= 2 (length black))
430 (backward-char 1))
431 ((= 3 (length black))
432 (backward-char 2)))
433 (insert (format "%s w %s" black result))
434 (delete-char 5)
435 ;; adjust when numbers are longer
436 (cond ((= 2 (length black)) (delete-char 1))
437 ((= 3 (length black)) (delete-char 2))))
438 (when (string= black (thing-at-point 'word))
439 ;; go to first round taking into account the cursor is in the rank number
440 (forward-char (+ 85 (* (- (string-to-number round) 1) 10)))
441 (insert " ") ;; replace the first positions with spaces
442 (delete-char 2) ;; delete the former characters
443 ;; make room for bigger numbers
444 (cond ((= 2 (length white)) (backward-char 1))
445 ((= 3 (length white)) (backward-char 2)))
446 (cond ((string= "1" result) (insert (format "%s b 0" white)))
447 ((string= "=" result) (insert (format "%s b =" white)))
448 ((string= "+" result) (insert (format "%s b +" white)))
449 ((string= "-" result) (insert (format "%s b -" white)))
450 ((string= "0" result) (insert (format "%s b 1" white))))
451 (delete-char 5)
452 ;; adjust when numbers are longer
453 (cond ((= 2 (length white)) (delete-char 1))
454 ((= 3 (length white)) (delete-char 2)))))))
455
456 (defun arbitools-it3 ()
457 "Get the IT3 tournament report. You will get a .tex file, and a pdf
458 if you have pdflatex installed."
459 (interactive)
460 (call-process "arbitools-run.py" nil "Arbitools-output" nil "it3" buffer-file-name))
461
462 ;; TODO: New It3 function, usint it3.tex from home directory, replacing the data and pdflatex it
463
464 (defun arbitools-fedarating ()
465 "Get the FEDA rating admin file."
466 (interactive)
467 (call-process "arbitools-run.py" nil "Arbitools-output" nil "fedarating" buffer-file-name))
468
469 (defvar arbitools-mode-map
470 (let ((map (make-sparse-keymap)))
471 (define-key map (kbd "C-c i") 'arbitools-it3)
472 (define-key map (kbd "C-c r") 'arbitools-insert-result)
473 (define-key map (kbd "C-c p") 'arbitools-insert-player)
474 map)
475 "Keymap for Arbitools major mode.")
476
477
478 (easy-menu-define arbitools-mode-menu arbitools-mode-map
479 "Menu for Arbitools mode"
480 '("Arbitools"
481 ["New Tournament" arbitools-new-trf]
482 "---"
483 ["Insert Player" arbitools-insert-player]
484 ["Insert Result" arbitools-insert-result]
485 ["Delete Round" arbitools-delete-round]
486 "---"
487 ["List Players" arbitools-list-players]
488 ["List Pairings" arbitools-list-pairing]
489 "---"
490 ["Update Elo" arbitools-update]
491 ["Get It3 form Report" arbitools-it3]
492 ["Get FEDA Rating file" arbitools-fedarating]
493 ))
494
495
496 (defvar arbitools-highlights
497 '(("^001" . font-lock-function-name-face) ; name of the tournament
498 ("^012.*" . font-lock-comment-face)
499 ("\\(^022\\|^032\\|^042\\|^052\\|^062\\|^072\\|^082\\|^092\\|^102\\|^112\\|^122\\).*" . font-lock-constant-face)
500 ("^132.*" . font-lock-warning-face) ;dates
501 ("^013" . font-lock-warning-face) ;teams
502 ("\\(^013.\\{1\\}\\)\\(.\\{31\\}\\)" 2 font-lock-comment-face) ;; teams
503 ;; (" [0-9]\\{6,\\} " . font-lock-variable-name-face) ;FIDE ID
504 ("\\(^001.\\{11\\}\\)\\(.\\{32\\}\\)" 2 font-lock-string-face) ;; Name of the player (by position)
505 ("\\(^001.\\{55\\}\\)\\(.\\{10\\}\\)" 2 font-lock-function-name-face) ;; FIDE ID
506 ("\\(^001.\\{88\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face) ;; round 1 opponent
507 ;; ("\\(^132.\\{88\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face) ;; round 1 date line
508 ("\\(^001.\\{93\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face) ;; round 1 colour
509 ("\\(^001.\\{95\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face) ;; round 1 result
510 ;; rest of rounds
511 ("\\(^001.\\{98\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
512 ;; ("\\(^132.\\{98\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
513 ("\\(^001.\\{103\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
514 ("\\(^001.\\{105\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
515 ("\\(^001.\\{108\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
516 ;; ("\\(^132.\\{108\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
517 ("\\(^001.\\{113\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
518 ("\\(^001.\\{115\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
519 ("\\(^001.\\{118\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
520 ;; ("\\(^132.\\{118\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
521 ("\\(^001.\\{123\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
522 ("\\(^001.\\{125\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
523 ("\\(^001.\\{128\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
524 ;; ("\\(^132.\\{128\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
525 ("\\(^001.\\{133\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
526 ("\\(^001.\\{135\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
527 ("\\(^001.\\{138\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
528 ;; ("\\(^132.\\{138\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
529 ("\\(^001.\\{143\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
530 ("\\(^001.\\{145\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
531 ("\\(^001.\\{148\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
532 ;; ("\\(^132.\\{148\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
533 ("\\(^001.\\{153\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
534 ("\\(^001.\\{155\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
535 ("\\(^001.\\{158\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
536 ;; ("\\(^132.\\{158\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
537 ("\\(^001.\\{163\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
538 ("\\(^001.\\{165\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
539 ("\\(^001.\\{168\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
540 ;; ("\\(^132.\\{168\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
541 ("\\(^001.\\{173\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
542 ("\\(^001.\\{175\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
543 ("\\(^001.\\{178\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
544 ;; ("\\(^132.\\{178\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
545 ("\\(^001.\\{183\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
546 ("\\(^001.\\{185\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
547 ("\\(^001.\\{188\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
548 ;; ("\\(^132.\\{188\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
549 ("\\(^001.\\{193\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
550 ("\\(^001.\\{195\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)
551 ("\\(^001.\\{198\\}\\)\\(.\\{4\\}\\)" 2 font-lock-comment-face)
552 ;; ("\\(^132.\\{198\\}\\)\\(.\\{8\\}\\)" 2 font-lock-string-face)
553 ("\\(^001.\\{203\\}\\)\\(.\\{1\\}\\)" 2 font-lock-string-face)
554 ("\\(^001.\\{205\\}\\)\\(.\\{1\\}\\)" 2 font-lock-function-name-face)))
555
556 ;;;###autoload
557 (define-derived-mode arbitools-mode
558 fundamental-mode
559 "Arbitools"
560 "Major mode for Chess Tournament Management."
561 ;(setq font-lock-defaults '(arbitools-highlights))
562 (use-local-map arbitools-mode-map)
563 (generate-new-buffer "Arbitools-output")
564 (generate-new-buffer "List of players")
565 (generate-new-buffer "Pairings List")
566 (column-number-mode)
567 (set (make-local-variable 'font-lock-defaults) '(arbitools-highlights)))
568
569 ;;;###autoload
570 (add-to-list 'auto-mode-alist '("\\.trf?\\'" . arbitools-mode))
571
572 (provide 'arbitools)
573
574 ;;; arbitools.el ends here