annotate lisp/play/gametree.el @ 105973:b7d8222914b4

2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-clone-subtree-with-time-shift): Make it work at the end of the buffer. * org-mobile.el (org-mobile-write-checksums): Specify coding system. (org-mobile-timestamp-buffer): Keep local variable/mode line at beginning of buffer. * org-latex.el (org-latex-entities-regexp): Fix typo in regexp. * org.el (org-block-todo-from-children-or-siblings-or-parent) (org-block-todo-from-checkboxes): Do not block changes to a nil TODO state. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-habit.el (org-habit-parse-todo): Indicate which habit is wrongly set up in the error messages. * org-colview.el (org-columns-display-here): Don't try to calculate values if the underlying property is not set. (org-columns-string-to-number): Convert age strings back into fractional days. (org-agenda-colview-summarize): Handle extended summary types properly. * org-colview-xemacs.el (org-columns-display-here): Don't try to calculate values if the underlying property is not set. (org-columns-string-to-number): Convert age strings back into fractional days. (org-agenda-colview-summarize): Handle extended summary types properly. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-format-drawer-function): New variable. (org-export-format-drawer): New function. (org-export-preprocess-string): Pass the backend as a parameter to `org-export-remove-or-extract-drawers'. (org-export-remove-or-extract-drawers): New parameter BACKEND. * org-protocol.el (org-protocol-char-to-string): New defsubst. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-diary-entry-in-org-file): Add error message when no block is selected. * org-latex.el (org-export-latex-links): Check for protectedness in the last matched character, not after the match. * org-datetree.el (org-datetree-find-date-create): Respect restriction when KEEP-RESTRICTION is set. (org-datetree-file-entry-under): New function. (org-datetree-cleanup): New command. 2009-11-13 Dan Davison <davison@stats.ox.ac.uk> * org-src.el (org-edit-src-code): New optional argument context allows calling functions to avoid altering the saved window configuration. (org-edit-src-exit): Do not restore window configuration when this function is used in the context of saving the edit buffer. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-out, org-clock-cancel): Revert to instances to switching to with-current-buffer, because these seem to cause problems - no idea why. * org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file): Require diary-lib for (diary-date-display-form). 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-log-reschedule, org-log-redeadline): New options. (org-log-note-headings): Add templates for rescheduling and deadline changing. (org-startup-options): Add in-buffer settings for logging changing schedule and deadline time stamps. (org-deadline, org-schedule): Check for existing date and arrange for logging if the user requests it. (org-add-log-note): Prepare proper note buffers for rescheduling and deadline changes. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-diary-entry-in-org-file) (org-agenda-add-entry-to-org-agenda-diary-file) (org-agenda-insert-diary-make-new-entry): New functions. (org-agenda-diary-entry): Call `org-agenda-diary-entry-in-org-file' when appropriate. * org.el (org-calendar-insert-diary-entry-key): New option. (org-agenda-diary-file): New option. ("calendar"): Install our insertion function in the calendar. * org-remember.el (org-datetree): Require. (org-remember-templates): Add new positioning option. (org-remember-reference-date): New variable. (org-remember-apply-template): Store the reference date in a local variable. (org-remember-handler): Implement date tree positioning of entries. * org-datetree.el: New file. * org-latex.el (org-export-latex-preprocess): Protect targets in verbatim emphasis. * org-html.el (org-export-as-html): Protect targets in verbatim emphasis. * org-docbook.el (org-export-as-docbook): Protect targets in verbatim emphasis. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-show-notification): Handle messages that contain a percent character. * org-remember.el (org-remember-apply-template): Turn of partial completion. * org-mobile.el (org-mobile-before-process-capture-hook): New hook. (org-mobile-pull): Run `org-mobile-before-process-capture-hook'. * org.el (org-indent-mode): Define variable already in org.el. (org-unfontify-region): Remove line-prefix and wrap-prefix properties only if org-indent-mode is active. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-icalendar.el (org-print-icalendar-entries): Save match data around call to verify function. (org-print-icalendar-entries): Add a call to the verification function. * org.el (org-speedbar-set-agenda-restriction): Remove unnecessary save-restrivtion' form. 2009-11-13 Dan Davison <davison@stats.ox.ac.uk> * org-exp.el (org-export-format-source-code-or-example): restrict scope of preserve-indentp to the let binding. (org-src): require org-src, since org-src-preserve-indentation is used. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-timer.el (org-timer-set-timer): Set variables org-timer-timer[123] correctly. * org-mobile.el (org-mobile-files-alist): Make it work when `agenda-archives' is included in `org-agenda-text-search-extra-files'. (org-mobile-push): Restore agenda after mobile push. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-clock.el (org-resolve-clocks-if-idle): Another fix to the way the amount of idle time is presented in the minibuffer. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-icalendar.el (org-print-icalendar-entries): Use org-icalendar-verify-function only if non-nil. * org.el (org-refile): Refile to clock only if the prefix arg is 2. (org-sparse-tree): Fix docstring to be in line with prompt. (org-update-parent-todo-statistics): Call `org-after-todo-statistics-hook' on each level. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-remember.el (org-remember-apply-template): Make sure the buffer exists. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-tab-ind-state): New variable. (org-cycle-level): New function. (org-cycle-level-after-item/entry-creation): New option. (org-flag-subtree): New function. (org-hide-archived-subtrees): Call `org-flag-subtree'. (org-set-effort): Indexed access. * org-list.el (org-cycle-item-indentation): New function. * org.el (org-refile): Make prefix argument 2 refile to current clock. (org-priority): Interpret action `remove' as call to remove the priority cookie. * org-remember.el (org-remember-apply-template): Don't depend on buffer name being like file name. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-play-sound): Expand file in org-clock-sound, to allow ~ for home. * org-remember.el (org-remember-handler): Set text-before-node-creation even if this already looks like a node, because the string might be needed on non-org-mode target files. * org-agenda.el (org-agenda-open-link): Make this work in agenda clocktables. (org-agenda-switch-to): Follow a link at point if org-return-follows-link' is set and there is nothing else to do in this line. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-colview-xemacs.el: Add in changes from org-colview.el 2009-11-13 Dan Davison <davison@stats.ox.ac.uk> * org-exp-blocks.el: Modify split separator regexp to avoid empty strings. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-colview.el (org-columns-new): Make this work with the new operators. (org-columns-store-format): Make this work with the new operators. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-src.el (org-src-preserve-indentation): Document that this variable is also used during export. * org-exp.el (org-export-format-source-code-or-example): Preserve indentation if a block has a -i option, or if `org-src-preserve-indentation' is set. * org-exp-blocks.el (org-export-blocks-preprocess): Preserve indentation if a block has a -i option, or if `org-src-preserve-indentation' is set. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-mode-map): Define the new archiving keys. (org-speed-commands-default): Define an archiving key in the speed command map. (org-org-menu): Improve the menu structure concerning archiving. * org-archive.el (org-archive-subtree-default-with-confirmation): New command. * org-agenda.el (org-agenda-mode-map): Define the new archiving keys. (org-agenda-menu): Add the new archiving commands to the menu. (org-agenda-archive-default) (org-agenda-archive-default-with-confirmation): New commands. (org-agenda-archive, org-agenda-archive-to-archive-sibling): Just call `org-agenda-archive-with'. (org-agenda-archive-with): New function. * org-table.el (org-table-convert-region): Inert spaces around "|" to avoid line beginnings like "|-1" which will be mistaken as hlines. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-offer-links-in-entry): Return nil if there are no links, t if a link has been selected. (org-open-at-point): Open attachment directory when called in the headline and there are no links in the entry body. (org-speed-commands-default): Add "o" for open-at-point as a speed command. * org-attach.el (org-attach-reveal): Optional prefix arg IF-EXISTS, which avoids creating the attachment directory if it does not yet exist. * org-agenda.el (org-agenda, org-run-agenda-series): Evaluate MATCH. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el ("abbrev"): Work with abbrev tables only after they have been loaded. * org-list.el (org-list-send-list): Fix bug related to match data. * org-latex.el (org-export-latex-fontify): Apply verbatim emphasis. (org-export-latex-make-header): Insert \obeylines if line breaks should be preserved. * org-exp.el (org-export-protect-verbatim): Add an `org-verbatim-emph' property to such text. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-icalendar.el (org-icalendar-use-plain-timestamp): New option. (org-print-icalendar-entries): Skip entries where the timestamp is not a deadline and not scheduled, if the user requests that. * org-latex.el (org-export-latex-quotation-marks): Allow a bracket before an opening quote. * org-archive.el (org-archive-subtree): Keep archive after archiving something. * org-id.el (org-id-update-id-locations): Add archive files if that is required by `org-id-extra-files'. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-src.el (org-src-window-setup): New option. (org-src-switch-to-buffer): New function. (org-edit-src-exit): Add optional argument CONTEXT and use it to restore window configuration. (org-edit-src-code, org-edit-src-continue, org-edit-src-exit): Call `org-src-switch-to-buffer'. * org.el (org-default-properties): Add STYLE property. (org-files-list): Use the function call to get the files. (org-additional-option-like-keywords): Add SETUPFILE to completion list. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (org-table-convert-region): Correctly interpret quoting in csv import. * org.el (org-icompleting-read): Make iswitchb completion work with lists and tables. * org-agenda.el (org-agenda-add-entry-text): Never add entry text while pushing the mobile agenda. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-clock.el (org-clock-auto-clock-resolution): Now takes three values: nil, t and `when-no-clock-is-running'. (org-clock-in): Use `org-clock-auto-clock-resolution' to determine whether or not to resolve Org buffers on clock in. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-colview.el (org-format-time-period): Function to format times in fractional days for display. (org-columns-display-here): Add support for showing a calculated value in place of the property. (org-columns): Set `org-columns-time' to the current time so time difference calculations will work. (org-columns-time): Use to store the current time when column view is displayed, so all time differences will use the same reference point. (org-columns-compile-map): There is now an extra position in each entry specifying the function to use to calculate the displayed value for the non-calculated properties in the column, (org-columns-compute-all): Set `org-columns-time' to the current time so time difference calculations will work. (org-columns-compute): Handle column operators where the values used are calculated from the underlying property. (org-columns-number-to-string): Handle the 'age' column format (org-columns-string-to-number): Correct the function name (was org-column...). Add support for the 'age' column format. (org-columns-compile-format): Support the additional parameter in org-columns-compile-map. 2009-11-13 Bastien Guerry <bzg@altern.org> * org.el (org-mode-hook): Turn `org-mode-hook' into a customizable variable. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-has-been-used): New variable. (org-clock-in): Set `org-clock-has-been-used'. (org-clock-save): Save only if clock data has been used or created during this session. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-persist): New value, to store only the clock history. (org-clock-save): Don't save the clock if only the history should be stored. (org-clock-load): Turn off John Wiegley's auto resolving mechanism when restoring a saved clock. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-clock.el (org-clock-display, org-clock-put-overlay): Use `org-time-clock-use-fractional'. * org.el (org-time-clocksum-use-fractional) (org-time-clocksum-fractional-format): Two new customizable variables which allow the user to select fractional times (1.25 instead of 1:25) in the `org-clock-display' report. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-ascii.el (org-export-ascii-table-keep-all-vertical-lines): New option. * org.el (org-tag-alist): Fix customization type. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-update-checksum-for-capture-file): Make sure the regexp search can fail without throwing an error. (org-mobile-apply): Save the inbox buffer after removing successfully applied changes. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-clock.el (org-resolve-clocks-if-idle): Fix to the way idle time is reported after the user comes back (but before they resolve time). * org.el (org-get-repeat): Change so that this function can be called with either `org-scheduled-string' or `org-deadline-string'. * org-clock.el (org-clock-auto-clock-resolution): Renamed `org-clock-disable-clock-resolution', since negatives don't sound good in customization variables. (org-clock-in): Don't use the auto-resolution logic if the user is clocking into a different task while an active clock is running. This then allows the default behavior of clocking out of the open task and then into the new task. * org.el (org-modules): Made this variable more consistent, since it was referring to Org, OrgMode and Org-mode, whereas the docs for the variable always refer to Org-mode. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org.el (org-repeat-re): The changed org-repeat-re no longer matched simple +2d type repeaters. Fix it so it does. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-preprocess): Protect the vspace macro in the VERSE environment. 2009-11-13 John Wiegley <jwiegley@gmail.com> * org-habit.el (org-habit-get-priority): A new function that determines the relative priority of a habit, based on how long past its scheduled date it is, and how near the deadline is. * org-agenda.el (org-agenda-get-scheduled): Set habit priority using `org-habit-get-priority'. * org-habit.el (org-habit-build-graph): Start displaying colors from the first scheduled date, if that date is earlier than the first completion date. * org-habit.el: Changed all "color" variables to faces, and made them appropriate for light and dark backgrounds. * org-habit.el (org-habit-duration-to-days): Made this function more general. (org-habit-parse-todo): Parse the new ".+N/N" style repeater. * org-agenda.el (org-agenda-get-deadlines): Removed all mention of habits, since they don't use DEADLINE anymore. * org.el (org-repeat-re, org-display-custom-time) (org-timestamp-change): Extended to support the new ".+N/N" syntax, used for habits. * org-clock.el (org-clock-resolve-clock): Fixed an incorrect variable reference. * org-agenda.el (org-agenda-set-mode-name): Show Habit in the modeline when habits are being displayed (if that module is being loaded). 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org-clock.el (org-x11-idle-seconds): Add a method to get the X11 idle time using the xscreensaver extension. (org-user-idle-seconds): Use X11 idle time if available. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-next-line): New command. (org-agenda-previous-line): New commands. (org-agenda-show-and-scroll-up, org-agenda-show-scroll-down): New commands. (org-agenda-follow-mode): Do the follow immediately if the mode is turned on here. (previous-line, next-line): Replace keys with the corresponding org functions. (org-agenda-mode-map): Bind backspace and delete to the scrolling command. * org.el (org-icompleting-read): Turn off partial completion mode for the duration of this completion round. * org-latex.el (org-export-latex-fontify-headline): Protect TeX macros in author lines and similar stuff. * org.el (org-file-tags): Fix docstring. (org-get-buffer-tags): Add the #+FILETAGS tags. ("ecb"): Maks ecb show context after jumping into an Org file. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-agenda.el (org-finalize-agenda): Draw habit consistency graphs after everything else in the buffer has been setup. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-apply): Count success and failure. * org.el (org-indent-line-function): Fix regexp replace problem. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-clock.el (org-clock-disable-clock-resolution): New customization variable that disable automatic clock resolution on clock in. (org-clock-in): If `org-clock-disable-clock-resolution' is set, do not automatically resolve anything. This is does not affect idle-time resolution, however, if `org-clock-idle-time' is set. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-habit.el: New file, which implements code to build a "habit consistency graph". * org-agenda.el (org-agenda-get-deadlines) (org-agenda-get-scheduled): Display consistency graphs when outputting habits into the agenda. The graphs are always relative to the current time. (org-format-agenda-item): Added new parameter `habitp', which indicates whether we are formatting a habit or not. Do not display "extra" leading information if habitp is true. * org.el (org-repeat-re): Improved regexp to include .+ and ++ leaders for repeat strings. (org-get-repeat): Now takes a string parameter `tagline', so the caller can obtain the SCHEDULED repeat, or the DEADLINE repeat. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-agenda.el (org-agenda-auto-exclude-function): New customization variable for allowing the user to create an "auto exclusion" filter for doing context-aware auto tag filtering. (org-agenda-filter-by-tag): Changes to support the use of `org-agenda-auto-exclude-function'. See the new manual addition,. 2009-11-13 John Wiegley <johnw@newartisans.com> * org.el (org-files-list): Don't attempt to return a file name for Org buffers which have no associated file. * org-agenda.el (org-agenda-do-action): Fixed a typo. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-locate-entry): Interpret files relative to org-directory. (org-mobile-inbox-for-pull): Document the best location for this file. (org-mobile-check-setup): Verify `org-directory'. (org-mobile-create-index-file): Sort the files to be listed in index.org. 2009-11-13 James TD Smith <ahktenzero@mohorovi.cc> * org.el (org-fast-tag-selection): Add a way to display a description for a tag group. This is done by adding a string to either the startgroup or endgroup cell. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-clock.el (org-clock-resolve, org-resolve-clocks) (org-emacs-idle-seconds): Use `org-float-time' instead of `time-to-seconds' 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-sorting-strategy): Fix customization type. * org.el (org-pre-cycle-hook): Document that `empty' can also be the value of ARG when doing local cycling. 2009-11-13 John Wiegley <johnw@newartisans.com> * org-clock.el (org-clock-resolve-clock): If keeping or subtracting time results in a clock out at a time in the past, and if the resolution occurred due to idleness or invoking `M-x org-resolve-clocks', remember that past moment in time. On the next clock in, the user will be prompted to see if they want to back-date their new clock to then. (org-clock-resolve): Do not jump the user to the location of a dangling clock if the resolution is occuring due to an idle timeout. In that case there is typically only one dangling clock, the active one, and there is no value gained by shuffling their windows around to show it to them. Being prompted to resolve an idle clock should be as inobtrusive as possible. (org-resolve-clocks-if-idle): New function that resolves only the currently active clock if the user has exceeded the time returned by `org-user-idle-seconds', based on the value of `org-clock-idle-time'. (org-clock-in): If, after resolving clocks, (org-clock-out): Cancel the `org-clock-idle-timer' on clock out. * org-clock.el (org-clock-resolve-clock): New function that resolves a clock to a specific time, closing or resuming as need be, and possibly even starting a new clock. (org-clock-resolve): New function used by `org-resolve-clocks' that sets up for the call to `org-clock-resolve-clock'. It determines the time to resolve to based on a single-character selection from the user to either keep time, subtract away time or cancel the clock. (org-resolve-clocks): New user command which resolves dangling clocks -- that is, open but not active -- anywhere in the file list returned by `org-files-list'. (org-clock-in): Automatically resolve dangling clocks whenever a user clocks in. (org-clock-cancel): If the user cancels the solely clock in a LOGBOOK, remove the empty drawer. * org-clock.el (org-clock-idle-time): New user customizable option for detecting whether the user has left a clock idle. Note: it is only used in this commit to test whether it's worthwhile to check OS X to get the Mac user's current idle time. If the Emacs idle time is less than the value, the user hasn't been away long enough to be worth checking (a more expensive test than just getting Emacs idle time). (org-user-idle-seconds, org-mac-idle-seconds) (org-emacs-idle-seconds): This three functions, in conjunction with the user customization variable `org-clock-idle-time', return the number of seconds (as a floating point) that the user has been away from their Emacs (or, if running on OS X, their computer). * org-clock.el (org-find-open-clocks): New function that returns a list of all open clocks in the given FILE. Note that each clock it returns is a cons cell of the format (MARKER . START-TIME). This "clock" value is used by several of the new clock module utility functions. (org-is-active-clock): New inline function which tests whether the given clock value is the same as the currently active clock. Returns non-nil if this is the case. (org-with-clock-position): New macro that evaluates FORMS with point in the buffer and at the position of the given clock. Changes to the current clock are global. (org-with-clock): New macro that evaluates FORMS with point in the buffer and at the position of the given clock. However, changes to the current clock are local and have no effect on the user's active clock. This allows, for example, far any clock to be cancelled without cancelling the active clock. (org-clock-clock-in): New inline function that switches the active clock to the given clock. If either the argument RESUME, or the global `org-clock-in-resume', are non-nil, it will resume a clock that was previously left open. (org-clock-clock-out): New inline function that clocks out the given clock value without affecting the currently active clock. (org-clock-clock-cancel): New inline function that cancels the given clock value without affecting the currently active clock. * org-clock.el (org-clock-in): Before creating `org-clock-mode-line-timer', check to make sure an older timer is not currently running. (org-clock-out): Accept new third parameter `at-time', which permits a clock to be clocked out at a specific time. Note that no attempt is made to verify that the clock out time is later than the clock in time. * org.el (org-files-list): New utility function for returning a list of all open org-mode buffers, plus all files used to build the agenda buffer. Note that not all the files will necessarily be visited by a buffer at time of call. (org-entry-beginning-position): Like the function `line-beginning-position', this inline function returns the beginning position of the current heading/entry. (org-entry-end-position): Like the function `line-end-position', this inline function returns the end position of the current heading/entry. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-list): Mark the all-todo items line as a header line. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-inlinetask-remove-END-maybe): Declare function. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-filter-make-matcher): Allow to filter entries that have no tags. (org-agenda-search-view): New customize group. (org-agenda-search-view-search-words-only): New option. (org-search-view): Implement substring search. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-outline-level): Add doc string. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-inlinetask.el (org-inlinetask-export): Re-introduce variable. (org-inlinetask-export-handler): Only export inline task if the user option calls for it. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-handle-export-tags): Remove inlinetask END if present. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-tables): Don't format in protected regions. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-src.el (org-edit-src-code) (org-edit-src-find-region-and-lang, org-edit-src-exit): Handle macro editing. * org-agenda.el (org-prefix-category-max-length): New variable. (org-format-agenda-item): Use `org-prefix-category-max-length'. (org-compile-prefix-format): Set `org-prefix-category-max-length'. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-mobile.el (org-mobile-create-index-file): Improve the listing of tags and todo keywords. * org-latex.el (org-export-latex-format-image): New function. (org-export-latex-links): Use `org-export-latex-format-image'. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org-inlinetask.el (org-inlinetask-get-current-indentation) (org-inlinetask-remove-terminator): New functions. (org-inlinetask-export-handler): Terminate the description list. * org-exp.el (org-export-select-backend-specific-text): Remove the region markers. * org-inlinetask.el (org-inlinetask-export-handler): fix bug for tasks without content. * org-clock.el: Make sure the clock-in target position does not move to a different node by widening the buffer. * org-html.el (org-export-html-format-image): Wrap image into figure div only when there is a caption. * org-archive.el (org-archive-mark-done): Change default value to nil. 2009-11-13 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-context): Call `bobp', not `eobp'. * org-clock.el (org-clock-cancel): Remove quotes from marker variables. * org.el (org-read-date-prefer-future): New allowed value `time'. (org-read-date-analyze): Shift day to tomorrow depending on time entered and value of `org-read-date-prefer-future'.
author Carsten Dominik <dominik@science.uva.nl>
date Fri, 13 Nov 2009 08:37:55 +0000
parents 1382a0cd8022
children 1d1d5d9bd884
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; gametree.el --- manage game analysis trees in Emacs
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
3 ;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
4 ;; 2008, 2009 Free Software Foundation, Inc.
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Author: Ian T Zimmerman <itz@rahul.net>
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Created: Wed Dec 10 07:41:46 PST 1997
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; Keywords: games
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
94675
949bd6ad1ba4 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94675
949bd6ad1ba4 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
949bd6ad1ba4 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
15 ;; (at your option) any later version.
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94675
949bd6ad1ba4 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;; This little hack has enabled me to keep track of my email chess
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; games in Emacs. For a long time I dreamt about writing a real,
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; graphical tree editor; but, then the idea struck me, why do it
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; graphically, when it can be done in Emacs? :-) And in fact Emacs
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; almost had what I needed out of the box, namely the powerful
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; Outline mode. This code is built entirely on Outline mode, it
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; only adds two commands that I found indispensable when dealing
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; with the special kind of trees that analysis trees comprise.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; The built-in documentation should be enough to explain the use,
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;; along with the following example (yes, this is a real game).
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 ;; *** 23. f4 ef 24. Nf3 Rf3 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 ;; 25. Rf3 Qh2 26. Kh1 Qh1 27. Ke2 Qg2 -+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 ;; ******* 25. gf3 Nce3 26. Qe2 Nf1 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 ;; 27. Qe5 Ne5 28. Kf1 Nf3 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;; 27. Kf1 Nh2 28. Kf2 Ng4 29. fg4 Rf8 30. Ke1 Qg3 31. Kd1 Rf2 -+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 ;; Place the preceding in a scratch buffer, load this code, and do
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 ;; M-x gametree-mode. Now place the cursor just after the `Nf3' and
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 ;; before the `Rf3' on the first line, and do C-c C-j. The result is
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;; *** 23. f4 ef 24. Nf3
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 ;; ****** 24: Rf3 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 ;; 25. Rf3 Qh2 26. Kh1 Qh1 27. Ke2 Qg2 -+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; ******* 25. gf3 Nce3 26. Qe2 Nf1 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 ;; 27. Qe5 Ne5 28. Kf1 Nf3 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; 27. Kf1 Nh2 28. Kf2 Ng4 29. fg4 Rf8 30. Ke1 Qg3 31. Kd1 Rf2 -+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; Now you can add another subvariation on Black's 24th move: with
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 ;; the cursor still on the first line, do C-c C-v, and voila
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 ;; *** 23. f4 ef 24. Nf3
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ;; 24:
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 ;; ****** 24: Rf3 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ;; 25. Rf3 Qh2 26. Kh1 Qh1 27. Ke2 Qg2 -+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 ;; ******* 25. gf3 Nce3 26. Qe2 Nf1 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 ;; 27. Qe5 Ne5 28. Kf1 Nf3 -/+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; 27. Kf1 Nh2 28. Kf2 Ng4 29. fg4 Rf8 30. Ke1 Qg3 31. Kd1 Rf2 -+
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 ;; and the cursor is positioned on the new line just after the move
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;; number, so you can start typing the new analysis. That's it,
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
69 ;; quite simple.
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
71 ;; As of version 1.1, a simple score reducer has been implemented.
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
72 ;; As you type in leaf variations, you can add a numerical score tag
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
73 ;; to them with C-c ; . Then, with the cursor on a variation higher
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
74 ;; up in the tree, you can do C-c ^ and the program will compute the
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
75 ;; reduced score of the internal variation based on the scores of its
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
76 ;; children (which are recursively computed). You can use any range
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
77 ;; of numbers you wish as scores, maybe -1000 to 1000 or 0 to 100,
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
78 ;; all that matters to the program is that higher means better for
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
79 ;; White, lower means better for Black.
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 ;;; Code:
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 (require 'derived)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 (require 'outline)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 ;;;; Configuration variables
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
88 (defgroup gametree nil
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
89 "Manage game analysis trees in Emacs."
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
90 :prefix "gametree-"
21651
86fcccceba7b *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21363
diff changeset
91 :group 'games
86fcccceba7b *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21363
diff changeset
92 :version "20.3")
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
93
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
94 (defcustom gametree-half-ply-regexp (regexp-quote ":")
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
95 "Matches ends of numbers of moves by the \"second\" player.
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 For instance, it is an almost universal convention in chess to postfix
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 numbers of moves by Black (if considered in isolation) by the ellipsis
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 \"...\". This is NOT a good choice for this program, though, because it
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 conflicts with the use of ellipsis by Outline mode to denote collapsed
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 subtrees. The author uses \":\" because it agrees nicely with a set of
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
101 LaTeX macros he uses for typesetting annotated games."
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
102 :type 'regexp
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
103 :group 'gametree)
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
105 (defcustom gametree-full-ply-regexp (regexp-quote ".")
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
106 "Matches ends of numbers of moves by the \"first\" player.
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 For instance, it is an almost universal convention in chess to postfix
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
108 numbers of moves by White (if considered in isolation) by the dot \".\"."
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
109 :type 'regexp
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
110 :group 'gametree)
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
112 (defcustom gametree-half-ply-format "%d:"
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
113 "Output format for move numbers of moves by the \"second\" player.
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
114 Has to contain \"%d\" to output the actual number."
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
115 :type 'string
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
116 :group 'gametree)
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
117
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
118 (defcustom gametree-full-ply-format "%d."
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
119 "Output format for move numbers of moves by the \"first\" player.
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
120 Has to contain \"%d\" to output the actual number."
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
121 :type 'string
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
122 :group 'gametree)
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
124 (defcustom gametree-make-heading-function
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 (function (lambda (level)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 (insert (make-string level ?*))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 "A function of one numeric argument, LEVEL, to insert a heading at point.
21363
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
128 You should change this if you change `outline-regexp'."
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
129 :type 'function
f1fc193b6958 Customized.
Stephen Eglen <stephen@gnu.org>
parents: 20782
diff changeset
130 :group 'gametree)
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 (defvar gametree-local-layout nil
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 "A list encoding the layout (i.e. the show or hide state) of the file.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 If Emacs notices a local variable specification of this variable in
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 the first line of the buffer while saving the buffer to the visited
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 file, the local value will be saved there and restored the next time
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 the file is visited (subject to the usual restriction via
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 `enable-local-variables'), and the layout will be set accordingly.")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
140 (defcustom gametree-score-opener "{score="
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
141 "The string which opens a score tag, and precedes the actual score."
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
142 :type 'string
24227
b7d8faf8cca0 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 24226
diff changeset
143 :group 'gametree)
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
144
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
145 (defcustom gametree-score-manual-flag "!"
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
146 "String marking the line as manually (as opposed to automatically) scored."
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
147 :type 'string
24227
b7d8faf8cca0 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 24226
diff changeset
148 :group 'gametree)
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
149
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
150 (defcustom gametree-score-closer "}"
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
151 "The string which closes a score tag, and follows the actual score."
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
152 :type 'string
24227
b7d8faf8cca0 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 24226
diff changeset
153 :group 'gametree)
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
154
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
155 (defcustom gametree-score-regexp
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
156 (concat "[^\n\^M]*\\("
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
157 (regexp-quote gametree-score-opener)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
158 "[ ]*\\("
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
159 (regexp-quote gametree-score-manual-flag)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
160 "[ ]*\\)?\\([-+]?[0-9]+\\)"
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
161 (regexp-quote gametree-score-closer)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
162 "[ ]*\\)[\n\^M]")
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
163 "Regular expression matching lines that guide the program in scoring.
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
164 Its third parenthetical group should match the actual score. Its
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
165 first parenthetical group should match the entire score tag. Its
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
166 second parenthetical group should be an optional flag that marks the
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
167 line as *manually* (as opposed to automatically) scored, which
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
168 prevents the program from recursively applying the scoring algorithm
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
169 on the subtree headed by the marked line, and makes it use the manual
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
170 score instead."
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
171 :type 'regexp
24227
b7d8faf8cca0 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 24226
diff changeset
172 :group 'gametree)
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
173
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
174 (defcustom gametree-default-score 0
104848
1382a0cd8022 Remove leading * from defcustom and defface docs.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
175 "Score to assume for branches lacking score tags."
24226
8328255eab2a (gametree-default-score): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24225
diff changeset
176 :type 'integer
24227
b7d8faf8cca0 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 24226
diff changeset
177 :group 'gametree)
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
178
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 ;;;; Helper functions
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 (defun gametree-prettify-heading ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 "Insert/delete space between leading asterisks and heading text.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 If the current variation is an internal node (i.e. starts with one or
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 more asterisks), ensure there's at least one space between the
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 asterisks and the text. If on the other hand this is a leaf, there
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 should be no leading white space."
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 (beginning-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 (if (re-search-forward (concat "\\=" outline-regexp) nil t)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 (if (not (looking-at "[ \t]+")) (insert " "))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (delete-char (save-excursion (skip-chars-forward " \t"))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 (if (re-search-forward (concat "\\=[ \t]*[1-9][0-9]*\\("
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 gametree-full-ply-regexp "\\|"
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 gametree-half-ply-regexp "\\)") nil t)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 (if (not (looking-at "[ \t]+")) (insert " ")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 (delete-char (1- (save-excursion (skip-chars-forward " \t"))))))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 (defun gametree-looking-at-ply ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 "Read and return the number of the ply under point."
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 (if (eobp) 0
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
201 (let ((boundary (concat "[ \t]*\\([1-9][0-9]*\\)\\("
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 gametree-full-ply-regexp "\\|"
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 gametree-half-ply-regexp "\\)"))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 (limit (save-excursion (beginning-of-line 1) (point))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 (if (looking-at boundary)
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62249
diff changeset
206 (+ (* 2 (string-to-number (match-string 1)))
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 (if (string-match gametree-half-ply-regexp (match-string 2)) 1 0))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
208 (save-excursion
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 (re-search-backward boundary limit)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 (skip-chars-backward "0123456789")
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62249
diff changeset
211 (1+ (* 2 (string-to-number
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 (buffer-substring (point) (match-end 1))))))))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
213
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 (defun gametree-current-branch-ply ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 "Return the ply number of the first move of the current variation."
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 (beginning-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 (re-search-forward (concat "\\=" outline-regexp) nil t)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 (gametree-looking-at-ply)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
221 (defsubst gametree-forward-line ()
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
222 (re-search-forward "[\n\^M]" nil 'move))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
223
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 (defun gametree-current-branch-depth ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 "Return the depth of the current variation in the analysis tree.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 This value is simply the outline heading level of the current line."
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 (beginning-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 (if (looking-at outline-regexp)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 (outline-level) 0)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
232 (defun gametree-transpose-following-leaves ()
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
233 "Move the current leaf variation behind all others on the same level."
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
234 (let ((following-leaves
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
235 (save-excursion
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
236 (gametree-forward-line)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
237 (let ((p (point)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
238 (while (and (not (eobp))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
239 (= 0 (gametree-current-branch-depth)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
240 (gametree-forward-line))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
241 (prog1 (buffer-substring p (point))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
242 (delete-region p (point)))))))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
243 (save-excursion
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
244 (beginning-of-line 1)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
245 (insert following-leaves))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
246
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
247
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 ;;;; Functions related to the task of saving and restoring current
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 ;;;; outline layout
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
251 (defsubst gametree-show-children-and-entry ()
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 (show-children)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 (show-entry))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 (defun gametree-entry-shown-p ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 (forward-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 (and (bolp) (not (eobp)) (not (looking-at outline-regexp)))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 (defun gametree-children-shown-p ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 (condition-case nil
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 (let ((depth (gametree-current-branch-depth)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 (outline-next-visible-heading 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 (< depth (gametree-current-branch-depth)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 (error nil))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 (defun gametree-current-layout (depth &optional top-level)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 (let ((layout nil) (first-time t))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 (while (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 (condition-case nil
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 (progn
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 (or (and first-time top-level
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 (bolp) (looking-at outline-regexp))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 (setq first-time nil)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 (outline-next-visible-heading 1))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 (< depth (gametree-current-branch-depth)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 (error nil)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 (if (not first-time)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 (outline-next-visible-heading 1))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 (setq first-time nil)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 (if (not (gametree-children-shown-p))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 (setq layout
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 (nconc layout
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 (if (gametree-entry-shown-p)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 (list 'show-entry)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 (list nil))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 (setq layout (nconc layout (if (gametree-entry-shown-p)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 (list 'gametree-show-children-and-entry)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 (list 'show-children))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 (let ((sub-layout
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 (gametree-current-layout (gametree-current-branch-depth))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 (setq layout (nconc layout (list sub-layout))))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 layout))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 (defun gametree-save-layout ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298 (goto-char (point-min))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 (setq gametree-local-layout (gametree-current-layout 0 t))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 (defun gametree-apply-layout (layout depth &optional top-level)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 (let ((first-time t))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 (while (and layout
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 (condition-case nil
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 (progn
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 (or (and first-time top-level
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 (bolp) (looking-at outline-regexp))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 (setq first-time nil)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 (outline-next-visible-heading 1))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 (< depth (gametree-current-branch-depth)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 (error nil))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 (if (not first-time)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 (outline-next-visible-heading 1))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 (setq first-time nil)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 (hide-subtree)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 (if (nth 0 layout)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 (funcall (nth 0 layout)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319 (if (not (and (nth 1 layout) (listp (nth 1 layout))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 (setq layout (cdr layout))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 (gametree-apply-layout (nth 1 layout)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 (gametree-current-branch-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 (setq layout (cdr (cdr layout)))))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 (defun gametree-restore-layout ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 (goto-char (point-min))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 (gametree-apply-layout gametree-local-layout 0 t)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 (defun gametree-hack-file-layout ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 (goto-char (point-min))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 (if (looking-at "[^\n]*-\*-[^\n]*gametree-local-layout: \\([^;\n]*\\);")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 (progn
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 (goto-char (match-beginning 1))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 (delete-region (point) (match-end 1))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 (let ((standard-output (current-buffer)))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
338 (princ gametree-local-layout))))))
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
340
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
341 ;;;; Scoring functions
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
342
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
343 (defun gametree-current-branch-score ()
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
344 "Return score of current variation according to its score tag.
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
345 When no score tag is present, use the value of `gametree-default-score'."
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
346 (if (looking-at gametree-score-regexp)
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 62249
diff changeset
347 (string-to-number (match-string 3))
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
348 gametree-default-score))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
349
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
350 (defun gametree-compute-reduced-score ()
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
351 "Return current internal node score computed recursively from subnodes.
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
352 Subnodes which have been manually scored are honored."
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
353 (if (or
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
354 (= 0 (gametree-current-branch-depth))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
355 (save-excursion (gametree-forward-line) (eobp))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
356 (and (looking-at gametree-score-regexp)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
357 (not (null (match-string 2)))))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
358 (gametree-current-branch-score)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
359 (let ((depth (gametree-current-branch-depth)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
360 (save-excursion
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
361 (gametree-forward-line)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
362 ;; the case of a leaf node has already been handled, so here I
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
363 ;; know I am on the 1st line of the current subtree. This can
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
364 ;; be either a leaf child, or a subheading.
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
365 (let ((running gametree-default-score)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
366 (minmax
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
367 (if (= 0 (mod (gametree-current-branch-ply) 2))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
368 'max 'min)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
369 (while (and (not (eobp))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
370 (= 0 (gametree-current-branch-depth))) ;handle leaves
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
371 (setq running (funcall minmax running
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
372 (gametree-current-branch-score)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
373 (gametree-forward-line))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
374 (let ((done (and (not (eobp))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
375 (< depth (gametree-current-branch-depth)))))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
376 (while (not done) ;handle subheadings
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
377 (setq running (funcall minmax running
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
378 (gametree-compute-reduced-score)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
379 (setq done (condition-case nil
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
380 (outline-forward-same-level 1)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
381 (error nil)))))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
382 running)))))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
383
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 ;;;; Commands
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 (defun gametree-insert-new-leaf (&optional at-depth)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 "Start a new leaf variation under the current branching point.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 The new variation can later be split to be a branching point itself,
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 with \\[gametree-break-line-here]. If the point is currently on a
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 leaf variation, this command won't work; use \\[gametree-break-line-here]
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 on the current line first.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 With a numeric arg AT-DEPTH, first go up the tree until a node of
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 depth AT-DEPTH or smaller is found."
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
395 (interactive "*P")
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 (if (zerop (gametree-current-branch-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397 (outline-up-heading 0))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 (if at-depth
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399 (while (> (gametree-current-branch-depth)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400 (prefix-numeric-value at-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 (outline-up-heading 1)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 (beginning-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 (let ((parent-depth (gametree-current-branch-depth)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 (show-entry)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 (condition-case nil
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406 (outline-next-visible-heading 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407 (error
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 (goto-char (point-max))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
409 (if (not (bolp)) (insert "\n"))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
410 (let ((starting-plys
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
411 (if (> (gametree-current-branch-depth) parent-depth)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412 (gametree-current-branch-ply)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 (save-excursion (forward-line -1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 (gametree-current-branch-ply)))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 (goto-char (1- (point)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416 (insert "\n")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417 (insert (format (if (= 0 (mod starting-plys 2))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 gametree-full-ply-format
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 gametree-half-ply-format)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 (/ starting-plys 2))))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 (defun gametree-break-line-here (&optional at-move)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 "Split the variation node at the point position.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424 This command works whether the current variation node is a leaf, or is
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 already branching at its end. The new node is created at a level that
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426 reflects the number of game plys between the beginning of the current
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 variation and the breaking point.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 With a numerical argument AT-MOVE, split the variation before
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 White's AT-MOVEth move, or Black's if negative. The last option will
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
431 only work of Black's moves are explicitly numbered, for instance
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432 `1. e4 1: e5'."
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
433 (interactive "*P")
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 (if at-move (progn
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 (end-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436 (let ((limit (point)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437 (beginning-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 (re-search-forward
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 (concat
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 (regexp-quote
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 (int-to-string (abs (prefix-numeric-value at-move))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 (if (> at-move 0) gametree-full-ply-regexp
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 gametree-half-ply-regexp)) limit))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 (goto-char (match-beginning 0))))
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
445 (gametree-transpose-following-leaves)
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 (let* ((pt (set-marker (make-marker) (point)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 (plys (gametree-current-branch-ply))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 (depth (gametree-current-branch-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 (old-depth depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 (if (= depth 0)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 (progn
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 (outline-previous-visible-heading 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (setq depth
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 (let ((old-branch-ply
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 (condition-case nil
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 (gametree-current-branch-ply)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 (error 0))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 (if (zerop old-branch-ply)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 (1+ (gametree-current-branch-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 (+ (gametree-current-branch-depth)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 (- plys old-branch-ply))))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 (beginning-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 (funcall gametree-make-heading-function depth)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
466 (gametree-prettify-heading))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 (save-excursion
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
468 (if (not (looking-at (concat "[ \t]*[1-9][0-9]*\\("
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
469 gametree-full-ply-regexp "\\|"
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
470 gametree-half-ply-regexp "\\)")))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471 (progn
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 (insert (format (if (= 0 (mod (gametree-looking-at-ply) 2))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 gametree-full-ply-format
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 gametree-half-ply-format)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475 (/ (gametree-looking-at-ply) 2)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476 (gametree-prettify-heading)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 (beginning-of-line 1)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 (goto-char pt)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 (insert "\n")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 (if (not (= 0 old-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481 (funcall gametree-make-heading-function
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482 (+ depth (- (gametree-current-branch-ply) plys))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 (gametree-prettify-heading))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485 (defun gametree-merge-line ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 "Merges a variation with its only child.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 Does *not* check if the variation has in fact a unique child; users beware."
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
488 (interactive "*")
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 (if (zerop (gametree-current-branch-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 (outline-up-heading 0))
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
491 (if (looking-at gametree-score-regexp)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
492 (delete-region (match-beginning 1) (match-end 1)))
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 (end-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 (let ((prev-depth (save-excursion (forward-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495 (gametree-current-branch-depth))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496 (delete-char (1+ prev-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497 (if (zerop prev-depth)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
498 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
499 (beginning-of-line 1)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
500 (delete-char (gametree-current-branch-depth))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
501 (gametree-prettify-heading)))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
502
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
503 (defun gametree-insert-score (score &optional auto)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
504 "Insert a score tag with value SCORE at the end of the current line.
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
505 If this line already has a score tag, just jump to it and alter it.
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
506 When called from a program, optional AUTO flag tells if the score is
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
507 being entered automatically (and thus should lack the manual mark)."
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
508 (interactive "*P")
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
509 (beginning-of-line 1)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
510 (if (looking-at gametree-score-regexp)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
511 (progn
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
512 (goto-char (match-beginning 3))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
513 (if (and auto (not (null (match-string 2))))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
514 (delete-region (match-beginning 2) (match-end 2)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
515 (if (not (null score))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
516 (delete-region (match-beginning 3) (match-end 3)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
517 (if (and (not auto) (null (match-string 2)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
518 (insert gametree-score-manual-flag)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
519 (end-of-line 1)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
520 (if (= 0 (save-excursion (skip-chars-backward " \t")))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
521 (insert " "))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
522 (insert gametree-score-opener)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
523 (if (not auto) (insert gametree-score-manual-flag))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
524 (save-excursion (insert gametree-score-closer)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
525 (if (not (null score))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
526 (save-excursion
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
527 (insert (int-to-string (prefix-numeric-value score))))))
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
528
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
529 (defun gametree-compute-and-insert-score ()
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
530 "Compute current node score, maybe recursively from subnodes. Insert it.
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
531 Subnodes which have been manually scored are honored."
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
532 (interactive "*")
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
533 (let ((auto (not (and (looking-at gametree-score-regexp)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
534 (not (null (match-string 2))))))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
535 (score (gametree-compute-reduced-score)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
536 (gametree-insert-score score auto)))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
537
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
538
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 (defun gametree-layout-to-register (register)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540 "Store current tree layout in register REGISTER.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
541 Use \\[gametree-apply-register-layout] to restore that configuration.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542 Argument is a character, naming the register."
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 (interactive "cLayout to register: ")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
544 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
545 (goto-char (point-min))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 (set-register register
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547 (gametree-current-layout 0 t))))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 (defun gametree-apply-register-layout (char)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 "Return to a tree layout stored in a register.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
551 Argument is a character, naming the register."
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
552 (interactive "*cApply layout from register: ")
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
553 (save-excursion
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
554 (goto-char (point-min))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555 (gametree-apply-layout (get-register char) 0 t)))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
556
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
557 (defun gametree-save-and-hack-layout ()
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
558 "Save the current tree layout and hack the file local variable spec.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 This function saves the current layout in `gametree-local-layout' and,
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560 if a local file varible specification for this variable exists in the
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
561 buffer, it is replaced by the new value. See the documentation for
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
562 `gametree-local-layout' for more information."
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563 (interactive)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 (gametree-save-layout)
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
565 (let ((inhibit-read-only t))
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
566 (gametree-hack-file-layout))
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567 nil)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 (define-derived-mode gametree-mode outline-mode "GameTree"
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 24227
diff changeset
570 "Major mode for managing game analysis trees.
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 Useful to postal and email chess (and, it is hoped, also checkers, go,
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572 shogi, etc.) players, it is a slightly modified version of Outline mode.
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574 \\{gametree-mode-map}"
64804
ebcfe1ffa0ec (gametree-mode): Use make-local-variable, not make-variable-buffer-local.
Richard M. Stallman <rms@gnu.org>
parents: 64701
diff changeset
575 (auto-fill-mode 0)
ebcfe1ffa0ec (gametree-mode): Use make-local-variable, not make-variable-buffer-local.
Richard M. Stallman <rms@gnu.org>
parents: 64701
diff changeset
576 (make-local-variable 'write-contents-hooks)
ebcfe1ffa0ec (gametree-mode): Use make-local-variable, not make-variable-buffer-local.
Richard M. Stallman <rms@gnu.org>
parents: 64701
diff changeset
577 (add-hook 'write-contents-hooks 'gametree-save-and-hack-layout))
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 ;;;; Key bindings
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
580
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581 (define-key gametree-mode-map "\C-c\C-j" 'gametree-break-line-here)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582 (define-key gametree-mode-map "\C-c\C-v" 'gametree-insert-new-leaf)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 (define-key gametree-mode-map "\C-c\C-m" 'gametree-merge-line)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584 (define-key gametree-mode-map "\C-c\C-r " 'gametree-layout-to-register)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
585 (define-key gametree-mode-map "\C-c\C-r/" 'gametree-layout-to-register)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 (define-key gametree-mode-map "\C-c\C-rj" 'gametree-apply-register-layout)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 (define-key gametree-mode-map "\C-c\C-y" 'gametree-save-and-hack-layout)
24225
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
588 (define-key gametree-mode-map "\C-c;" 'gametree-insert-score)
985eb547550f Document scoring functionality.
Richard M. Stallman <rms@gnu.org>
parents: 21651
diff changeset
589 (define-key gametree-mode-map "\C-c^" 'gametree-compute-and-insert-score)
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591 ;;;; Goodies for mousing users
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592 (and (fboundp 'track-mouse)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
593 (defun gametree-mouse-break-line-here (event)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594 (interactive "e")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
595 (mouse-set-point event)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
596 (gametree-break-line-here))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
597 (defun gametree-mouse-show-children-and-entry (event)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
598 (interactive "e")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
599 (mouse-set-point event)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
600 (gametree-show-children-and-entry))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
601 (defun gametree-mouse-show-subtree (event)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
602 (interactive "e")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
603 (mouse-set-point event)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604 (show-subtree))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605 (defun gametree-mouse-hide-subtree (event)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
606 (interactive "e")
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
607 (mouse-set-point event)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 (hide-subtree))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
609 (define-key gametree-mode-map [M-down-mouse-2 M-mouse-2]
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610 'gametree-mouse-break-line-here)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
611 (define-key gametree-mode-map [S-down-mouse-1 S-mouse-1]
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612 'gametree-mouse-show-children-and-entry)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 (define-key gametree-mode-map [S-down-mouse-2 S-mouse-2]
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
614 'gametree-mouse-show-subtree)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
615 (define-key gametree-mode-map [S-down-mouse-3 S-mouse-3]
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 'gametree-mouse-hide-subtree))
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 (provide 'gametree)
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
619
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 79716
diff changeset
620 ;; arch-tag: aaa30943-9ae4-4cc1-813d-a46f96b7e4f1
20782
8a36e43748c0 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
621 ;;; gametree.el ends here