Revert "xyzzy.src : modify tags-setup-buffer."

This reverts commit b15ef2a9d2f2415bc762a8d22eaaeabc1979b5f2.

When doing tag-jump, XTAGS file in current directory is checked first.
If it contains line like following:

    #USE ../../

other XTAGS file in upper directory specified by "../../" will be used
instead. Function `tags-setup-buffer` is responsible for following
"#USE .." line.

In the reverted commit, search pattern for "#USE .." line is changed
from this:

    "#USE \\(\\(../\\)+\\)$"

to this:

    "#USE \\(\\(../\\)+[^/]*\\)$"

I think the change is intended to allow specify directory other than
straight above, like following:

    #USE ../other-dir

but added part "[^/]*" matches newline character (and following lines
if there is), which prodeces inappropriate string for directory name
and it fail to find XTAGS file, as reported by >>828 at [xyzzy part17].

  [xyzzy part17]: http://toro.2ch.net/test/read.cgi/win/1303662374/
add unittest for tag-jump w/upper directory fix
Merge pull request #30 from bowbow99/fix-tag-jump-with-XTAGS-in-upper-dir

Fix tag-jump fail to find XTAGS file in upper directory
FIX:Issue#24 (Sometimes, $XYZZY/xyzzy.ini is not loaded even it exist)

It caused by the function - environ.cc:environ::save_geometry().
This function will write to $XYZZY/xyzzy.ini during new xyzzy.exe is launching.
So, new xyzzy.exe's init.cc:FileExists() is failed to check existence of $XYZZY/xyzzy.ini.

This patch is fix these bad behavior.

Implementations
===============

 * New Lisp function 'prepare-for-kill-xyzzy' is created.
   * This function calls environ::save_geometry()
 * Now (call-process :wait x) works for xyzzy.exe itself.

Typical pseudo-restart code is like this :

    (progn (prepare-for-kill-xyzzy)
           (call-process "xyzzy.exe" :wait 60)
           (kill-xyzzy))

Details
=======

Typical pseudo-restart code is like this :

    (progn (call-process "xyzzy.exe") (kill-xyzzy))

Expected as :

 1. Launch new xyzzy.exe
 2. Kill old xyzzy.exe

But in reality, following all events occur simultaneously :

 1. Launch new xyzzy.exe AND new xyzzy.exe will read/write to $XYZZY/xyzzy.ini .
 2. Kill old xyzzy.exe AND old xyzzy.exe will write to $XYZZY/xyzzy.ini .

And sometimes an accident happens to $XYZZY/xyzzy.ini .

It must perform one at a time. Do not perform anyhing simultaneously.

 1. old xyzzy.exe : (New Function) - Write to $XYZZY/xyzzy.ini (geometry section).
 2. new xyzzy.exe : (call-process) - Launch and read/write to $XYZZY/xyzzy.ini
 3. old xyzzy.exe : (call-process) - Wait for new xyzzy.exe's initialize procedures.
 4. old xyzzy.exe : (kill-xyzzy) - Kill itself. Write to $XYZZY/xyzzy.ini (geometry section).

1. is already existing - environ::save_geometry().
So, it will be done just make a Lisp-to-C bridge function.

2. is call-process itself. There is no problem.

3. is already existing too - call-process's ':wait x' option (x:floating point number).
But it doesn't work for xyzzy.exe itself. xyzzy.exe has following problem

  * ':wait x' is implemented using Win32 API WaitForInputIdle().
  * WaitForInputIdle() waits target process's idle message loop.
  * xyzzy.exe has sub message loop in quit_thread_entry().
  * quit_thread_entry() runs before main message loop. And will be idle state immediately.

Solution: quit_thread_entry() must wait for main message loop.
This can be implemented by Win32 event.

4. Writing to $XYZZY/xyzzy.ini twice is not good behavior.
But it harms nothing (maybe). So leave it.

Issue #24
=========
#24 (Part17, 814) $XYZZY/xyzzy.ini が読み込まれない場合がある
https://bitbucket.org/mumurik/xyzzy/issue/24/part17-814-xyzzy-xyzzyini

== 再現方法 ==
# multiframe_0_2_3_5.zip を展開する
# コマンドラインで展開した xyzzy.exe のあるディレクトリまで移動する
# 下記のコマンドを実行
> start /wait .\xyzzy.exe -no-init-file
# 起動した xyzzy のメニューの「ツール(T)＞共通設定...(C)」を選択し、背景色を「赤」に変更し、xyzzy を終了
# 下記のコマンドを実行
> copy .\usr\%USERNAME%\wxp\xyzzy.ini .
> start /wait .\xyzzy.exe -no-init-file
# 起動した xyzzy のメニューの「ツール(T)＞共通設定...(C)」を選択し、背景色を「白」に変更し、xyzzy を終了
# 下記のコマンドを実行
> .\xyzzy.exe -no-init-file
# *scratch* で下記のコマンドの実行を繰り返す
(progn (call-process "xyzzy.exe -no-init-file") (kill-xyzzy))

== 期待する動作 ==
背景が「白」の状態の xyzzy が起動する

== 実際の動作 ==
背景が「赤」の状態の xyzzy が起動する

== 再現バージョン ==
0.2.3.5

== 備考 ==
Part17, 814 : http://toro.2ch.net/test/read.cgi/win/1303662374/814

    exeと同じ場所にiniを置いた状態で
    (call-process　"xyzzy.exe")
    (kill-xyzzy)
    みたいに起動と終了を同時にやるとたまに上記のiniは無視されて
    XYZZYCONFIGPATHのiniをつかうことがある

頻度について (「赤」背景の発生数 / 試行回数）
Part17, 838 : http://toro.2ch.net/test/read.cgi/win/1303662374/838

    何も追加していないxyzzy
    1/100　7/100　1/100　0/100　5/100
    6/100　1/100　0/100　0/100　0/100
    21/1000

    実際に使っているxyzzy
    4/100　12/100　8/100　12/100　8/100
    44/500
Merge pull request #31 from xyzzy-17-638/fix-issue-24

FIX:Issue#24 (Sometimes, $XYZZY/xyzzy.ini is not loaded even it exist)