summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
200bc5f)
* arbitools/arbitools.el (arbitools-update, arbitools-add)
(arbitools-standings): Fix obvious quoting problems. Add docstring.
(arbitools-mode): Use a more conventional mode-name.
;; USAGE:
;; ---------------------------
;; arbitools.el is an interface for the pythong package "arbitools",
;; USAGE:
;; ---------------------------
;; arbitools.el is an interface for the pythong package "arbitools",
-;; designed to manage chess tournament reports. If you don't install the
+;; designed to manage chess tournament reports. If you don't install the
;; python package you can still have the syntax colouring.
;;
;; FEATURES:
;; ----------------------------
;; python package you can still have the syntax colouring.
;;
;; FEATURES:
;; ----------------------------
-;; - Syntax colouring for the official trf FIDE files. This facilitates
+;; - Syntax colouring for the official trf FIDE files. This facilitates
;; manual edition of the files.
;;
;; manual edition of the files.
;;
-;; - Updating the players ratings. By means of the function arbitools-update
+;; - Updating the players ratings. By means of the function arbitools-update
-;; - Adding players to an existing file. By arbitools-add
+;; - Adding players to an existing file. By arbitools-add
-;; - Getting standings and report files from a tournament file. By
+;; - Getting standings and report files from a tournament file. By
;; arbitools-standings.
;;
;; You will find more information in www.ourenxadrez.org/arbitools.htm
;; arbitools-standings.
;;
;; You will find more information in www.ourenxadrez.org/arbitools.htm
;;; Code:
(defun arbitools-update (list)
;;; Code:
(defun arbitools-update (list)
+ "Update the players ratings."
- (shell-command (concat "arbitools-update.py" " -l " list " -i " buffer-file-name)))
+ ;; 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))))
(defun arbitools-add (addfile)
(defun arbitools-add (addfile)
+ "Add players to an existing file."
+ ;; FIXME: is `addfile' a file? If o, then use "f" rather than "s", else
+ ;; better give it another name!
(interactive "saddfile: ")
(interactive "saddfile: ")
- (shell-command (concat "arbitools-add.py" " -a " addfile " -i " buffer-file-name)))
+ ;; 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))))
(defun arbitools-standings ()
(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
(interactive)
;; (shell-command (concat (expand-file-name "arbitools-standings.py") " -i " buffer-file-name))) ;this is to use the actual path
- (shell-command (concat "arbitools-standings.py" " -i " buffer-file-name)))
+ ;; 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))))
(defvar arbitools-highlights
'(("^001" . font-lock-function-name-face) ;name of the tournament
(defvar arbitools-highlights
'(("^001" . font-lock-function-name-face) ;name of the tournament
;;;###autoload
(define-derived-mode arbitools-mode
fundamental-mode
;;;###autoload
(define-derived-mode arbitools-mode
fundamental-mode
- "arbitools-mode"
- "Major mode for Chess Tournament Management"
+ "Arbitools"
+ "Major mode for Chess Tournament Management."
;(setq font-lock-defaults '(arbitools-highlights))
(set (make-local-variable 'font-lock-defaults) '(arbitools-highlights)))
;(setq font-lock-defaults '(arbitools-highlights))
(set (make-local-variable 'font-lock-defaults) '(arbitools-highlights)))
-;;; arbitools.el end here
+;;; arbitools.el ends here