summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-29 02:43:55 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-29 02:43:55 -0400
commit3187bd1eadb312b6f6d6e1bb9218f19346300e7d (patch)
treeeb3667d49ec27fc7036d23bd23ed839191a261d7
parent7e5230b8ffe32cfe7c1ec31d37c40684893aa787 (diff)
Several changes to fix byte-compile warnings, changed some iso-8859-1 encoded
files to UTF-8, and switched to using insert-file-contents instead of the -literally variant (which doesn't respect content encodings).
-rw-r--r--chess-ai.el1
-rw-r--r--chess-display.el4
-rw-r--r--chess-epd.el2
-rw-r--r--chess-german.el26
-rw-r--r--chess-ics.el88
-rw-r--r--chess-images.el12
-rw-r--r--chess-network.el4
-rw-r--r--chess-pgn.el22
-rw-r--r--chess-scid.el16
9 files changed, 94 insertions, 81 deletions
diff --git a/chess-ai.el b/chess-ai.el
index 427b515..7f3fc5f 100644
--- a/chess-ai.el
+++ b/chess-ai.el
@@ -21,6 +21,7 @@
;;; Code:
+(require 'chess)
(require 'chess-common)
(require 'chess-pos)
(require 'chess-ply)
diff --git a/chess-display.el b/chess-display.el
index c5c8b33..d2d273d 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -7,6 +7,7 @@
(require 'chess-module)
(require 'chess-var)
(require 'chess-input)
+(require 'chess-random)
(defgroup chess-display nil
"Common code used by chess displays."
@@ -1085,6 +1086,9 @@ to the end or beginning."
(funcall chess-display-event-handler 'draw-square
(point) (or piece last-command-char) index))))
+(unless (fboundp 'event-window)
+ (defalias 'event-point 'ignore))
+
(defun chess-display-mouse-set-piece (event)
"Select the piece the user clicked on."
(interactive "e")
diff --git a/chess-epd.el b/chess-epd.el
index b4b4232..eeaed56 100644
--- a/chess-epd.el
+++ b/chess-epd.el
@@ -83,7 +83,7 @@ and advance point after the correctly parsed position."
"Return a list of positions contained in FILE."
(let ((positions (list t)) pos)
(with-temp-buffer
- (insert-file-literally file)
+ (insert-file-contents file)
(goto-char (point-min))
(while (setq pos (chess-epd-parse))
(nconc positions (list pos))))
diff --git a/chess-german.el b/chess-german.el
index c286cd3..7598bf9 100644
--- a/chess-german.el
+++ b/chess-german.el
@@ -7,8 +7,8 @@
(chess-message-catalog 'german
'((queen . "Dame")
- (king . "König")
- (bishop . "Läufer")
+ (king . "König")
+ (bishop . "Läufer")
(knight . "Springer")
(rook . "Turm")
(pawn . "Bauer")
@@ -19,14 +19,14 @@
(stalemate . "Patt")
(en-passant . "on possont")
(piece-moves . "%s nach %s")
- (piece-takes . "%s schlägt %s auf %s")
+ (piece-takes . "%s schlägt %s auf %s")
- (add-to-completed . "Kann keine Züge zu abgeschlossenem Spiel hinzufügen")
+ (add-to-completed . "Kann keine Züge zu abgeschlossenem Spiel hinzufügen")
(bad-game-read . "Beim lesen des Spiels ist ein Fehler an Position %d aufgetreten")
- (cannot-mount . "Es ist nicht Möglich eine Figur auf die andere zu stellen")
- (cannot-yet-add . "Kann noch keine Züge zu Spiel hinzufügen")
+ (cannot-mount . "Es ist nicht Möglich eine Figur auf die andere zu stellen")
+ (cannot-yet-add . "Kann noch keine Züge zu Spiel hinzufügen")
(challenge-whom . "Wehn willst du herausfordern? ")
- (chess-delete-autosave . "Soll die autosave Datei gelöscht werden? ")
+ (chess-delete-autosave . "Soll die autosave Datei gelöscht werden? ")
(chess-disable-autosave . "Disable autosaving for this game? ")
(chess-read-autosave . "Es existiert eine Schach autosave Datei, soll sie geladen werden? ")
(clarify-piece . "Clarify piece to move by rank or file")
@@ -39,7 +39,7 @@
(draw-offer-declined . "Dein Angebot zum Unentschieden wurde abgelehnt")
(editing-directly . "Now editing position directly, use S when complete...")
(end-of-puzzles . "Es gibt keine weiteren Puzzles in dieser Sammlung")
- (engine-not-running . "Die Engine die Du verwendet hast läuft nicht mehr")
+ (engine-not-running . "Die Engine die Du verwendet hast läuft nicht mehr")
(failed-start . "Failed to start chess engine process")
(game-is-over . "Dieses Spiel ist abgeschlossen")
(ics-connected . "Verbindungsaufbau mit Internet Chess Server '%s'...done")
@@ -47,8 +47,8 @@
(ics-server-prompt . "Verbindung zu Schach Server: ")
(illegal-move . "Illegalaler Zug")
(illegal-notation . "Illegale Zug notation: %s")
- (invalid-fen . "Ungültiger FEN string: %s")
- (invalid-pgn . "Ungültiger PGN text empfangen")
+ (invalid-fen . "Ungültiger FEN string: %s")
+ (invalid-pgn . "Ungültiger PGN text empfangen")
(irc-challenge . "IRC nick of user to challenge: ")
(irc-connecting . "Verbindungsaufbau mit IRC server '%s:%d'...")
(irc-logging-in . "Connected, now logging in as '%s'...")
@@ -62,7 +62,7 @@
(mode-resigned . "RESIGNED")
(mode-stalemate . "PATT")
(mode-start . "START")
- (mode-white . "Weiß")
+ (mode-white . "Weiß")
(move-from-blank . "Du versuchst eine Figur vom leeren Feld %s zu bewegen")
(move-not-legal . "Dies ist kein legaler Zug")
(move-passed . "Your opponent has passed the move to you")
@@ -90,7 +90,7 @@
(opp-ready . "%s ist nun bereits zu spielen")
(opp-ready-a . "Dein Anonymer Gegner ist nun bereit zu spielen")
(opp-resigned . "Dein Gegner hat aufgegeben")
- (opp-undo . "Dein Gegner will %d Züge zurück nehmen, akzeptierst Du? ")
+ (opp-undo . "Dein Gegner will %d Züge zurück nehmen, akzeptierst Du? ")
(opp-undo-acc . "Request to undo %d moves was accepted")
(opp-undo-dec . "Your request to undo %d moves was decline")
(opp-undo-ret . "Your opponent has retracted their request to undo %d moves")
@@ -102,7 +102,7 @@
(piece-images-loading . "Loading chess piece images...")
(piece-immobile . "That piece cannot move now")
(piece-unrecognized . "Unrecognized piece identifier")
- (queen-would-take . "Die Dame würde deinen Springer schlagen!")
+ (queen-would-take . "Die Dame würde deinen Springer schlagen!")
(redrawing-frame . "Redrawing chess display with different size...")
(redrawing-frame-done . "Redrawing chess display with different size...done")
(return-to-current . "Use '>' to return to the current position")
diff --git a/chess-ics.el b/chess-ics.el
index 1b244dc..efbc908 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -21,14 +21,17 @@
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
-(eval-when-compile (require 'cl))
+(eval-when-compile
+ (require 'cl))
(require 'comint)
(require 'chess)
(require 'chess-network)
(require 'chess-pos)
-(eval-when-compile (require 'rx))
+(eval-when-compile
+ (require 'rx)
+ (require 'sort))
(defgroup chess-ics nil
"Engine for interacting with Internet Chess Servers."
@@ -270,7 +273,7 @@ standard position). In those cases, this variable should be set to nil.")
(delete-region (1- (match-beginning 0)) (match-end 0))))
(when game-num
(chess-game-run-hooks
- (chess-ics-game (string-to-int game-num))
+ (chess-ics-game (string-to-number game-num))
'kibitz (buffer-substring text-begin (line-end-position))))
(when (> (- (line-end-position) (line-beginning-position))
fill-column)
@@ -284,7 +287,7 @@ standard position). In those cases, this variable should be set to nil.")
(cons "{Game \\([0-9]+\\) (\\(\\S-+\\) vs\\. \\(\\S-+\\)) Creating [^ ]+ \\([^ ]+\\).*}"
(function
(lambda ()
- (let ((game-number (string-to-int (match-string 1)))
+ (let ((game-number (string-to-number (match-string 1)))
(white (match-string-no-properties 2))
(black (match-string-no-properties 3)))
(message "Creating game %d (%s vs. %s)" game-number white black)
@@ -293,17 +296,17 @@ standard position). In those cases, this variable should be set to nil.")
(cons "^Game \\([0-9]+\\): \\S-+ backs up \\([0-9]+\\).$"
(function
(lambda ()
- (chess-game-undo (chess-ics-game (string-to-int (match-string 1)))
- (string-to-int (match-string 2))))))
+ (chess-game-undo (chess-ics-game (string-to-number (match-string 1)))
+ (string-to-number (match-string 2))))))
(cons chess-ics-style12-regexp #'chess-ics-handle-style12)
(cons "Removing game \\([0-9]+\\) from observation list.$"
(function
(lambda ()
- (chess-ics-game-destroy (string-to-int (match-string 1))))))
+ (chess-ics-game-destroy (string-to-number (match-string 1))))))
(cons "You are no longer examining game \\([0-9]+\\).$"
(function
(lambda ()
- (chess-ics-game-destroy (string-to-int (match-string 1))))))
+ (chess-ics-game-destroy (string-to-number (match-string 1))))))
(cons "^Movelist for game \\([0-9]+\\):$"
(function
(lambda ()
@@ -311,7 +314,7 @@ standard position). In those cases, this variable should be set to nil.")
chess-ics-movelist-game)
(message "[movelist] left-over movelist-game[-number]")
(setq chess-ics-movelist-game-number
- (string-to-int (match-string 1)))))))
+ (string-to-number (match-string 1)))))))
(cons "^Move\\s-+\\*?\\(\\S-+\\)\\s-+\\*?\\(\\S-+\\)\\s-*$"
(function
(lambda ()
@@ -344,7 +347,7 @@ standard position). In those cases, this variable should be set to nil.")
(function
(lambda ()
(funcall chess-engine-response-handler 'undo
- (string-to-int (match-string 1))))))
+ (string-to-number (match-string 1))))))
(cons "The game has been aborted on move [^.]+\\."
(function
(lambda ()
@@ -360,7 +363,7 @@ standard position). In those cases, this variable should be set to nil.")
(lambda ()
(let ((chess-engine-handling-event t)
(opponent-p (not (string= chess-ics-handle (match-string 4))))
- (game (chess-ics-game (string-to-int (match-string 1))
+ (game (chess-ics-game (string-to-number (match-string 1))
:White (match-string 2)
:Black (match-string 3))))
(with-current-buffer (chess-game-data game 'engine)
@@ -482,7 +485,7 @@ See `chess-ics-game'.")
(defun chess-ics-handle-movelist-item ()
;; TBD: time taken per ply
(let ((chess-engine-handling-event t)
- (seq (string-to-int (match-string 1)))
+ (seq (string-to-number (match-string 1)))
(wmove (match-string 2))
(bmove (match-string 14))
(game chess-ics-movelist-game))
@@ -518,7 +521,7 @@ See `chess-ics-game'.")
(chess-pos-set-piece
pos (chess-rf-to-index r f) (aref rank f))))))
(chess-pos-set-side-to-move pos (string= (match-string 9) "W"))
- (let ((file (string-to-int (match-string 10))))
+ (let ((file (string-to-number (match-string 10))))
(when (>= file 0)
(chess-pos-set-en-passant
pos (chess-rf-to-index
@@ -528,7 +531,7 @@ See `chess-ics-game'.")
(chess-pos-set-can-castle pos (car info) t)))
'((?K . 11) (?Q . 12) (?k . 13) (?q . 14))) pos))
(game (save-match-data
- (chess-ics-game (string-to-int (match-string 16))
+ (chess-ics-game (string-to-number (match-string 16))
:White (match-string 17)
:Black (match-string 18))))
(status
@@ -540,21 +543,21 @@ See `chess-ics-game'.")
;; -1 I am playing, it is my opponent's move
;; 1 I am playing and it is my move
;; 0 I am observing a game being played
- (string-to-int (match-string 19))))
+ (string-to-number (match-string 19))))
(when (or (= status 2) (= status -2) (= status 0))
(chess-game-set-data game 'my-color (chess-pos-side-to-move position)))
;; initial time and increment (in seconds) of the match
(chess-game-set-tag
game "TimeControl" (format "%s/%s" (match-string 20) (match-string 21)))
;; material values for each side
- (let ((centipawn (* 100 (- (string-to-int (match-string 22))
- (string-to-int (match-string 23))))))
+ (let ((centipawn (* 100 (- (string-to-number (match-string 22))
+ (string-to-number (match-string 23))))))
(chess-pos-set-epd position 'ce (if (chess-pos-side-to-move position)
centipawn (- centipawn))))
;; White's and Black's remaining time
- (chess-game-set-data game 'white-remaining (string-to-int (match-string 24)))
- (chess-game-set-data game 'black-remaining (string-to-int (match-string 25)))
- (let ((index (- (* (string-to-int (match-string 26)) 2)
+ (chess-game-set-data game 'white-remaining (string-to-number (match-string 24)))
+ (chess-game-set-data game 'black-remaining (string-to-number (match-string 25)))
+ (let ((index (- (* (string-to-number (match-string 26)) 2)
(if (eq (chess-game-data game 'black-moved-first) t)
(if (chess-pos-side-to-move position) 3 2)
(if (chess-pos-side-to-move position) 2 1))))
@@ -809,11 +812,11 @@ descending order.")
(post (substring string (match-end 0))))
(chess-ics-sought-add (substring (match-string 9 string) 5)
(match-string 1 string)
- (string-to-int (match-string 2 string))
+ (string-to-number (match-string 2 string))
(if (string= (match-string 6 string) "rated")
"yes" "no")
- (string-to-int (match-string 4 string))
- (string-to-int (match-string 5 string))
+ (string-to-number (match-string 4 string))
+ (string-to-number (match-string 5 string))
(concat
(if (match-string 3 string)
(concat (match-string 3 string) " ") "")
@@ -849,6 +852,8 @@ This function should be put on `comint-preoutput-filter-functions'."
(goto-char here)))))))
string)
+(make-variable-buffer-local 'comint-preoutput-filter-functions)
+
;;;###autoload
(defun chess-ics (server port &optional handle password-or-filename
helper &rest helper-args)
@@ -888,7 +893,6 @@ This function should be put on `comint-preoutput-filter-functions'."
comint-prompt-regexp "^[^%\n]*% *"
comint-scroll-show-maximum-output t)
(add-hook 'comint-output-filter-functions 'chess-engine-filter t t)
- (make-variable-buffer-local 'comint-preoutput-filter-functions)
(setq comint-preoutput-filter-functions
'(chess-ics-ads-removed chess-ics-seeking))
(let ((ntimes 50))
@@ -902,24 +906,24 @@ This function should be put on `comint-preoutput-filter-functions'."
(if (not (string-match "^\\([0-9]+\\) \\(.*\\)$" string))
(format "\nUnknown datagram format: %s\n" string)
(let ((chess-engine-handling-event t)
- (dg (string-to-int (match-string 1 string)))
+ (dg (string-to-number (match-string 1 string)))
(args (match-string 2 string)))
(cond
((and (or (= dg 22) (= dg 23))
(string-match "\\([0-9]+\\) \\([1-9][0-9]*\\)" args))
- (chess-game-undo (chess-ics-game (string-to-int (match-string 1 args)))
- (string-to-int (match-string 2 args)))
+ (chess-game-undo (chess-ics-game (string-to-number (match-string 1 args)))
+ (string-to-number (match-string 2 args)))
"")
((and (or (= dg 101) (= dg 110))
(string-match "\\([0-9]+\\) {\\(.+\\) \\(?:[0-9]+\\) \\(?:[0-9]+\\)} \\([0-9]+\\)" args))
(let ((pos (chess-fen-to-pos (match-string 2 args))))
(chess-game-set-start-position
- (chess-ics-game (string-to-int (match-string 1 args))) pos))
+ (chess-ics-game (string-to-number (match-string 1 args))) pos))
"")
((and (or (= dg 24) (= dg 111))
(string-match "^\\([0-9]+\\) \\(.+\\)$" args))
(let* ((move (match-string 2 args))
- (game (chess-ics-game (string-to-int (match-string 1 args))))
+ (game (chess-ics-game (string-to-number (match-string 1 args))))
(pos (chess-game-pos game))
(ply (chess-algebraic-to-ply pos move)))
(chess-game-move game ply)
@@ -942,10 +946,10 @@ This function should be put on `comint-preoutput-filter-functions'."
((and (= dg 56)
(string-match "^\\([0-9]+\\) \\([WB]\\) \\([0-9]+\\) \\([01]\\)"
args))
- (let ((sec (/ (string-to-int (match-string 3 args)) 1000))
+ (let ((sec (/ (string-to-number (match-string 3 args)) 1000))
(color (if (string= (match-string 2 args) "W")
'white-remaining 'black-remaining))
- (game (chess-ics-game (string-to-int (match-string 1 args)))))
+ (game (chess-ics-game (string-to-number (match-string 1 args)))))
(chess-game-set-data game color sec))
"")
((and (= dg 50)
@@ -956,10 +960,10 @@ This function should be put on `comint-preoutput-filter-functions'."
(if (not (string= (match-string 3 args) ""))
(format "(%s)" (match-string 3 args))
""))
- (string-to-int (match-string 4 args))
+ (string-to-number (match-string 4 args))
(if (string= (match-string 10 args) "1") "yes" "no")
- (string-to-int (match-string 8 args))
- (string-to-int (match-string 9 args))
+ (string-to-number (match-string 8 args))
+ (string-to-number (match-string 9 args))
(concat (match-string 7 args)
(if (not (string= (match-string 6 args) "0"))
(concat " " (match-string 6 args)) "")
@@ -1011,7 +1015,7 @@ This function should be put on `comint-preoutput-filter-functions'."
(defun chess-ics-icc-preoutput-filter (string)
(while (string-match "(\\([0-9]+\\) \\(.*?\\))" string)
- (let ((dg (string-to-int (match-string 1 string)))
+ (let ((dg (string-to-number (match-string 1 string)))
(args (match-string 2 string))
(pre (substring string 0 (match-beginning 0)))
(post (substring string (match-end 0))))
@@ -1020,13 +1024,13 @@ This function should be put on `comint-preoutput-filter-functions'."
(string-match "\\([0-9]+\\) {\\(.+\\) \\(?:[0-9]+\\) \\(?:[0-9]+\\)} \\([0-9]+\\)" args))
(let ((pos (chess-fen-to-pos (match-string 2 args))))
(chess-game-set-start-position
- (chess-ics-game (string-to-int (match-string 1 args))) pos))
+ (chess-ics-game (string-to-number (match-string 1 args))) pos))
(setq string (concat pre post)))
((and (or (= dg 24) (= dg 111))
(string-match "\\([0-9]+\\) \\(.+\\)$" args))
(let* ((chess-engine-handling-event t)
(move (match-string 2 args))
- (game (chess-ics-game (string-to-int (match-string 1 args))))
+ (game (chess-ics-game (string-to-number (match-string 1 args))))
(pos (chess-game-pos game))
(ply (chess-algebraic-to-ply pos move)))
(if ply
@@ -1053,10 +1057,10 @@ This function should be put on `comint-preoutput-filter-functions'."
((and (= dg 56)
(string-match "\\([0-9]+\\) \\([WB]\\) \\([0-9]+\\) \\([01]\\)"
args))
- (let ((sec (/ (string-to-int (match-string 3 args)) 1000))
+ (let ((sec (/ (string-to-number (match-string 3 args)) 1000))
(color (if (string= (match-string 2 args) "W")
'white-remaining 'black-remaining))
- (game (chess-ics-game (string-to-int (match-string 1 args)))))
+ (game (chess-ics-game (string-to-number (match-string 1 args)))))
(chess-game-set-data game color sec))
(setq string (concat pre post)))
((and (= dg 50)
@@ -1067,11 +1071,11 @@ This function should be put on `comint-preoutput-filter-functions'."
(if (not (string= (match-string 3 args) ""))
(format "(%s)" (match-string 3 args))
""))
- (string-to-int (match-string 4 args))
+ (string-to-number (match-string 4 args))
(if (string= (match-string 10 args) "1")
"yes" "no")
- (string-to-int (match-string 8 args))
- (string-to-int (match-string 9 args))
+ (string-to-number (match-string 8 args))
+ (string-to-number (match-string 9 args))
(concat (match-string 7 args)
(if (not (string= (match-string 6 args) "0"))
(concat " " (match-string 6 args)) "")
diff --git a/chess-images.el b/chess-images.el
index 45259a3..cce9efb 100644
--- a/chess-images.el
+++ b/chess-images.el
@@ -364,13 +364,13 @@ They are returned in ascending order, or nil for no sizes available."
(with-temp-buffer
(insert-file-contents-literally file)
(re-search-forward "\"\\([0-9]+\\)")
- (setq chess-images-sizes (list (string-to-int (match-string 1)))))
+ (setq chess-images-sizes (list (string-to-number (match-string 1)))))
(let (sizes)
(dolist (file (directory-files chess-images-directory nil
(format "rdd[0-9]+\\.%s"
chess-images-extension)))
(if (string-match "rdd\\([0-9]+\\)\\." file)
- (push (string-to-int (match-string 1 file)) sizes)))
+ (push (string-to-number (match-string 1 file)) sizes)))
(setq chess-images-sizes (sort sizes '<))))))
(defun chess-images-best-size (&optional height width)
@@ -425,10 +425,10 @@ This is necessary for bizzare Emacs reasons."
(goto-char (point-min))
(if (re-search-forward (concat "\"\\([0-9]+\\)\\s-+\\([0-9]+\\)\\s-+"
"\\([0-9]+\\)\\s-+\\([0-9]+\\)\"") nil t)
- (let* ((width (string-to-int (match-string 1)))
- (height (string-to-int (match-string 2)))
- (colors (string-to-int (match-string 3)))
- (chars-per-color (string-to-int (match-string 4)))
+ (let* ((width (string-to-number (match-string 1)))
+ (height (string-to-number (match-string 2)))
+ (colors (string-to-number (match-string 3)))
+ (chars-per-color (string-to-number (match-string 4)))
(color-char (make-string chars-per-color ?~)))
(replace-match (int-to-string (+ height add-height)) t t nil 2)
(unless
diff --git a/chess-network.el b/chess-network.el
index ea181fc..efc9d28 100644
--- a/chess-network.el
+++ b/chess-network.el
@@ -52,7 +52,7 @@
(function
(lambda ()
(funcall chess-engine-response-handler 'undo
- (string-to-int (match-string 1))))))
+ (string-to-number (match-string 1))))))
(cons "accept\\(\\s-+\\(.+\\)\\)?$"
(function
(lambda ()
@@ -120,7 +120,7 @@
(if (fboundp 'open-network-stream-server)
(open-network-stream-server "*chess-network*"
(current-buffer)
- (string-to-int
+ (string-to-number
(read-string "Port: ")))
(start-process "*chess-network*"
(current-buffer) "/usr/bin/nc"
diff --git a/chess-pgn.el b/chess-pgn.el
index 370d1ae..ab42511 100644
--- a/chess-pgn.el
+++ b/chess-pgn.el
@@ -7,6 +7,9 @@
(require 'chess-fen)
(require 'chess-message)
+(eval-when-compile
+ (require 'pcomplete nil t))
+
(defvar chess-pgn-fill-column 60)
(chess-message-catalog 'english
@@ -224,11 +227,15 @@ PGN text."
game)
(chess-error 'could-not-read-pgn))))
+(eval-after-load "pcomplete"
+ '(progn
+ (make-variable-buffer-local 'pcomplete-default-completion-function)
+ (make-variable-buffer-local 'pcomplete-command-completion-function)
+ (make-variable-buffer-local 'pcomplete-parse-arguments-function)))
+
;;;###autoload
(define-derived-mode chess-pgn-mode text-mode "PGN"
"A mode for editing chess PGN files."
- (make-variable-buffer-local 'comment-start)
- (make-variable-buffer-local 'comment-end)
(setq comment-start "{"
comment-end "}")
@@ -248,12 +255,9 @@ PGN text."
;;(define-key map [? ] 'chess-pgn-move)
(when (require 'pcomplete nil t)
- (set (make-variable-buffer-local 'pcomplete-default-completion-function)
- 'chess-pgn-completions)
- (set (make-variable-buffer-local 'pcomplete-command-completion-function)
- 'chess-pgn-completions)
- (set (make-variable-buffer-local 'pcomplete-parse-arguments-function)
- 'chess-pgn-current-word)
+ (setq pcomplete-default-completion-function 'chess-pgn-completions)
+ (setq pcomplete-command-completion-function 'chess-pgn-completions)
+ (setq pcomplete-parse-arguments-function 'chess-pgn-current-word)
(define-key map [tab] 'chess-pgn-complete-move))))
;;;###autoload
@@ -314,7 +318,7 @@ PGN text."
(save-excursion
(when location (goto-char location))
(if (re-search-backward chess-pgn-move-regexp nil t)
- (let* ((index (string-to-int (match-string 2)))
+ (let* ((index (string-to-number (match-string 2)))
(first-move (match-string 3))
(second-move (match-string 14))
(ply (1+ (* 2 (1- index)))))
diff --git a/chess-scid.el b/chess-scid.el
index dfb3a39..f25dfd3 100644
--- a/chess-scid.el
+++ b/chess-scid.el
@@ -33,7 +33,7 @@
(with-current-buffer buffer
(accept-process-output proc)
(setq chess-scid-process proc)
- (if (= 1 (string-to-int
+ (if (= 1 (string-to-number
(chess-scid-get-result
(format "sc_base open %s"
(expand-file-name (car args))))))
@@ -50,7 +50,7 @@
(sit-for 0 250)))
((eq event 'read-only-p)
- (if (zerop (string-to-int (chess-scid-get-result "sc_base isReadOnly")))
+ (if (zerop (string-to-number (chess-scid-get-result "sc_base isReadOnly")))
nil
t))
@@ -58,7 +58,7 @@
(chess-scid-get-result "sc_base filename"))
((eq event 'count)
- (string-to-int (chess-scid-get-result "sc_base numGames")))
+ (string-to-number (chess-scid-get-result "sc_base numGames")))
((eq event 'read)
(let ((here (point-max)) game)
@@ -98,11 +98,11 @@
"\\([0-9.]+\\)%")
nil t)
(let ((move (match-string 2))
- (freq (string-to-int (match-string 3)))
+ (freq (string-to-number (match-string 3)))
(score (string-to-number (match-string 5)))
- (avgelo (string-to-int (match-string 6)))
- (perf (string-to-int (match-string 7)))
- (avgyear (string-to-int (match-string 8)))
+ (avgelo (string-to-number (match-string 6)))
+ (perf (string-to-number (match-string 7)))
+ (avgyear (string-to-number (match-string 8)))
(draws (string-to-number (match-string 9))))
(nconc lines
(list
@@ -125,7 +125,7 @@
"\\([0-9.]+\\)%") nil t)
(goto-char (point-max))
(append
- (list (string-to-int (match-string 1))
+ (list (string-to-number (match-string 1))
(string-to-number (match-string 2))
(string-to-number (match-string 6)))
(cdr lines)))))