summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-14 21:57:09 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-14 21:57:09 +0000
commit5a0a6d1cda9134420ea5e0d08919637c0b6774e1 (patch)
tree4924bba9f0b529d465c10bab47c260cad6537720
parentaf2d89aa2d0cc832b4659ee8e5344e69fd4c45e9 (diff)
*** no comment ***
-rw-r--r--chess-display.el8
-rw-r--r--chess-engine.el8
-rw-r--r--chess-pgn.el7
3 files changed, 17 insertions, 6 deletions
diff --git a/chess-display.el b/chess-display.el
index 4f1d004..229a75a 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -74,20 +74,22 @@ cause the underlying game object to be shutdown when it is destroyed.
If READ-ONLY is non-nil, then the display will not allow the user to
makes moves, or any other changes to the underlying game."
(let* ((name (symbol-name style))
- (handler (intern-soft (concat name "-handler"))))
+ (handler (intern-soft (concat name "-handler")))
+ buffer)
(unless handler
(chess-error 'no-such-style name))
(with-current-buffer (generate-new-buffer "*Chessboard*")
+ (setq buffer (current-buffer))
(chess-display-mode read-only)
(when (funcall handler 'initialize)
+ (add-hook 'kill-buffer-hook 'chess-display-quit nil t)
(setq chess-display-style style
chess-display-perspective perspective
chess-display-event-handler handler)
(if main
(chess-display-set-main nil))
(chess-display-set-game* nil game)
- (add-hook 'kill-buffer-hook 'chess-display-quit nil t)
- (current-buffer)))))
+ buffer))))
(defun chess-display-clone (display style perspective)
(let ((new-display (chess-display-create chess-display-game
diff --git a/chess-engine.el b/chess-engine.el
index d23778d..be48270 100644
--- a/chess-engine.el
+++ b/chess-engine.el
@@ -261,10 +261,13 @@
&rest handler-ctor-args)
(let ((regexp-alist (intern-soft (concat (symbol-name module)
"-regexp-alist")))
- (handler (intern-soft (concat (symbol-name module) "-handler"))))
+ (handler (intern-soft (concat (symbol-name module) "-handler")))
+ buffer)
(with-current-buffer (generate-new-buffer " *chess-engine*")
+ (setq buffer (current-buffer))
(let ((proc (apply handler 'initialize handler-ctor-args)))
(when proc ;must be a process or t
+ (add-hook 'kill-buffer-hook 'chess-engine-on-kill nil t)
(setq chess-engine-regexp-alist (symbol-value regexp-alist)
chess-engine-event-handler handler
chess-engine-response-handler
@@ -277,8 +280,7 @@
(set-process-buffer proc (current-buffer))
(set-process-filter proc 'chess-engine-filter))
(setq chess-engine-current-marker (point-marker))
- (add-hook 'kill-buffer-hook 'chess-engine-on-kill nil t)
- (current-buffer))))))
+ buffer)))))
(defun chess-engine-on-kill ()
"Function called when the buffer is killed."
diff --git a/chess-pgn.el b/chess-pgn.el
index a7433e0..10e71e0 100644
--- a/chess-pgn.el
+++ b/chess-pgn.el
@@ -198,6 +198,13 @@ If INDENTED is non-nil, indent the move texts."
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.pgn\\'" . chess-pgn-mode))
+(eval-after-load "mm-decode"
+ '(unless (fboundp 'mm-display-pgn-inline)
+ (defun mm-display-pgn-inline (handle)
+ (mm-display-inline-fontify handle 'chess-pgn-mode))
+ (push ("application/x-chess-pgn" mm-display-pgn-inline identity)
+ mm-inline-media-tests)))
+
(defun chess-pgn-move ()
"Make a move from a PGN buffer."
(interactive)