%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/share/emacs/27.2/lisp/play/
Upload File :
Create Path :
Current File : //usr/local/share/emacs/27.2/lisp/play/gametree.elc

;ELC
;;; Compiled
;;; in Emacs version 27.2
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\312\313\314&	\210\315\316\317\320\321\322\311\304&\210\315\323\324\325\321\322\311\304&\210\315\326\327\330\321\331\311\304&\210\315\332\333\334\321\331\311\304&\210\315\335\336\337\321\340\311\304&\207" [require derived outline custom-declare-group gametree nil "Manage game analysis trees in Emacs." :prefix "gametree-" :group games :version "20.3" custom-declare-variable gametree-half-ply-regexp (regexp-quote ":") "Matches ends of numbers of moves by the \"second\" player.\nFor instance, it is an almost universal convention in chess to postfix\nnumbers of moves by Black (if considered in isolation) by the ellipsis\n\"...\".  This is NOT a good choice for this program, though, because it\nconflicts with the use of ellipsis by Outline mode to denote collapsed\nsubtrees.  The author uses \":\" because it agrees nicely with a set of\nLaTeX macros he uses for typesetting annotated games." :type regexp gametree-full-ply-regexp (regexp-quote ".") "Matches ends of numbers of moves by the \"first\" player.\nFor instance, it is an almost universal convention in chess to postfix\nnumbers of moves by White (if considered in isolation) by the dot \".\"." gametree-half-ply-format "%d:" "Output format for move numbers of moves by the \"second\" player.\nHas to contain \"%d\" to output the actual number." string gametree-full-ply-format "%d." "Output format for move numbers of moves by the \"first\" player.\nHas to contain \"%d\" to output the actual number." gametree-make-heading-function #'(lambda (level) (insert (make-string level 42))) "A function of one numeric argument, LEVEL, to insert a heading at point.\nYou should change this if you change `outline-regexp'." function] 10)
#@401 A list encoding the layout (i.e. the show or hide state) of the file.
If Emacs notices a local variable specification of this variable in
the first line of the buffer while saving the buffer to the visited
file, the local value will be saved there and restored the next time
the file is visited (subject to the usual restriction via
`enable-local-variables'), and the layout will be set accordingly.
(defvar gametree-local-layout nil (#$ . 2177))
(byte-code "\300\301\302\303\304\305\306\307&\210\300\310\311\312\304\305\306\307&\210\300\313\314\315\304\305\306\307&\210\300\316\317\320\304\321\306\307&\210\300\322\323\324\304\325\306\307&\207" [custom-declare-variable gametree-score-opener "{score=" "The string which opens a score tag, and precedes the actual score." :type string :group gametree gametree-score-manual-flag "!" "String marking the line as manually (as opposed to automatically) scored." gametree-score-closer "}" "The string which closes a score tag, and follows the actual score." gametree-score-regexp (concat "[^\n
]*\\(" (regexp-quote gametree-score-opener) "[ 	]*\\(" (regexp-quote gametree-score-manual-flag) "[ 	]*\\)?\\([-+]?[0-9]+\\)" (regexp-quote gametree-score-closer) "[ 	]*\\)[\n
]") "Regular expression matching lines that guide the program in scoring.\nIts third parenthetical group should match the actual score.  Its\nfirst parenthetical group should match the entire score tag.  Its\nsecond parenthetical group should be an optional flag that marks the\nline as *manually* (as opposed to automatically) scored, which\nprevents the program from recursively applying the scoring algorithm\non the subtree headed by the marked line, and makes it use the manual\nscore instead." regexp gametree-default-score 0 "Score to assume for branches lacking score tags." integer] 8)
#@300 Insert/delete space between leading asterisks and heading text.
If the current variation is an internal node (i.e. starts with one or
more asterisks), ensure there's at least one space between the
asterisks and the text.  If on the other hand this is a leaf, there
should be no leading white space.
(defalias 'gametree-prettify-heading #[nil "\212\303\304!\210\305\306P\307\310#\203\311\312!\204#\313c\210\202#\314\212\315\307w)!\210\305\316	\317\n\320\260\307\310#\205D\311\312!\204<\313c\202D\314\212\315\307w)S!)\207" [outline-regexp gametree-full-ply-regexp gametree-half-ply-regexp beginning-of-line 1 re-search-forward "\\=" nil t looking-at "[ 	]+" " " delete-char " 	" "\\=[ 	]*[1-9][0-9]*\\(" "\\|" "\\)"] 6 (#$ . 3999)])
#@52 Read and return the number of the ply under point.
(defalias 'gametree-looking-at-ply #[nil "m\203\304\207\305\306	\307\260\310\311!\312!\2031\313\314\315\311!!_\316	\315\313!\"\203,\311\202-\304\\\202E\212\317\n\"\210\320\321x\210\313\314`\311\225{!_T)*\207" [gametree-full-ply-regexp gametree-half-ply-regexp limit boundary 0 "[ 	]*\\([1-9][0-9]*\\)\\(" "\\|" "\\)" line-beginning-position 1 looking-at 2 string-to-number match-string string-match re-search-backward "0123456789" nil] 5 (#$ . 4745)])
#@67 Return the ply number of the first move of the current variation.
(defalias 'gametree-current-branch-ply #[nil "\212\301\302!\210\303\304P\305\306#\210\307 )\207" [outline-regexp beginning-of-line 1 re-search-forward "\\=" nil t gametree-looking-at-ply] 4 (#$ . 5266)])
(defalias 'gametree-forward-line #[nil "\300\301\302\303#\207" [re-search-forward "[\n
]" nil move] 4])
(put 'gametree-forward-line 'byte-optimizer 'byte-compile-inline-expand)
#@133 Return the depth of the current variation in the analysis tree.
This value is simply the outline heading level of the current line.
(defalias 'gametree-current-branch-depth #[nil "\212\301\302!\210\303!\203\304 \202\305)\207" [outline-regexp beginning-of-line 1 looking-at outline-level 0] 2 (#$ . 5721)])
#@70 Move the current leaf variation behind all others on the same level.
(defalias 'gametree-transpose-following-leaves #[nil "\212\302\303\304\305#\210`m\204\306 \307U\203\302\303\304\305#\210\202	`{`|\210*\212\310\311!\210	c*\207" [p following-leaves re-search-forward "[\n
]" nil move gametree-current-branch-depth 0 beginning-of-line 1] 4 (#$ . 6038)])
(defalias 'gametree-show-children-and-entry #[nil "\300 \210\301 \207" [outline-show-children outline-show-entry] 1])
(put 'gametree-show-children-and-entry 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'gametree-entry-shown-p #[nil "\212\301y\210n\205m?\205\302!?)\207" [outline-regexp 1 looking-at] 2])
(defalias 'gametree-children-shown-p #[nil "\212\3011\302 \303\304!\210\302 W)0\202\210\305)\207" [depth (error) gametree-current-branch-depth outline-next-visible-heading 1 nil] 2])
(defalias 'gametree-current-layout #[(depth &optional from-top-level) "\306\307\212\3101-\203\n\203n\203\311!\204%\306\211\204%\312\313!\210\f\314 W0\202/\210\306)\203q\204;\312\313!\210\306\315 \204T	\316 \203M\317C\202O\306C\244\202	\316 \203_\320C\202a\321C\244\322\314 !	
C\244)\202	*\207" [first-time layout from-top-level outline-regexp depth sub-layout nil t (error) looking-at outline-next-visible-heading 1 gametree-current-branch-depth gametree-children-shown-p gametree-entry-shown-p show-entry gametree-show-children-and-entry show-children gametree-current-layout] 2])
(defalias 'gametree-save-layout #[nil "\212eb\210\301\302\303\"\211)\207" [gametree-local-layout gametree-current-layout 0 t] 3])
(defalias 'gametree-apply-layout #[(layout depth &optional from-top-level) "\305	\205p\212\3061/\203\n\203n\203\307!\204'\310\211\204'\311\312!\210\f\313 W0\2021\210\310)\205p\204=\311\312!\210\310\314 \210	@\203K	@ \210	A@\203X	A@<\204_	A\211\202\315	A@\313 \"\210	AA\211\204\310)\207" [first-time layout from-top-level outline-regexp depth t (error) looking-at nil outline-next-visible-heading 1 gametree-current-branch-depth outline-hide-subtree gametree-apply-layout] 4])
(defalias 'gametree-restore-layout #[nil "\212eb\210\301\302\303#)\207" [gametree-local-layout gametree-apply-layout 0 t] 4])
(defalias 'gametree-hack-file-layout #[nil "\212eb\210\302\303!\205\304\224b\210`\304\225|\210p\305	!))\207" [standard-output gametree-local-layout looking-at "[^\n]*-*-[^\n]*gametree-local-layout: \\([^;\n]*\\);" 1 princ] 2])
#@136 Return score of current variation according to its score tag.
When no score tag is present, use the value of `gametree-default-score'.
(defalias 'gametree-current-branch-score #[nil "\302!\203\f\303\304\305!!\207	\207" [gametree-score-regexp gametree-default-score looking-at string-to-number match-string 3] 3 (#$ . 8521)])
#@126 Return current internal node score computed recursively from subnodes.
Subnodes which have been manually scored are honored.
(defalias 'gametree-compute-reduced-score #[nil "\306 \307U\204\212\310\311\312\313#\210m)\204\314!\203\"\315\316!\203\"\317 \207\306 \212\310\311\312\313#\210\n\320\321 \316\"\307U\203;\322\202<\323m\204X\306 \307U\203X\f\317 \"\310\311\312\313#\210\202>m?\205a	\306 W\211\204~\f\324 \"\3251w\326\327!0\202y\210\312\211\203f)\f,\207" [gametree-score-regexp depth gametree-default-score minmax running done gametree-current-branch-depth 0 re-search-forward "[\n
]" nil move looking-at match-string 2 gametree-current-branch-score mod gametree-current-branch-ply max min gametree-compute-reduced-score (error) outline-forward-same-level 1] 5 (#$ . 8855)])
#@401 Start a new leaf variation under the current branching point.
The new variation can later be split to be a branching point itself,
with \[gametree-break-line-here].  If the point is currently on a
leaf variation, this command won't work; use \[gametree-break-line-here]
on the current line first.

With a numeric arg AT-DEPTH, first go up the tree until a node of
depth AT-DEPTH or smaller is found.
(defalias 'gametree-insert-new-leaf #[(&optional at-depth) "\305 \306U\203\307\306!\210\203\305 \310!V\203\307\311!\210\202\312\311!\210\305 \313 \210\31414\315\311!0\202>\210db\210n\204?\316c\210\305 	V\203K\317 \202R\212\320y\210\317 )`Sb\210\316c\210\321\322\n\323\"\306U\203h\202i\f\n\323\245\"c*\207" [at-depth parent-depth starting-plies gametree-full-ply-format gametree-half-ply-format gametree-current-branch-depth 0 outline-up-heading prefix-numeric-value 1 beginning-of-line outline-show-entry (error) outline-next-visible-heading "\n" gametree-current-branch-ply -1 format mod 2] 4 (#$ . 9668) "*P"])
#@509 Split the variation node at the point position.
This command works whether the current variation node is a leaf, or is
already branching at its end.  The new node is created at a level that
reflects the number of game plies between the beginning of the current
variation and the breaking point.

With a numerical argument AT-MOVE, split the variation before
White's AT-MOVEth move, or Black's if negative.  The last option will
only work of Black's moves are explicitly numbered, for instance
`1. e4 1: e5'.
(defalias 'gametree-break-line-here #[(&optional at-move) "\203+\306\210`\307\306!\210\310\311\312\313\314!!!!\315V\203!\n\202\"P	\"\210)\315\224b\210\316 \210\317 \320 \321 \211\315U\203{\212\322\306!\210\3231Q\320 0\202S\210\315\211 \315U\203a\321 T\202h\321 
 Z\\))\212\307\306!\210!!\210\324 \210)\212\325\326\n\327\330\260!\204\250\331\332\333 \334\"\315U\203\230\"\202\232#\333 \334\245\"c\210\324 \210\307\306!\210\fb\210\335c\210\315U\204\300!\320 
Z\\!\210\324 -\207" [at-move limit gametree-full-ply-regexp gametree-half-ply-regexp pt plies 1 beginning-of-line re-search-forward regexp-quote int-to-string abs prefix-numeric-value 0 gametree-transpose-following-leaves point-marker gametree-current-branch-ply gametree-current-branch-depth outline-previous-visible-heading (error) gametree-prettify-heading looking-at "[ 	]*[1-9][0-9]*\\(" "\\|" "\\)" format mod gametree-looking-at-ply 2 "\n" depth old-depth old-branch-ply gametree-make-heading-function gametree-full-ply-format gametree-half-ply-format] 7 (#$ . 10708) "*P"])
#@117 Merges a variation with its only child.
Does *not* check if the variation has in fact a unique child; users beware.
(defalias 'gametree-merge-line #[nil "\302 \303U\203\304\303!\210\305!\203\306\224\306\225|\210\306\210\212\306y\210\302 )\307	T!\210	\303U\205:\212\310\306!\210\307\302 !\210\311 ))\207" [gametree-score-regexp prev-depth gametree-current-branch-depth 0 outline-up-heading looking-at 1 delete-char beginning-of-line gametree-prettify-heading] 2 (#$ . 12304) "*"])
#@274 Insert a score tag with value SCORE at the end of the current line.
If this line already has a score tag, just jump to it and alter it.
When called from a program, optional AUTO flag tells if the score is
being entered automatically (and thus should lack the manual mark).
(defalias 'gametree-insert-score #[(score &optional auto) "\306\307!\210\310!\2038\311\224b\210	\203\312\313!\203\313\224\313\225|\210\n\203(\311\224\311\225|\210	\204W\312\313!\204Wc\210\202W\307\210\212\314\315x)\316U\203H\317c\210\fc\210	\204Rc\210\212
c\210)\n??\205e\212\320\321\n!!c)\207" [gametree-score-regexp auto score gametree-score-manual-flag gametree-score-opener gametree-score-closer beginning-of-line 1 looking-at 3 match-string 2 " 	" nil 0 " " int-to-string prefix-numeric-value] 3 (#$ . 12799) "*P"])
#@127 Compute current node score, maybe recursively from subnodes. Insert it.
Subnodes which have been manually scored are honored.
(defalias 'gametree-compute-and-insert-score #[nil "\303!\205\304\305!???\306 \307	\n\"*\207" [gametree-score-regexp score auto looking-at match-string 2 gametree-compute-reduced-score gametree-insert-score] 3 (#$ . 13616) "*"])
#@235 Store current tree layout in register REGISTER.
Use \[gametree-apply-register-layout] to restore that configuration.
Argument is a character, naming the register.

Interactively, reads the register using `register-read-with-preview'.
(defalias 'gametree-layout-to-register #[(register) "\212eb\210\301\302\303\304\"\")\207" [register set-register gametree-current-layout 0 t] 5 (#$ . 13983) (list (register-read-with-preview "Layout to register: "))])
#@164 Return to a tree layout stored in a register.
Argument is a character, naming the register.

Interactively, reads the register using `register-read-with-preview'.
(defalias 'gametree-apply-register-layout #[(char) "\212eb\210\301\302!\303\304#)\207" [char gametree-apply-layout get-register 0 t] 4 (#$ . 14443) (progn (barf-if-buffer-read-only) (list (register-read-with-preview "Apply layout from register: ")))])
#@325 Save the current tree layout and hack the file local variable spec.
This function saves the current layout in `gametree-local-layout' and,
if a local file variable specification for this variable exists in the
buffer, it is replaced by the new value.  See the documentation for
`gametree-local-layout' for more information.
(defalias 'gametree-save-and-hack-layout #[nil "\301 \210\302\303 \210)\304\207" [inhibit-read-only gametree-save-layout t gametree-hack-file-layout nil] 1 (#$ . 14866) nil])
(defvar gametree-mode-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210\302\313\312#\210\302\314\315#\210\302\316\317#\210\302\320\321#\210\302\322\323#\210)\207" [map make-sparse-keymap define-key "\n" gametree-break-line-here "" gametree-insert-new-leaf "
" gametree-merge-line " " gametree-layout-to-register "/" "j" gametree-apply-register-layout "" gametree-save-and-hack-layout ";" gametree-insert-score "^" gametree-compute-and-insert-score] 4))
(defvar gametree-mode-hook nil)
(byte-code "\300\301N\204\f\302\300\301\303#\210\304\305!\204\302\305\306\307#\210\300\207" [gametree-mode-hook variable-documentation put "Hook run after entering GameTree mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it.  (This is true for all hook variables.)" boundp gametree-mode-map definition-name gametree-mode] 4)
(defvar gametree-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" [gametree-mode-abbrev-table gametree-mode-map variable-documentation put purecopy "Keymap for `gametree-mode'." boundp gametree-mode-syntax-table definition-name gametree-mode (lambda (#1=#:def-tmp-var) (defvar gametree-mode-syntax-table #1#)) make-syntax-table "Syntax table for `gametree-mode'." (lambda (#1#) (defvar gametree-mode-abbrev-table #1#)) define-abbrev-table nil "Abbrev table for `gametree-mode'." derived-mode-parent outline-mode] 5)
#@387 Major mode for managing game analysis trees.
Useful to postal and email chess (and, it is hoped, also checkers, go,
shogi, etc.) players, it is a slightly modified version of Outline mode.

\{gametree-mode-map}

In addition to any hooks its parent mode `outline-mode' might have run,
this mode runs the hook `gametree-mode-hook', as the final or penultimate step
during initialization.
(defalias 'gametree-mode #[nil "\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\2036
\321 =\203<\322\f\323 \"\210)\324!\325\"\204V!\"=\204V\326!\325\"C#\210\327!\210\330\f!\210!\"\331\332!\210\333\334\335\336\307$\210)\337\340!\207" [delay-mode-hooks major-mode mode-name gametree-mode-map gametree-mode-syntax-table parent make-local-variable t outline-mode gametree-mode "GameTree" 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 auto-fill-mode 0 add-hook write-contents-functions gametree-save-and-hack-layout nil run-mode-hooks gametree-mode-hook gametree-mode-abbrev-table local-abbrev-table] 6 (#$ . 17062) nil])
(defalias 'gametree-mouse-break-line-here #[(event) "\301!\210\302 \207" [event mouse-set-point gametree-break-line-here] 2 nil "e"])
(defalias 'gametree-mouse-show-children-and-entry #[(event) "\301!\210\302 \210\303 \207" [event mouse-set-point outline-show-children outline-show-entry] 2 nil "e"])
(defalias 'gametree-mouse-show-subtree #[(event) "\301!\210\302 \207" [event mouse-set-point outline-show-subtree] 2 nil "e"])
(defalias 'gametree-mouse-hide-subtree #[(event) "\301!\210\302 \207" [event mouse-set-point outline-hide-subtree] 2 nil "e"])
(byte-code "\301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\312\313!\207" [gametree-mode-map define-key [M-down-mouse-2 M-mouse-2] gametree-mouse-break-line-here [S-down-mouse-1 S-mouse-1] gametree-mouse-show-children-and-entry [S-down-mouse-2 S-mouse-2] gametree-mouse-show-subtree [S-down-mouse-3 S-mouse-3] gametree-mouse-hide-subtree provide gametree] 4)

Zerion Mini Shell 1.0