emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/arbitools eb1011a 07/29: * packages/arbitools: added so


From: Stefan Monnier
Subject: [elpa] externals/arbitools eb1011a 07/29: * packages/arbitools: added some new functions and menus
Date: Sun, 29 Nov 2020 19:00:34 -0500 (EST)

branch: externals/arbitools
commit eb1011a0f27188e1f7fae183df7ab92bef1fb0de
Author: David Gonzalez Gandara <dggandara@member.fsf.org>
Commit: David Gonzalez Gandara <dggandara@member.fsf.org>

    * packages/arbitools: added some new functions and menus
---
 arbitools.el | 45 +++++++++++++++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 14 deletions(-)

diff --git a/arbitools.el b/arbitools.el
index 1377f6d..8c3041c 100644
--- a/arbitools.el
+++ b/arbitools.el
@@ -46,32 +46,48 @@
 
 ;;; Code:
 
-(defun arbitools-update (list)
+(defun arbitools-update (elolist)
   "Update the players ratings."
-  (interactive "slist:")
+  (interactive "selolist:")
   ;; FIXME: What if `list' is "foo; bar"?
-  ;; FIXME: Do we really need a shell here?
-  ;; Why not use just call-process, so we don't need to worry about quoting?
-  (shell-command (concat "arbitools-update.py -l " list  " -i "
-                         (shell-quote-argument buffer-file-name))))
+  (call-process "arbitools-run.py" nil nil nil "update" buffer-file-name "-l" 
elolist))
 
 (defun arbitools-add (addfile)
   "Add players to an existing file."
   (interactive "faddfile: ")
   ;; FIXME: What if `addlist' is "foo; bar"?
-  ;; FIXME: Do we really need a shell here?
-  ;; Why not use just call-process, so we don't need to worry about quoting?
-  (shell-command (concat "arbitools-add.py -a " addfile " -i "
-                         (shell-quote-argument buffer-file-name))))
+  (call-process "arbitools-add.py" nil nil nil "-a" addfile "-i" 
buffer-file-name))
 
 (defun arbitools-standings ()
   "Get standings and report files from a tournament file."
   (interactive)
   ;; (shell-command (concat (expand-file-name "arbitools-standings.py") " -i " 
buffer-file-name))) ;this is to use the actual path
-  ;; FIXME: Do we really need a shell here?
-  ;; Why not use just call-process, so we don't need to worry about quoting?
-  (shell-command (concat "arbitools-standings.py -i "
-                         (shell-quote-argument buffer-file-name))))
+  (call-process "arbitools-standings.py" nil nil nil "-i" buffer-file-name))
+
+(defun arbitools-it3 ()
+   "Get the IT3 tournament report."
+   (interactive)
+   (call-process "arbitools-run.py" nil nil nil "it3" buffer-file-name))
+
+(defun arbitools-fedarating ()
+   "Get the FEDA rating admin file."
+   (interactive)
+   (shell-command (concat "arbitools-run.py fedarating" buffer-file-name))
+
+(defvar arbitools-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "C-c i") 'coffee-compile-buffer)
+    map)
+  "Keymap for Arbitools major mode.")
+
+
+(easy-menu-define arbitools-mode-menu arbitools-mode-map
+  "Menu for Arbitools mode"
+  '("Arbitools"
+    ["Get It3" arbitools-it3]
+    "---"
+    ))
+
 
 (defvar arbitools-highlights
  '(("^001" . font-lock-function-name-face) ; name of the tournament
@@ -139,6 +155,7 @@
   "Arbitools"
   "Major mode for Chess Tournament Management."
   ;(setq font-lock-defaults '(arbitools-highlights))
+  (use-local-map arbitools-mode-map)
   (set (make-local-variable 'font-lock-defaults) '(arbitools-highlights)))
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]