;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\300\310!\210\300\311!\207" [require chess-algebraic chess-display chess-fen chess-game chess-ply chess-message mm-decode mm-view pcomplete] 2) (defvar chess-pgn-fill-column 60) (chess-message-catalog 'english '((pgn-read-error . "Error reading move: %s") (pgn-parse-error . "Error parsing PGN syntax"))) #@42 (fn GAME POSITION &optional TOP-LEVEL) (defalias 'chess-pgn-read-plies #[770 "\301C`\302\211\3032Dm?\205C\304\305!\203\306\225b\210\202<\304!\203\207`\262\306\225b\210\307\310!\210\262\311`\"\3121@\313\"0\202O\314\315d{\"\210\316\317!!\262\211\204_\320C\316\321\322#!\266\211\211\211:\205t\211@\323!\205r\211G\324U\262\262\204\201\325\326\327\330E\"\210\331\332\"\206L\321\333\211\211:\205\237\211@\323!\205\235\211G\324U\262\262\204\254\325\326\327\330E\"\210\211@\262\211\323!\205\273\211G\324U\262\204\310\325\326\334\335E\"\210\336!\211\337\211\323!\205\331\211G\324U\262\204\346\325\326\334\335E\"\210\211\340H\262!\323!\205\367\211G\324U\262\204\325\326\334\335E\"\210\211<\204\325\326\341\342E\"\210\340I\266\262\211\211:\205.\211@\323!\205,\211G\324U\262\262\204;\325\326\327\330E\"\210\211A\262#\343\"\210\344\332#\262\262\262\302\323!\205^\211G\324U\262\204k\325\326\334\335E\"\210\211<\204x\325\326\341\342E\"\210\340I\266C\244\266\202<\203\307\304\345!\203\307\306\225b\210\346\347\350\306!#\210\351!@\301=\204\277\352\353!\354\230\203\255\355\351!@\211\211:\205\312\211@\323!\205\310\211G\324U\262\262\204\327\325\326\327\330E\"\210\331\332\"\206\242\321\333\211\211:\205\365\211@\323!\205\363\211G\324U\262\262\204\325\326\327\330E\"\210\211@\262\211\323!\205\211G\324U\262\204\325\326\334\335E\"\210\336!\211\337\211\323!\205/\211G\324U\262\204<\325\326\334\335E\"\210\211\340H\262!\323!\205M\211G\324U\262\204Z\325\326\334\335E\"\210\211<\204g\325\326\341\342E\"\210\340I\266\262\211\211:\205\204\211@\323!\205\202\211G\324U\262\262\204\221\325\326\327\330E\"\210\211A\262#\343\"\210\344\332#\262\262\301\356#C\244\210\202\277\351!@\211\211:\205\306\211@\323!\205\304\211G\324U\262\262\204\323\325\326\327\330E\"\210\331\332\"\206\236\321\333\211\211:\205\361\211@\323!\205\357\211G\324U\262\262\204\376\325\326\327\330E\"\210\211@\262\211\323!\205 \211G\324U\262\204\325\326\334\335E\"\210\336!\211\337\211\323!\205+\211G\324U\262\2048\325\326\334\335E\"\210\211\340H\262!\323!\205I\211G\324U\262\204V\325\326\334\335E\"\210\211<\204c\325\326\341\342E\"\210\340I\266\262\211\211:\205\200\211@\323!\205~\211G\324U\262\262\204\215\325\326\327\330E\"\210\211A\262#\343\"\210\344\332#\262\262\211\323!\205\253\211G\324U\262\204\270\325\326\334\335E\"\210\211C\262C\244\210\357\303\301\"\210\202<\304\360!\203\347\302u\210`\361\362!\210\302u\210\363\311`\364Z\"\"\266\202<\304\365!\203\302u\210\366\302w\210\363\367 \"\"\210\202<\204\304\370!\203\302u\210\357\303\301\"\210\202<\351!@\301=\203%\316\371`d{\"\210\351!@\211\211:\205>\211@\323!\205<\211G\324U\262\262\204K\325\326\327\330E\"\210\331\332\"\206\321\333\211\211:\205i\211@\323!\205g\211G\324U\262\262\204v\325\326\327\330E\"\210\211@\262\211\323!\205\205\211G\324U\262\204\222\325\326\334\335E\"\210\336!\211\337\211\323!\205\243\211G\324U\262\204\260\325\326\334\335E\"\210\211\340H\262!\323!\205\301\211G\324U\262\204\316\325\326\334\335E\"\210\211<\204\333\325\326\341\342E\"\210\340I\266\262\211\211:\205\370\211@\323!\205\366\211G\324U\262\262\204\325\326\327\330E\"\210\211A\262#\343\"\210\344\332#\262\262\211\323!\205#\211G\324U\262\2040\325\326\334\335E\"\210\211C\262C\244\210\357\303\301\"\210\372\302w\210\202 0\210A\207" [chess-algebraic-regexp-ws t nil done looking-at "[1-9][0-9]*\\.[. ]*" 0 skip-syntax-backward " " buffer-substring-no-properties (error) chess-algebraic-to-ply message "PGN: %s" error error-message-string pgn-read-error apply chess-string vectorp 75 signal wrong-type-argument chess-ply ply chess-ply-keyword :next-pos chess-pos-move chess-pos position vconcat copy-alist 71 list annotations chess-pos-set-preceding-ply chess-ply-set-keyword "\\(\\*\\|1-0\\|0-1\\|1/2-1/2\\)" chess-game-set-tag "Result" match-string-no-properties last match-string 1 "1/2-1/2" chess-ply-create :drawn throw "{" search-forward "}" chess-pos-add-annotation 2 "(" " \n" chess-pgn-read-plies ")" "PGN parser: Expected a ply here: '%s'" " \n "] 22 (#$ . 495)]) #@139 Convert PGN notation at point into a chess game. Optionally use the supplied STRING instead of the current buffer. (fn &optional STRING) (defalias 'chess-pgn-to-game #[256 "\211\203\300\301\302\"r\211q\210\303\304\"\216c\210eb\210\305 *\207\305 \207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] chess-pgn-parse] 5 (#$ . 4787)]) (defalias 'chess-pgn-parse #[0 "\301\302!\204\303\304\305\306#\203\312\307\224b\203\312\310 \211\305\204 \311\312!\210\211\204.\211\305=\204.\311\313!\210A\240\210\314C\204>\311\312!\210?\205o\305\211\204M\311\312!\210\211@\262\211\203j\211@\315@A$\262A\266\202\202Q\262\262\266\301\316!\203\210\317\320\321!\320\322!#\210\307\225b\210\202q\211\323\204\222\311\312!\210\211\204\232\311\324!\210\211\204\243\311\312!\210\211A@\262\211\205\261\325\"A\266\203\211\203>\326!\204\303\311\312!\210\327!\204\315\311\330!\210\211\327!\205\332\211G\331U\262\204\347\332\333\334\335E\"\210\211C\262C\204\364\311\312!\210AA\205\375C\241\210\336D\204 \311\312!\210?\205<\305\211\204\311\312!\210\211@\262\211\2037\211@\315@A$\262A\266\202\202\262\262\266\210\211\337\211\305\204L\311\312!\210\340\"\211\211:\205d\211@\327!\205b\211G\331U\262\262\204q\332\333\341\342E\"\210\211@\266\203\306#\204\311\312!\210AA\205\210C\241\210\336D\204\226\311\312!\210?\205\307\305\211\204\245\311\312!\210\211@\262\211\203\302\211@\315@A$\262A\266\202\202\251\262\262\266\207\343\344`d{\"\207" [chess-game-inhibit-events looking-at "\\[" search-forward "[" nil t 0 chess-game-create cl--assertion-failed game (or tags (eq tags nil)) set-tags apply "\\[\\(\\S-+\\)\\s-+\\s\"\\(.*?\\)\\s\"][ \n ]+" chess-game-set-tag match-string-no-properties 1 2 "FEN" tag assoc chess-fen-to-pos vectorp (vectorp position) 75 signal wrong-type-argument chess-pos position setup-game chess-pgn-read-plies chess-game-ply chess-ply ply error "Data not in legal PGN format: '%s'"] 16]) #@23 (fn GAME INDEX PLY) (defalias 'chess-pgn-insert-annotations #[771 "\211\211\211:\205\211@\300!\205\211G\301U\262\262\204\"\302\303\304\305E\"\210\211@\262\211\300!\2051\211G\301U\262\204>\302\303\306\307E\"\210\211\310H\262\211\205d\211@\211;\203W\311\312\261\210\202]\313#\210A\266\202\202C\207" [vectorp 75 signal wrong-type-argument chess-ply ply chess-pos position 71 "\n{" "}" chess-pgn-insert-plies] 9 (#$ . 6868)]) #@116 NYI: Still have to implement INDENTED argument. (fn GAME INDEX PLIES &optional FOR-BLACK INDENTED NO-ANNOTATIONS) (defalias 'chess-pgn-insert-plies #[1539 "\205\310\204]@\211\211:\205\211@\301!\205\211G\302U\262\262\204+\303\304\305\306E\"\210\211A\262\203UiV\203;\307c\210\310\311\312@!#c\210\211\204U\313@#\210A\262T\262\203\276@\211\211:\205w\211@\301!\205u\211G\302U\262\262\204\204\303\304\305\306E\"\210\211A\262\203\272\203\242iV\203\230\307c\210\310\314\"c\210\315\262\310\316\312@!\"c\210\211\204\272\313@#\210A\262\203\317c\210\202\207" [chess-pgn-fill-column vectorp 75 signal wrong-type-argument chess-ply ply 10 format "%d. %s" chess-ply-to-algebraic chess-pgn-insert-annotations "%d. ..." nil " %s" 32] 12 (#$ . 7325)]) (defvar chess-pgn-tag-order '("Event" "Site" "Date" "Round" "White" "WhiteElo" "Black" "BlackElo" "Result" "TimeControl")) #@212 Convert a chess GAME to PGN notation. If INDENTED is non-nil, indent the move texts. If TO-STRING is non-nil, return a string instead of inserting the resulting PGN text. (fn GAME &optional INDENTED TO-STRING) (defalias 'chess-game-to-pgn #[769 "\211\203\300\301\302\"r\211q\210\303\304\"\216\305\"\210\306 *\207\305\"\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] chess-insert-pgn buffer-string] 7 (#$ . 8258)]) #@12 (fn TAG) (defalias 'chess-member-index #[257 "\301\211\203@\232\203\302\262\202T\262\211A\262\202\207" [chess-pgn-tag-order 0 nil] 5 (#$ . 8757)]) #@32 (fn GAME &optional INDENTED) (defalias 'chess-insert-pgn #[513 "\302\204\n\303\304!\210\211\204\303\305!\210\211\204\303\304!\210\211A@\262\211\205)\306\"A\266\203\307\2045\303\304!\210\310\"\211\211:\205M\211@\311!\205K\211G\312U\262\262\204Z\313\314\315\316E\"\210\211@\266\203\203)\317!\230\204)\302\204t\303\304!\210\211\204|\303\305!\210\320\211\204\210\303\304!\210\211A@\262\"\204\226\303\304!\210\211\204\244\211\321=\204\244\303\322!\210A\240\210\323C\204\264\303\304!\210?\205\345\321\211\204\303\303\304!\210\211@\262\211\203\340\211@\324@A$\262A\266\202\202\307\262\262\266\325D\204\363\303\304!\210?\205$\321\211\204\303\304!\210\211@\262\211\203\211@\324@A$\262A\266\202\202\262\262\266\321\262\204; =\204;\326\302\317!#\210\266\327\330\211\204H\303\304!\210\211A@\262!\331\"\211\203f\211@\332\333@A#c\210A\266\202\202P\210\334c\210\335\336\211\204v\303\304!\210\3378\262#\210\340\204\207\303\304!\210\211\204\217\303\305!\210\211\204\230\303\304!\210\211A@\262\211\205\246\306\"A\266\203\206\254\341\334\261\207" [chess-game-inhibit-events chess-starting-position "FEN" cl--assertion-failed game tag assoc 0 chess-game-ply vectorp 75 signal wrong-type-argument chess-ply ply chess-pos-to-fen assq-delete-all nil (or tags (eq tags nil)) set-tags apply delete-tag chess-game-set-tag sort copy-alist #[514 "@\262\211@\262\300!\300!\203\211\204\301\207\204\"\211\203\"\302\207\203.\211\203.W\207\231\207" [chess-member-index t nil] 6 "\n\n(fn LEFT RIGHT)"] format "[%s \"%s\"]\n" 10 chess-pgn-insert-plies 1 3 "Result" "*"] 18 (#$ . 8928)]) (require 'chess-database) #@24 Chess database object. (defvar chess-pgn-database nil (#$ . 10659)) (make-variable-buffer-local 'chess-pgn-database) #@60 If non-nil, the chess display object used for this buffer. (defvar chess-pgn-display nil (#$ . 10782)) (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\"\207" [make-variable-buffer-local chess-pgn-display chess-pgn-current-game chess-pgn-current-index chess-message-catalog english ((could-not-read-pgn . "Could not read or find a PGN game"))] 3) #@63 Read and display a PGN game after point. (fn &optional FILE) (defalias 'chess-pgn-read #[256 "\211\204\f\301\302\303\304#\204\305\306!\262\211\203\307!\210\310 \211\203(\311\312\304!\211\"\207\313\303\314\315\316#!\207" [chess-pgn-display search-forward "[Event " nil t read-file-name "Read a PGN game from file: " find-file chess-pgn-to-game chess-display-set-game chess-create-display could-not-read-pgn error apply chess-string] 9 (#$ . 11150) "P"]) (defvar chess-pgn-mode-map (byte-code "\301 \302\"\210\303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\207" [text-mode-map make-sparse-keymap set-keymap-parent define-key [(control 99) (control 99)] chess-pgn-show-position [mouse-2] chess-pgn-mouse-show-position [32] chess-pgn-insert-and-show-position [tab] chess-pgn-complete-move] 5)) (defvar chess-pgn-mode-hook nil) (byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [chess-pgn-mode-hook variable-documentation put "Hook run after entering PGN mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp chess-pgn-mode-map definition-name chess-pgn-mode] 4) (defvar chess-pgn-mode-map (make-sparse-keymap)) (byte-code "\301\302N\204\303\301\302\304\305!#\210\306\307!\204\303\307\310\311#\210\312\313 !\210\307\302N\204-\303\307\302\304\314!#\210\306\300!\204B\303\300\310\311#\210\315\316\300\317\"\210!\210\300\302N\204P\303\300\302\304\320!#\210\303\311\321\322#\207" [chess-pgn-mode-abbrev-table chess-pgn-mode-map variable-documentation put purecopy "Keymap for `chess-pgn-mode'." boundp chess-pgn-mode-syntax-table definition-name chess-pgn-mode (lambda (#1=#:def-tmp-var) (defvar chess-pgn-mode-syntax-table #1#)) make-syntax-table "Syntax table for `chess-pgn-mode'." (lambda (#1#) (defvar chess-pgn-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `chess-pgn-mode'." derived-mode-parent text-mode] 5) #@233 A mode for editing chess PGN files. In addition to any hooks its parent mode `text-mode' might have run, this mode runs the hook `chess-pgn-mode-hook', as the final or penultimate step during initialization. \{chess-pgn-mode-map} (defalias 'chess-pgn-mode #[0 "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2035\211\321 =\203;\322\f\323 \"\210\210\324 \325\"\204R ,=\204R\326 \325,C#\210\327 !\210\330\f!\210 ,\331-\332.\333\334\335\"\210\333\336\337\"\210\333\340\341\"\210\342\343!\203|\343\344!\210\306\345!\210\346%\306\347!\210\346'\306\350!\210\351()\352\353!\207" [delay-mode-hooks major-mode mode-name chess-pgn-mode-map chess-pgn-mode-syntax-table chess-pgn-mode-abbrev-table make-local-variable t text-mode chess-pgn-mode "PGN" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table abbrev-table-get :parents abbrev-table-put use-local-map set-syntax-table "{" "}" modify-syntax-entry 123 "<" 125 ">" 34 "\"" fboundp font-lock-mode 1 pcomplete-default-completion-function chess-pgn-completions pcomplete-command-completion-function pcomplete-parse-arguments-function chess-pgn-current-word run-mode-hooks chess-pgn-mode-hook local-abbrev-table comment-start comment-end] 5 (#$ . 13164) nil]) (defalias 'pgn-mode 'chess-pgn-mode) (defvar chess-pgn-bold-face 'bold) (defconst chess-pgn-move-regexp (concat "[^0-9]\\(\\([1-9][0-9]*\\)\\.\\s-+\\(\\.\\.\\.\\|" chess-algebraic-regexp "\\)\\(\\s-+\\(" chess-algebraic-regexp "\\)\\)?\\)")) (byte-code "\300\301!\203\301\302\303\304\305E\306\307BD\"\210\310\311\312\"\210\313\314\315\"\207" [fboundp font-lock-add-keywords chess-pgn-mode "\\[\\(\\S-+\\)\\s-+\".*\"\\]" 1 font-lock-keyword-face "\\(1-0\\|0-1\\|1/2-1/2\\|\\*\\)$" chess-pgn-bold-face add-to-list auto-mode-alist ("\\.pgn\\'" . chess-pgn-mode) eval-after-load "mm-decode" #[0 "\303\304!?\205\305\304\306\"\210\307B\310 B\310\nB\211\207" [mm-inline-media-tests mm-inlined-types mm-automatic-display fboundp mm-display-pgn-inline defalias #[257 "\300\301\"\207" [mm-display-inline-fontify chess-pgn-mode] 4 "\n\n(fn HANDLE)"] ("application/x-chess-pgn" mm-display-pgn-inline identity) "application/x-chess-pgn"] 3]] 5) #@61 Return a list of possible completions for the current move. (defalias 'chess-pgn-completions #[0 " \204\n\302\303!\210\304\"\211\211:\205\"\211@\305!\205 \211G\306U\262\262\204/\307\310\311\312E\"\210\211@\266\203\313\314\315\"\316\211\211$\205B\2023\207" [chess-pgn-current-game chess-pgn-current-index cl--assertion-failed game chess-game-ply vectorp 75 signal wrong-type-argument chess-ply ply pcomplete--here make-closure #[0 "\301\302\303\300\304\300\211\305!\205\211G\306U\262\204\307\310\311\312E\"\210\211\313H\262#\"\207" [V0 mapcar chess-ply-to-algebraic chess-legal-plies :color vectorp 75 signal wrong-type-argument chess-pos position 70] 11] nil] 8 (#$ . 15485)]) (defalias 'chess-pgn-current-word #[0 "`\301 \211\205\214\302\224}\210\303 )\207" [chess-pgn-current-index chess-pgn-index 3 pcomplete-parse-buffer-arguments] 3]) (defalias 'chess-pgn-complete-move #[0 "\214e`}\210\301 \210)\302=\203\303\304\303!\207" [last-command chess-pgn-read-game chess-pgn-complete-move pcomplete call-interactively] 2 nil nil]) #@71 Return the move index associated with point. (fn &optional LOCATION) (defalias 'chess-pgn-index #[256 "\212\211\203\211b\210\301\302\303#\205'\304\305\306!!\305\307!\306S_T\203%\211T\262\266\202)\207" [chess-pgn-move-regexp re-search-backward nil t string-to-number match-string 2 14] 5 (#$ . 16551)]) (defvar chess-file-locations nil) #@59 Load a database to represent this file if not already up. (defalias 'chess-pgn-read-game #[0 "\204 \304 \305\"\212\n`\306\211\203)@V\203\306\262\202\262A\262\202\2035\nGGZ\2026\307\262 \203F\211\310 \311\"U?\205L\312\"\211\266\204)\207" [chess-pgn-database buffer-file-name chess-file-locations chess-pgn-current-game chess-database-open chess-file nil 0 chess-game-data database-index chess-database-read] 8 (#$ . 16902)]) #@46 Return the move index associated with point. (defalias 'chess-pgn-create-display #[0 "\212\205P\303 \203\304 !\204\305\306\305!\211)\204.\307\310\"\307\311 !\310\"\206*\312U\204F\313 !\210\314 #\210\315\311 !\310\307\310\"#\210\202K\316 \"\210\317 !\262)\207" [chess-pgn-current-game chess-pgn-display chess-game-inhibit-events chess-pgn-index buffer-live-p t chess-create-display chess-game-data database-index chess-display-game -1 chess-display-disable-popup chess-display-set-game chess-game-set-tag chess-display-set-index chess-display-popup] 7 (#$ . 17360)]) #@104 Visualize the move for the PGN game under point. This does not require that the buffer be in PGN mode. (defalias 'chess-pgn-visualize #[0 "\301\212\302\303\301\304#\203\305 \262)\211\203\211\306 )\207\307\301\310\311\312#!\207" [chess-pgn-current-game nil search-backward "[Event " t chess-pgn-to-game chess-pgn-show-position could-not-read-pgn error apply chess-string] 8 (#$ . 17952)]) (defalias 'chess-pgn-show-position #[0 "\301=\204 \302 \207\303 \210\304 \207" [major-mode chess-pgn-mode chess-pgn-visualize chess-pgn-read-game chess-pgn-create-display] 2 nil nil]) #@14 (fn EVENT) (defalias 'chess-pgn-mouse-show-position #[257 "\300\301!\211@\262!q\210\302\301!!b\210\303 \207" [window-buffer event-start posn-point chess-pgn-show-position] 4 (#$ . 18540) "e"]) (defalias 'chess-pgn-insert-and-show-position #[0 "\300\301!\210\302 \207" [self-insert-command 1 chess-pgn-show-position] 2 nil nil]) (provide 'chess-pgn)