diff options
| author | John Wiegley <johnw@newartisans.com> | 2008-08-29 02:43:55 -0400 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2008-08-29 02:43:55 -0400 |
| commit | 3187bd1eadb312b6f6d6e1bb9218f19346300e7d (patch) | |
| tree | eb3667d49ec27fc7036d23bd23ed839191a261d7 /chess-pgn.el | |
| parent | 7e5230b8ffe32cfe7c1ec31d37c40684893aa787 (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).
Diffstat (limited to 'chess-pgn.el')
| -rw-r--r-- | chess-pgn.el | 22 |
1 files changed, 13 insertions, 9 deletions
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))))) |
