summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog53
-rw-r--r--chess-display.el14
-rw-r--r--chess-ics.el72
3 files changed, 82 insertions, 57 deletions
diff --git a/ChangeLog b/ChangeLog
index a75c9d9..95a6214 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,56 @@
+2002-04-16 John Wiegley <johnw@gnu.org>
+
+ * chess-ics.el: Send the "set style 12" command immediately,
+ rather than after the first move.
+
+ * all: Removed the $ Revision strings; they are no longer
+ necessary since I tag every revision that I upload.
+
+2002-04-16 Mario Lang <mlang@aris>
+
+ * chess-ics.el: set en-passent status
+
+ * chess-announce.el: german messages (no idea on how to synth yet
+ :) )
+
+ * chess-ics.el: CR stripping removed/commented.
+
+ * chess-engine.el: Only set process-filter if it isn't already set
+ to comint-output-filter
+
+2002-04-16 John Wiegley <johnw@gnu.org>
+
+ * chess-var.el, TODO, chess-algebraic.el, chess-display.el,
+ chess-game.el, chess-pgn.el, chess-ply.el, chess-pos.el: Major
+ speed improvement and efficiency work. chess-legal-plies is much
+ more memory conservative now. Reduced recursion in
+ chess-search-position by a slight bit.
+
+ * chess.el: bumped minor rev
+
+ * chess-display.el: Compute the mode-line text only once, whenever
+ the current game index is changed. This saves hundreds of calls
+ to chess-ply-to-algebraic, which were occurring simply because of
+ mode-line updates!
+
+ * chess-algebraic.el: Keep the :which determiner, if ever we
+ calculate it in chess-ply-to-algebraic.
+
+ * ChangeLog, PLAN: new file
+
+ * chess-plain.el: whitespace fix
+
+ * chess-display.el, chess-engine.el: Removed
+ `chess-with-current-buffer', since it is now in chess-module.el.
+
+2002-04-15 Mario Lang <mlang@aris>
+
+ * chess-plain.el: Added var chess-plain-spacing (default 0) to be
+ able to widen the board. (I am sure that broke highlighting)
+
+ * chess-ics.el: Added comments to chess-parse-ics12 to describe
+ the format
+
2002-04-15 John Wiegley <johnw@gnu.org>
* Did some major performance work on chess-legal-plies,
diff --git a/chess-display.el b/chess-display.el
index d19a434..eea0370 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -2,7 +2,6 @@
;;
;; Code shared by all chess displays
;;
-;; $Revision$
(require 'chess-module)
(require 'chess-var)
@@ -210,6 +209,13 @@ also view the same game."
(chess-module-leader-p nil))
(chess-display-popup nil))))
+(defun chess-display-redraw (&optional display)
+ "Just redraw the current display."
+ (interactive)
+ (chess-with-current-buffer display
+ (erase-buffer)
+ (chess-display-update nil)))
+
(defun chess-display-move (display ply)
"Move a piece on DISPLAY, by applying the given PLY.
The position of PLY must match the currently displayed position.
@@ -414,12 +420,6 @@ The key bindings available in this mode are:
;; Commands used by the keyboard bindings above
;;
-(defun chess-display-redraw ()
- "Just redraw the current display."
- (interactive)
- (erase-buffer)
- (chess-display-update nil))
-
(defsubst chess-display-active-p ()
"Return non-nil if the displayed chessboard reflects an active game.
Basically, it means we are playing, not editing or reviewing."
diff --git a/chess-ics.el b/chess-ics.el
index d961a58..4b8ee43 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -64,11 +64,14 @@ who is black."
(chess-pos-set-side-to-move position (string= (car parts) "W"))
(setq parts (cdr parts))
- ;; -1 if the previous move was NOT a double pawn push, otherwise the chess
- ;; board file (numbered 0--7 for a--h) in which the double push was made
+ ;; -1 if the previous move was NOT a double pawn push, otherwise
+ ;; the chess board file (numbered 0--7 for a--h) in which the
+ ;; double push was made
(let ((index (string-to-number (car parts))))
(when (> index 0)
- (chess-pos-set-en-passant position index)))
+ (chess-pos-set-en-passant
+ position (chess-rf-to-index (if (string= (car parts) "W") 4 3)
+ index))))
(setq parts (cdr parts))
;; can White still castle short? (0=no, 1=yes)
@@ -90,9 +93,9 @@ who is black."
;; jww (2002-04-11): How is check indicated?
- ;; the number of moves made since the last irreversible move. (0 if last
- ;; move was irreversible. If the value is >= 100, the game can be
- ;; declared a draw due to the 50 move rule.)
+ ;; the number of moves made since the last irreversible move. (0
+ ;; if last move was irreversible. If the value is >= 100, the
+ ;; game can be declared a draw due to the 50 move rule.)
(setq parts (cdr parts))
;; The game number
@@ -104,13 +107,14 @@ who is black."
(setq black (car parts))
(setq parts (cdr parts))
- ;; my relation to this game:
- ;; -3 isolated position, such as for "ref 3" or the "sposition" command
+ ;; my relation to this game:
+ ;; -3 isolated position, such as for "ref 3" or the "sposition"
+ ;; command
;; -2 I am observing game being examined
- ;; 2 I am the examiner of this game
+ ;; 2 I am the examiner of this 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
+ ;; 1 I am playing and it is my move
+ ;; 0 I am observing a game being played
(setq parts (cdr parts))
;; initial time (in seconds) of the match
@@ -129,8 +133,8 @@ who is black."
;; Black's remaining time
(setq parts (cdr parts))
- ;; the number of the move about to be made (standard chess numbering --
- ;; White's and Black's first moves are both 1, etc.)
+ ;; the number of the move about to be made (standard chess
+ ;; numbering -- White's and Black's first moves are both 1, etc.)
(setq parts (cdr parts))
;; move in elaborated notation
@@ -144,8 +148,8 @@ who is black."
(car parts)))
(setq parts (cdr parts))
- ;; flip field for board orientation: 1 = Black at bottom, 0 = White at
- ;; bottom.
+ ;; flip field for board orientation: 1 = Black at bottom, 0 =
+ ;; White at bottom.
(setq parts (cdr parts))
(setq parts (cdr parts))
@@ -213,37 +217,12 @@ who is black."
(if (nth 3 server)
(cons (nth 4 server) (nth 5 server))
(list (cons (nth 0 server) (nth 1 server)))))))
-
+
(chess-message 'ics-connected (car server))
-;; This doesn't seem necessary. Leaving it here in case windows
-;; behaves differently.
-;; (let* ((proc (get-buffer-process buf))
-;; (coding-systems (process-coding-system proc))
-;; (encoding (cdr coding-systems))
-;; (decoding (car coding-systems))
-;; changed)
-;; ;; If open-network-stream decided to use some coding system
-;; ;; for decoding data sent from the process and the coding system
-;; ;; doesn't specify EOL conversion, we had better convert CRLF to
-;; ;; LF.
-;; (if (vectorp (coding-system-eol-type decoding))
-;; (setq decoding (coding-system-change-eol-conversion decoding 'dos)
-;; changed t))
-;; ;; Even if open-network-stream left the coding system for encoding
-;; ;; data sent from the process undecided, we had better use the
-;; ;; same one as what we use for decoding. But, we should suppress
-;; ;; EOL conversion.
-;; (if (and decoding (not encoding))
-;; (setq encoding (coding-system-change-eol-conversion decoding 'unix)
-;; changed t))
-;; (if changed
-;; (set-process-coding-system proc decoding encoding)))
(display-buffer buf)
(set-buffer buf)
-; (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m nil t)
-
(add-hook 'comint-output-filter-functions 'chess-ics-filter t t)
(if (nth 2 server)
@@ -289,8 +268,8 @@ who is black."
(defun chess-ics-filter (string)
(save-excursion
(if chess-engine-last-pos
- ;; ml: Can't we just use comint-last-output-start and process-mark here?
- ;; instead of chess-engine-last-pos?
+ ;; ml: Can't we just use comint-last-output-start and
+ ;; process-mark here? instead of chess-engine-last-pos?
(goto-char chess-engine-last-pos)
(goto-char (point-min)))
(unwind-protect
@@ -307,13 +286,6 @@ who is black."
(forward-line))
(setq chess-engine-last-pos (point)))))
-(defun chess-ics-strip (string)
- ;; remove this? CRLF should be done by coding-system or comint-strip-ctrl-m.
- ;; Bell can be turned off by set bell 0 on login.
- (while (string-match "[\r\a]" string)
- (setq string (replace-match "" t t string)))
- string)
-
(provide 'chess-ics)
;;; chess-ics.el ends here