]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/arbitools/arbitools.el
Merge commit 'e93367512080e540dc5dd126dfcb38b4a5e9415b' from diff-hl
[gnu-emacs-elpa] / packages / arbitools / arbitools.el
index 1e42e3a1e7747f93a37ee4dd3b8f1d29f5f5778f..f749bfbd0c4decccb6dbb7897d9b7f0f1a17a94b 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright 2016 Free Software Foundation, Inc.
 
 ;; Author: David Gonzalez Gandara <dggandara@member.fsf.org>
-;; Version: 0.55
+;; Version: 0.71
 ;; Package-Requires: ((cl-lib "0.5"))
 
 ;; This program is free software: you can redistribute it and/or modify
   (interactive)
   (save-excursion
     (let ( (numberofrounds (arbitools-number-of-rounds))
-           (pointsstring   "")
            (points         0.0)
            (pointstosum    0.0)
            (roundcount     1))
         (while (<= roundcount numberofrounds)
           (beginning-of-line)
          (forward-char (+ 98 (* (- roundcount 1) 10))) ;; go to where the result is for each round
-          (setq pointsstring (thing-at-point 'symbol))
           (cond ((string= (thing-at-point 'symbol) "1") (setq pointstosum 1.0))
                 ((string= (thing-at-point 'symbol) "+") (setq pointstosum 1.0))
                 ((string= (thing-at-point 'symbol) "=") (setq pointstosum 0.5))
     (let ((datachunk ""))
       (goto-char (point-min))
       (while (re-search-forward "^001" nil t)
-        (let* ((linestring (thing-at-point 'line)))
+        (let* ()
           (beginning-of-line)
           (forward-char 89) ;; get the POS field
           (setq datachunk (thing-at-point 'word))
                  (save-excursion 
                    (while (re-search-forward "^013" nil t)
                     (let* ((linestringteam (thing-at-point 'line))
-                          (actualintegrant (string-to-number (substring linestringteam 40 44)))
                           (integrantcount 0)
                           (members 0))
 
           (insert (concat (number-to-string numberofratedplayers) "\n")))))))
 
 (defun arbitools-delete-round (round)
-   "Delete a round." ;; FIXME: it breaks when round is the last
+   "Delete a round."
    (interactive "sround: ")
    (save-excursion
     (goto-char (point-min))
     (while (re-search-forward "^001" nil t)
      (forward-char (+ 88 (* (- (string-to-number round) 1) 10)))
-     (delete-char 10)
-     (insert "          "))))
+     (delete-char 8)
+     (insert "        "))))
 
 (defun arbitools-replace-empty ()
    "Replace non played games with spaces"
          (insert (format "%s " title))
          (insert (format "%s" name))
          (insert-char ?\s (- 34 (length name)))
-         (insert (format "%s " elo))
-         (when (= (length elo) 0) (insert "    ")) ;; add extra space if the elo is empty
-         (when (= (length elo) 1) (insert "   ")) ;; add extra space if the elo is a "0"
+         (when (= (length elo) 4) (insert (format "%s " elo)))
+         (when (= (length elo) 0) (insert "     ")) ;; add extra space if the elo is empty
+         (when (= (length elo) 1) (insert "   ")) ;; add extra space if the elo is a "0"
          (insert (format "%s" fed))
          (when (= (length fed) 0) (insert "   ")) ;; add extra space if fed is empty
          (insert-char ?\s (- 12 (length idfide)))