[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ttn-pers-elisp 1.46 available
ttn-pers-elisp 1.46 available
Wed, 08 Sep 2004 15:24:48 +0200
lots of gnugo-related munging this time around, amidst the dross.
now if i can only connect to the internet to find the sgf spec and
add some pages to emacswiki re gnugo in emacs...
This directory tree contains ttn's personal elisp library, released
under GNU GPL with ABSOLUTELY NO WARRANTY. See the file COPYING for
- 1.46 | 2004-08-30
- New command: ppq
(defun ppq (&optional kill)
- Variable `diff-switches' no longer sets "-c" (context-diff format)
Some version-control variables for showing file and/or version
differences initialize their value based on this variable, but
they often get confused. Easier to leave this one unspecified
and introduce specialization at the leaves.
- The comint buffer for `M-x psql' now starts w/ `truncate-lines' t
- New keybindings
- In the minibuffer `M-m' acts the same as `RET'
This fits in w/ the global binding of `M-m' to `compile'.
Thus, a double `M-m' for the Truly Lazy...
Also works out nicely for M-x M-p ... M-m, and so forth.
- In a manpage, `RET' runs the command `Man-follow-manual-reference'
- Changes to gnugo.el
- Bugfix: board size less than 11 handled correctly
For the GTP command "showboard", some versions of GNU Go display
the board flush left when the board size is less than 11 (i.e.,
for sizes 5, 7 and 9). To compensate, gnugo.el used to look at
the board size, however, this method failed to handle other
versions of GNU Go that display the board at a fixed offset from
the margin, regardless of board size. Now gnugo.el looks at the
displayed output directly, to accomodate either GNU Go behavior.
- Bugfix: subprocess handling regularized
The "gnugo" subprocess is now properly associated w/ the GNUGO
Board buffer; killing the buffer now deletes the subprocess.
Previously, the subprocess would be orphaned, leading to errors
upon subsequent `M-x gnugo' invocations.
Also, if the subprocess should die in the middle of a game, the
mode line displays "no process".
- Bugfix: Displaying w/ images better integrated
Previous support for displaying the board using XPM images was
incomplete, resulting in several bugs that have now been fixed:
- a stone can be placed in the top row
- commands `gnugo-worm-stones' and `gnugo-dragon-stones' work
(however, the animation uses `gnugo-animation-string' only for
its length, not its contents)
- dead groups (at game end) are displayed w/ XPMs generated on
the fly -- see `gnugo-showboard' source for rationalization
- (performance) aside from dead groups XPM generation, display
machinery aggressively avoids expensive recomputation
On the down side, the display machinery now uses text properties
and overlays (for both text and image display); these facilities
are only available in newer versions of GNU Emacs. Also, there
may be mouse-related bugs; the development computer does not have
a mouse for testing (patches welcome).
- Buffer name reflects game state
The buffer (in GNUGO Board mode) is now renamed each time the
state of the game changes to have the form "LAST-MOVE NEXT",
where NEXT is either "(black to play)", "(white to play)", or
"(game over)". This makes it easier to check if it is your turn
to play, if the board buffer is not visible, in a list of buffer
names (such as displayed by `list-buffers' or variant).
- Hint in "Not your turn" error message
If you mistakenly try to place a stone while it is not your
turn, the error message now tells you what buffer name to wait
for (thus also displaying the color you are playing as).
- `q' no longer asks for confirmation when game is already over
- New command: `=' displays board position under point (if valid)
- New variable: gnugo-mode-line
- `C-l' now refreshes the display even if the subprocess is busy
- Display less cluttered
The top and bottom letters, and left and right numbers,
are now hidden. Information on captures is now available
through `gnugo-mode-line'. Information on last move and
who is currently to play is in the buffer name. At game
end, key hints are no longer displayed (you can use `?' or
equivalently `C-h m' to find out about GNUGO Board mode
and its keybindings).
Lastly, the board is centered in the window. Centering
position is recomputed for each refresh, so window resizing
is generally tracked within a move or two. (While it is your
turn to play, you can also use `C-l' to refresh manually.)
- New command: `h' displays move count and history in echo area
- New variable: gnugo-board-mode-hook
Here is an example usage:
This example presumes you have successfully loaded
gnugo-xpms.el or some other library w/ congruent interface.
See lisp/diversions/gnugo-extra.el for usage examples.
- New command: `s' saves move history as SGF file
- New command: `F' displays final score plus other info
- Multiple independent buffers/games now supported
For the second and subsequent games, the buffer name includes
<N> and `M-x gnugo' additionally queries which game you wish
to resume. A response of `n' no longer deletes the current
game; instead, a new game is started. You can either use
this resume feature of `M-x gnugo', or simply switch to the
buffer of a game already in progress. For more sophisticated
buffer management, two predicates are provided, each taking
an optional argument, a buffer:
They return non-nil when the buffer is a GNUGO Board buffer,
and furthermore, is not waiting for the subprocess to play,
respectively. See lisp/diversions/gnugo-extra.el for usage
`C-u M-x gnugo' (invocation w/ prefix arg) now starts a new
game straight away, skipping the game-in-progress check and
- New variable: gnugo-post-move-hook
See lisp/diversions/gnugo-extra.el for usage examples.
- New major mode: GNUGO Pattern Database mode
This sounds more impressive than it really is. You can try it
out by loading lisp/diversions/gnugo-db.el, visiting a GNUGO
Pattern Database file (for example, patterns/conn.db in the GNU
Go distribution), and typing `M-x gnugo-db-mode'.
- Changes to hideshow.el
- New variable: hs-set-up-overlay
The oft-requested feature for end-of-line customization is now
possible through this (more general) mechanism. Light testing
in Emacs 126.96.36.199 shows that setting an overlay's `display'
property to the empty string hides the rest of the buffer from
view entirely. Wow!
Since the function specified by `hs-set-up-overlay' is passed
the overlay, itself, you can do other weird and funky things w/
it besides simply munging the appearance. You could save it,
you could clone it, you could even relocate it, thus confounding
hideshow for hours of fun... that's the danger and/or beauty w/
Emacs. One thing you cannot do is restrict distribution of this
source code; that type of overlay operation is not supported.
- New command: hs-EXPERIMENTAL-show-block
As you may have guessed from the name, this is an experimental
variant of `hs-show-block'. It differs from `hs-show-block' in
that it only shows (unhides) a block if it finds the right kind
of overlay at the end of the line where the command was invoked.
This means that hidden sub-blocks occuring on subsequent lines
remain hidden, whereas for `hs-show-block' all sub-blocks are
This empiricism is part of the process of mulling over what
changes are required for two pending design upgrades: "proper"
nesting support, and first-class comments support. It could be
that these are independent or it could be that they benefit from
similar infrastructure -- that's what we're trying to figure out
before going in and breaking everything. Feedback welcome.
There are many ways to try this command. Here is one way:
(unless (fboundp 'hs-GOOD-OLD-show-block)
(fset 'hs-GOOD-OLD-show-block 'hs-show-block))
(fset 'hs-show-block 'hs-EXPERIMENTAL-show-block)
- New funcs: `circle-quadrant' and `circle-placed'
See commentary in file lisp/diversions/artist-subpixel.el.
- New library: xpmfulm
The file lisp/editing/xpm-fulmination.el provides the funcs:
(xpmfulm-buffer name width height colors) => buffer
(xpmfulm-add-color buf color)
(xpmfulm-point buf x y color)
(xpmfulm-raster buf form edge &optional fill)
(xpmfulm-as-xpm buf &rest props) => xpm image
Here in an example (see `circle-placed' above):
(defun ttn-test-1 (r &optional fill)
(let ((buf (xpmfulm-buffer "example" 48 48
'((32 . "#000000")
(42 . "#ffffff"))))
(dolist (x (number-sequence 13.5 33.5 5))
(xpmfulm-raster buf (circle-placed r x x)
42 (and fill (setq flip (not flip)))))
(insert-image (xpmfulm-as-xpm buf :ascent 'center))))
(defun ttn-test ()
(dolist (r (number-sequence 0 11))
(ttn-test-1 r t)
(insert (format "%d\n" r))
- New command: query-release
- Commands updated: `scroll-left-20' and `scroll-right-20'
These commands now handle automatic hscrolling support
in newer versions of Emacs by temporarily disabling that
- Command generalized: source-wrap
Along with this change, the following commands have been dropped
(since `source-wrap' now examines the major mode for itself):
See also new variable `source-wrap-styles'.
- New func: ttn-cvs-cancel-version
For some reason Emacs says that it does not support `C-x v c' w/
files under CVS. Perhaps there are strange security issues
lurking that the like-named func in ttn-cvs-cancel-version.el
does not handle well, but it seems to work ok w/ light testing.
Loading this file also sets the alias `vc-cvs-cancel-version'.
- Command renamed: print-buffer-local-variables
The new name is `describe-buffer-local-variables'.
Commands with "print" in them are easy to confuse with
the act of making (or preparing) hardcopy output.
- New variable: fulminated-gnugo-xpm-styles
- New function: fulminate-gnugo-xpms
(mapcar 'car fulminated-gnugo-xpm-styles)
=> (d-bump ttn)
(length (setq gnugo-xpms (fulminate-gnugo-xpms 'd-bump)))
tarball in dir:
|[Prev in Thread]
||[Next in Thread]|
- ttn-pers-elisp 1.46 available,
Thien-Thi Nguyen <=