Function: gametree-prettify-heading
gametree-prettify-heading is a byte-compiled function defined in
gametree.el.gz.
Signature
(gametree-prettify-heading)
Documentation
Insert/delete space between leading asterisks and heading text.
If the current variation is an internal node (i.e. starts with one or more asterisks), ensure there's at least one space between the asterisks and the text. If on the other hand this is a leaf, there should be no leading white space.
Source Code
;; Defined in /usr/src/emacs/lisp/play/gametree.el.gz
;;;; Helper functions
(defun gametree-prettify-heading ()
"Insert/delete space between leading asterisks and heading text.
If the current variation is an internal node (i.e. starts with one or
more asterisks), ensure there's at least one space between the
asterisks and the text. If on the other hand this is a leaf, there
should be no leading white space."
(save-excursion
(beginning-of-line 1)
(if (re-search-forward (concat "\\=" outline-regexp) nil t)
(if (not (looking-at "[ \t]+")) (insert " "))
(delete-char (save-excursion (skip-chars-forward " \t"))))
(if (re-search-forward (concat "\\=[ \t]*[1-9][0-9]*\\("
gametree-full-ply-regexp "\\|"
gametree-half-ply-regexp "\\)") nil t)
(if (not (looking-at "[ \t]+")) (insert " ")
(delete-char (1- (save-excursion (skip-chars-forward " \t"))))))))