Commits

cvs  committed 6608cee

Import from CVS: tag r20-2b3

  • Participants
  • Parent commits cae9840
  • Tags r20-2b3

Comments (0)

Files changed (71)

File CHANGES-beta

 							-*- indented-text -*-
+to 20.2 beta3
+-- Miscellaneous Mule/ Egg/Quail patches courtesy of Jareth Hein
+-- Various hyperbole fixes courtesy of Bob Weiner
+-- Restoration of obsolete symbol overriding-file-coding-system
+-- MULE-ization of lib-complete.el
+-- W3-3.0.85
+-- xmine-1.8 coutesy of Jens Lautenbacher
+-- efs-1.15-x5 Courtesy of Michael Sperber
+-- miscellaneous bug fixes
+-- balloon-help.el-1.06 Courtesy of Kyle Jones
+
 to 20.2 beta2
 -- sundry psgml fixes
 -- VM-6.29
+Sun Apr 27 12:25:55 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* XEmacs 20.2-b3 is released.
+
 Wed Apr 23 10:33:58 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* XEmacs 20.2-b2 is released.
 You *have* to compile your own jpeg lib. The one delivered with SGI
 systems is a C++ lib, which apparently XEmacs cannot cope with.
 
+** XEmacs won't build with the n32 environment on Irix 6.
+
+Olivier Galibert <Olivier.Galibert@mines.u-nancy.fr> writes:
+While making the OS and the compiler able to work on 64b
+architectures, SGI designed another mode for using registers
+and passing parameters between functions, activated on the
+compiler by using -64. Since it was much more efficient ar
+using registers even for 32b architectures, they designed
+a version for 32b called n32. And it _is_ really better.
+This mode should always be used when not using gcc (which
+can only do o32 afaik).
+
+Too bad xemacs can't do n32 out of the box. So here is what
+I had to do to compile it in this mode:
+
+s/irix6-0.h:
+- #define LD_SWITCH_SYSTEM -32
++ #define LD_SWITCH_SYSTEM -n32 -G 0
+
+m/iris4d.h:
+- #define LIBS_MACHINE -lmld
++ #define LIBS_MACHINE
+
+- #define C_SWITCH_MACHINE -32
++ #define C_SWITCH_MACHINE -n32 -G 0
+
+(the mld lib does not exist in n32 mode)
+
+I also added a --cflags='-n32 -O2 -G 0 -s' to the configuration
+line but it seems that these flags are ignored for configure test
+and since o32 and n32 libraries are independant I had to revert
+to the CFLAGS env var.
+
+Anyway, once done that the compile has gone succesfully, the dump
+was OK and I'm writing this in the resulting xemacs-20.2b1 ;-)
+
 ** Slow startup on Linux.
 
 People using systems based on the Linux kernel sometimes report that
 * Changes in XEmacs 20.2
 ========================
 
+Testing of XEmacs 20.1 revealed a number of showstopping bugs at the
+very final moment.  Instead of confusing the version numbers further,
+the `20.1' designation was abandoned, and the release was renamed to
+`20.2'.
+
+** The `C-z' key now iconifies only the current X frame.  You can use
+`C-x C-z' to get the old behavior.
+
+On the tty frames `C-z' behaves as before.
+
+** Several Egg/Wnn-related crashes were fixed.
+
+** lib-complete.el was MULE-ized.
+
+The commands `find-library', `find-library-other-window' and
+`find-library-other-frame' now take an optional coding system
+argument.
+
+** XEmacs 20.0 MULE API supported for backwards compatibilty
+
+XEmacs 20.2 primarily supports the MULE 3 API.  It now also supports
+the XEmacs 20.0 MULE API.
+
+** `values' now has a setf method
+
+** W3-3.0.85 Courtesy of William Perry
+
+Bug fixes.  See the 20.1 notes for further details.
+
+** Gnus-5.4.47 Courtesy of Lars Magne Ingebrigtsen
+
+Bug fixes.  See the 20.1 notes for further details.
+
+** edmacro.el-3.10 Courtesy of Hrvoje Niksic
+
+Interface changes to maintain Emacs compatibility.
+
+** live-icon.el-1.3
+
+Bug fixes.
+
+** tpu-edt.el
+
+Restoration of proper behavior with respect to the zmacs region.
+
+** xmine.el-1.8
+
+** balloon-help.el-1.06 Courtesy of Kyle Jones
+
+** VM-6.29
+
+** Verilog.el-2.25 Courtesy of Michael McNamara
+
+** etags.c-11.83 Courtesy of F. Potort�
+
+** Further support of Custom package by Hrvoje Niksic
+
+* Changes in XEmacs 20.1 (never publicly released)
+========================
+
 ** The logo has been changed, and the default background color is
 now a shade of gray instead of the eye-burning white.
 
 eval-expression (`M-:') and upcase-region (`C-x C-u')/downcase-region
 (`C-x C-l').
 
-** The `C-z' key now iconifies only the current X frame.  You can use
-`C-x C-z' to get the old behavior.
-
-On the tty frames `C-z' behaves as before.
-
 ** Numerous causes of crashes have been fixed.  XEmacs should now be
 even more stable than before.
 

File etc/w3/stylesheet

       h5  { font-size : -2pt  }
       h6  { font-size : -4pt  }
 
-/* Used to cause problems under Emacs 19, lets try once more, with feeling! */
+/* This causes problems with Emacs 19 */
+@media xemacs {
    pre,xmp,
   plaintext { font-family: monospace }
 key,code,tt { font-family: monospace }
+}
 
 /*
 ** Best we can do under Emacs-19 is use the default font and try to make

File lib-src/ChangeLog

+Fri Apr 25 09:12:04 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* pstogif: Use Martin Buchholz magic to automagically find perl
+	interpreter.
+
 Tue Apr  8 03:08:22 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* Makefile.in.in: C Comment out Make comments.  No snide comments

File lib-src/pstogif

-#!/usr/local/bin/perl
+: # -*-Perl-*-
+eval 'exec perl -w -S $0 ${1+"$@"}' # Portability kludge
+    if 0;
 # 
 # pstogif.pl v1.0, July 1994, by Nikos Drakos <nikos@cbl.leeds.ac.uk>
 # Computer Based Learning Unit, University of Leeds.

File lisp/ChangeLog

+Sat Apr 26 16:25:49 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* utils/lib-complete.el: Make conformant to Lisp coding standards
+	MULE-ize by allowing for coding system argument.
+
+Fri Apr 25 08:39:50 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* packages/info.el: Remove mouse-1 binding.
+
+	* modes/sh-script.el (sh-indent-line): Deal with pathological case 
+	of indenting a first line containing a `#' as first non-white
+	space character.
+
+Thu Apr 24 18:40:32 1997  Steven L Baur  <steve@altair.xemacs.org>
+
+	* comint/telnet.el (telnet-mode-map): Correct Emacs synch typo.
+
+	* rmail/rmail.el (rmail-get-new-mail): display-time-string is not
+	necessarily a string.
+
+Thu Apr 24 11:08:28 1997  Kyle Jones  <kyle_jones@wonderworks.com>
+
+	* packages/balloon-help.el:
+	- default background color now grey80 to match XEmacs default.
+	- default border width is now 1.
+	- default font is now "variable"
+	- balloon-help can now handle variable width fonts.
+	- loading balooon-help no longer turns on balloon-help-mode.
+	- new `balloon-help' command.
+	- changes to the font/background/foreground variables now affect
+	  the help frame at next display.
+	- help frame should now pop up on the correct display if XEmacs
+	  is running with multiple devices open.
+	- Customized, courtesy of Hrvoje.
+	- don't use the padding lines that were needed for 19.12.
+	  Compatibility with older XEmacs versions is hereby disavowed.
+	- xclock frame name hack is gone.
+
 Wed Apr 23 10:56:05 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* prim/files.el (hack-local-variables-prop-line): Mistakenly

File lisp/comint/telnet.el

   (set-keymap-parents telnet-mode-map (list comint-mode-map))
   (define-key telnet-mode-map "\C-m" 'telnet-send-input)
 ;  (define-key telnet-mode-map "\C-j" 'telnet-send-input)
-  (define-key telnet-mode-map "\C-c\C-q" 'send-process-next-char)
+  (define-key telnet-mode-map "\C-c\C-q" 'telnet-send-process-next-char)
   (define-key telnet-mode-map "\C-c\C-c" 'telnet-interrupt-subjob) 
   (define-key telnet-mode-map "\C-c\C-z" 'telnet-c-z))
 

File lisp/efs/dired-faces.el

   :group 'dired)
 
 (defface dired-face-boring '((((class color))
-			      (:foreground "Grey"))
+			      (:foreground "Gray65"))
 			     (((class grayscale))
-			      (:foreground "Grey")))
+			      (:foreground "Gray65")))
   "Face used for unimportant files."
   :group 'dired)
 

File lisp/efs/dired-shell.el

      (list
       (dired-read-shell-command
        (concat (if dir
-		   (format "! in %s" (dired-abbreviate-file-name dir))
+		   (format "! in %s " (dired-abbreviate-file-name dir))
 		 "cd <dir>; ! ")
 	       "on "
 	       (if on-each "each ")

File lisp/efs/dired-vir.el

   (set (make-local-variable 'dired-subdir-alist) nil)
   (dired-build-subdir-alist)
   (goto-char (point-min))
+  (dired-insert-set-properties (point-min) (point-max))
   (dired-initial-position dirname))
 
 (defun dired-virtual-guess-dir ()

File lisp/efs/dired.el

   "*File names matching these regexp may be omitted (buffer-local).
 This only has effect when the subdirectory is in omission mode.
 To make omission mode the default, set `dired-omit-files' to t.
-This only has effect when `dired-omit-files-p' is t.
+This only has effect when `dired-omit-files' is t.
 See also `dired-omit-extensions'.")
-(make-variable-buffer-local 'dired-omit-files-regexp)
+(make-variable-buffer-local 'dired-omit-regexps)
 
 (defvar dired-filename-re-ext "\\..+$"   ; start from the first dot. last dot?
   "*Defines what is the extension of a file name.
       (run-hooks 'dired-after-readin-hook)
       ;; I put omit-expunge after the dired-after-readin-hook
       ;; in case that hook marks files. Does this make sense? Also, users
-      ;; might want to set dired-omit-files-p in some incredibly clever
+      ;; might want to set dired-omit-files in some incredibly clever
       ;; way depending on the contents of the directory... I don't know...
       (if dired-omit-files
 	  (dired-omit-expunge nil t))
 
 (defun dired-omit-toggle (&optional arg)
   "Toggle between displaying and omitting files matching
-`dired-omit-files-regexp' in the current subdirectory.
+`dired-omit-regexps' in the current subdirectory.
 With a positive prefix, omits files in the entire tree dired buffer.
 With a negative prefix, forces all files in the tree dired buffer to be
 displayed."
 
 (defun dired-omit-expunge (&optional regexp full-buffer)
   ;; Hides all unmarked files matching REGEXP.
-  ;; If REGEXP is nil or not specified, uses `dired-omit-files-regexp',
+  ;; If REGEXP is nil or not specified, uses `dired-omit-regexps',
   ;; and also omits filenames ending in `dired-omit-extensions'.
   ;; If REGEXP is the empty string, this function is a no-op.
   (let ((omit-re (or regexp (dired-omit-regexp)))

File lisp/efs/efs.el

 ;;;    efs|Andy Norman and Sandy Rutherford
 ;;;    |ange@hplb.hpl.hp.com and sandy@ibm550.sissa.it
 ;;;    |transparent FTP Support for GNU Emacs
-;;;    |$Date: 1997/04/05 18:07:24 $|$efs release: 1.15 beta $|
+;;;    |$Date: 1997/04/27 19:30:06 $|$efs release: 1.15 beta $|
 
 ;;; Host and listing type notation:
 ;;;
 getting out of synch with the FTP client, so using this feature routinely
 isn't recommended.")
 
+(defvar efs-use-passive-mode nil
+  "*If non-nil, the ftp client will specify passive mode for all transfers.")
+
 ;;; Hooks and crooks.
 
 (defvar efs-ftp-startup-hook nil
 (defvar efs-cmd-ok-cmds
   (concat
    "^quote port \\|^type \\|^quote site \\|^chmod \\|^quote noop\\|"
-   "^quote pasv"))
+   "^quote pasv\\|^passive"))
 ;; Regexp to match commands for which efs-cmd-ok-msgs is a valid server
 ;; response for success.
 
 			; (Sometimes get this with a timeout,
 			; so treat as fatal.)
    "^3[0-5][0-7] \\|"    ; 3yz = positive intermediate reply
+   ;; passive
+   "^[Pp]assive \\|"
    ;; client codes
    "^[Hh]ash mark "))
 ;; Response to indicate that the requested action was successfully completed.
 		  ;; Tell client to send back hash-marks as progress.  It isn't
 		  ;; usually fatal if this command fails.
 		  (efs-guess-hash-mark-size proc)
+
+		  (if efs-use-passive-mode
+		      (efs-passive-mode host user))
 		  
 		  ;; Run any user startup functions
 		  (let ((alist efs-ftp-startup-function-alist)
 			       'efs-hash-mark-size)
 			     (string-to-int size))))))))))
 
+(defun efs-passive-mode (host user)
+  ;; put ftp into passive mode
+  (efs-send-cmd host user '(passive)))
+
 ;;;; ------------------------------------------------------------
 ;;;; Simple FTP process shell support.
 ;;;; ------------------------------------------------------------
 					   (efs-fix-path host-type cmd2))
 		    cmd-string (concat "rename " cmd1 " " cmd2))))
 	   
+	   ;; passive command
+	   ((eq cmd0 'passive)
+	    (setq cmd-string "passive"))
+	
 	   (t
 	    (error "efs: Don't know how to send %s %s %s %s"
 		   cmd0 cmd1 cmd2 cmd3))))
 	(progn
 	  (setq proc (efs-kerberos-login host user proc))
 	  (efs-login-send-user host user proc gate))
-      (let ((to (if (memq gate '(proxy local raptor))
+      (let ((to (if (memq gate '(proxy raptor))
 		    efs-gateway-host
 		  host))
 	    port cmd result)
 Optional argument GATE specifies which type of gateway is being used.
 RETRY argument specifies to try twice if we get a 421 response."
   (let ((cmd (cond
-	      ((memq gate '(local proxy interlock))
+	      ((memq gate '(proxy interlock))
 	       (format "quote USER \"%s\"@%s" user
 		       (if (and efs-nslookup-on-connect
 				(string-match "[^0-9.]" host))
 	      (t
 	       (format "quote user \"%s\"" user))))
 	(msg (format "Logging in as user %s%s..." user
-		     (if (memq gate '(proxy local raptor kerberos))
+		     (if (memq gate '(proxy raptor kerberos))
 			 (concat "@" host) "")))  
 	result code)	 
 	

File lisp/egg/egg.el

 (if (boundp 'mouse-track-cleanup-hook)
     (add-hook 'mouse-track-cleanup-hook 'fence-mouse-protect))
 
+(defun egg-lang-switch-callback ()
+  "Do whatever processing is necessary when the language-environment changes."
+  (if egg:*in-fence-mode*
+      (progn
+	(its:reset-input)
+	(fence-cancel-input)))
+  (let ((func (get current-language-environment 'set-egg-environ)))
+    (if (not (null func))
+      (funcall func))))
+
 (defun fence-mode-help-command ()
   "Display documentation for fence-mode."
   (interactive)
 
 (define-key global-map "\C-^"  'special-symbol-input)
 
-(autoload 'busyu-input "busyu" nil t)	;92.10.18 by K.Handa
-(autoload 'kakusuu-input "busyu" nil t)	;92.10.18 by K.Handa
+(autoload 'busyu-input "egg-busyu" nil t)
+(autoload 'kakusuu-input "egg-busyu" nil t)
 
 (provide 'egg)
 
+;; if set-lang-environment has already been called, call egg-lang-switch-callback
+(if (not (null current-language-environment))
+    (egg-lang-switch-callback))
+
 ;;; egg.el ends here

File lisp/emulators/edt.el

       (if (null term)
 	  (error "Unable to load EDT terminal specific file for %s" edt-term)))
     (setq edt-term term))
-  (setq edt-orig-transient-mark-mode transient-mark-mode)
+  (when (boundp 'transient-mark-mode)
+    (setq edt-orig-transient-mark-mode transient-mark-mode))
   (add-hook 'activate-mark-hook
 	    (function
 	     (lambda ()
   (setq edt-select-mode-text nil)
   (edt-reset)
   (force-mode-line-update t)
-  (setq transient-mark-mode edt-orig-transient-mark-mode)
+  (when (boundp 'transient-mark-mode)
+    (setq transient-mark-mode edt-orig-transient-mark-mode))
   (message "Original key bindings restored; EDT Emulation disabled"))
 
 (defun edt-default-emulation-setup (&optional user-setup)
 (defun edt-select-default-global-map()
   "Select default EDT emulation key bindings."
   (interactive)
-  (transient-mark-mode 1)
+  (when (fboundp 'transient-mark-mode)
+    (transient-mark-mode 1))
   (use-global-map edt-default-global-map)
   (if (not edt-keep-current-page-delimiter)
       (progn
   (interactive)
   (if edt-user-map-configured
       (progn
-	(transient-mark-mode 1)
+	(when (fboundp 'transient-mark-mode)
+	  (transient-mark-mode 1))
         (use-global-map edt-user-global-map)
         (if (not edt-keep-current-page-delimiter)
             (progn

File lisp/games/xmine.el

 
 ;; Author:     Jens Lautenbacher <jens@lemming0.lem.uni-karlsruhe.de>
 ;; Keywords:   games
-;; Version:    1.7
+;; Version:    1.8
 
 ;; This file is part of XEmacs.
 
 ;;
 ;;; First of all we'll define the needed varibles.
 
-(defconst xmine-version-number "1.7" "XEmacs Mine version number.")
+(defconst xmine-version-number "1.8" "XEmacs Mine version number.")
 (defconst xmine-version (format "XEmacs Mine v%s by Jens Lautenbacher � 1997"
 			       xmine-version-number)
   "Full XEmacs Mine version number.")
      "------------------ XEmacs XMine ------------------")))
 
 (defvar xmine-glyph-production-list
-  '(("xmine-new-up"            "new_up.gif"               "new"  nil               )
-    ("xmine-new-down"          "new_down.gif"             "NEW"  nil               )
-    ("xmine-quit-up"           "quit_up.gif"              "quit" nil               )
-    ("xmine-quit-down"         "quit_down.gif"   	  "QUIT" nil               )
-    ("xmine-up-glyph"          "empty_16_up.gif"          "@ "   xmine-hidden-face )
-    ("xmine-up-sel-glyph"      "empty_16_up_sel.gif"      "@<"   xmine-hidden-face )
-    ("xmine-down-glyph"        "empty_16_down.gif"        "? "   nil               ) 
+  '(("xmine-new-up"            "new_up.gif"               "new"  nil)
+    ("xmine-new-down"          "new_down.gif"             "NEW"  nil)
+    ("xmine-quit-up"           "quit_up.gif"              "quit" nil)
+    ("xmine-quit-down"         "quit_down.gif"   	  "QUIT" nil)
+    ("xmine-up-glyph"          "empty_16_up.gif"          "@ "   xmine-hidden-face)
+    ("xmine-up-sel-glyph"      "empty_16_up_sel.gif"      "@<"   xmine-hidden-face)
+    ("xmine-down-glyph"        "empty_16_down.gif"        "? "   nil) 
     ("xmine-flagged-glyph"     "flagged_16_up.gif"        "! "   xmine-flagged-face)
     ("xmine-flagged-sel-glyph" "flagged_16_up_sel.gif"    "!<"   xmine-flagged-face)
-    ("xmine-mine-glyph"        "bomb_16_flat.gif"         "* "   nil               )
-    ("xmine-mine-sel-glyph"    "bomb_16_flat.gif"         "*<"   nil               )
-    ("xmine-trapped-glyph"     "bomb_trapped_16_flat.gif" "X "   nil               )
-    ("xmine-0-glyph"           "empty_16_flat.gif"        ". "   nil               )
-    ("xmine-0-sel-glyph"       "empty_16_flat_sel.gif"    ".<"   nil               )
-    ("xmine-1-glyph"           "1_16_flat.gif"            "1 "   xmine-number-face )
-    ("xmine-1-sel-glyph"       "1_16_flat_sel.gif"        "1<"   xmine-number-face )
-    ("xmine-2-glyph"           "2_16_flat.gif"            "2 "   xmine-number-face )
-    ("xmine-2-sel-glyph"       "2_16_flat_sel.gif"        "2<"   xmine-number-face )
-    ("xmine-3-glyph"           "3_16_flat.gif"            "3 "   xmine-number-face )
-    ("xmine-3-sel-glyph"       "3_16_flat_sel.gif"        "3<"   xmine-number-face )
-    ("xmine-4-glyph"           "4_16_flat.gif"            "4 "   xmine-number-face )
-    ("xmine-4-sel-glyph"       "4_16_flat_sel.gif"        "4<"   xmine-number-face )
-    ("xmine-5-glyph"           "5_16_flat.gif"            "5 "   xmine-number-face )
-    ("xmine-5-sel-glyph"       "5_16_flat_sel.gif"        "5<"   xmine-number-face )
-    ("xmine-6-glyph"           "6_16_flat.gif"            "6 "   xmine-number-face )
-    ("xmine-6-sel-glyph"       "6_16_flat_sel.gif"        "6<"   xmine-number-face )
-    ("xmine-7-glyph"           "7_16_flat.gif"            "7 "   xmine-number-face )
-    ("xmine-7-sel-glyph"       "7_16_flat_sel.gif"        "7<"   xmine-number-face )
-    ("xmine-8-glyph"           "8_16_flat.gif"            "8 "   xmine-number-face )
-    ("xmine-8-sel-glyph"       "8_16_flat_sel.gif"        "8<"   xmine-number-face )))
+    ("xmine-mine-glyph"        "bomb_16_flat.gif"         "* "   nil)
+    ("xmine-mine-sel-glyph"    "bomb_16_flat.gif"         "*<"   nil)
+    ("xmine-trapped-glyph"     "bomb_trapped_16_flat.gif" "X "   nil)
+    ("xmine-0-glyph"           "empty_16_flat.gif"        ". "   nil)
+    ("xmine-0-sel-glyph"       "empty_16_flat_sel.gif"    ".<"   nil)
+    ("xmine-1-glyph"           "1_16_flat.gif"            "1 "   xmine-number-face)
+    ("xmine-1-sel-glyph"       "1_16_flat_sel.gif"        "1<"   xmine-number-face)
+    ("xmine-2-glyph"           "2_16_flat.gif"            "2 "   xmine-number-face)
+    ("xmine-2-sel-glyph"       "2_16_flat_sel.gif"        "2<"   xmine-number-face)
+    ("xmine-3-glyph"           "3_16_flat.gif"            "3 "   xmine-number-face)
+    ("xmine-3-sel-glyph"       "3_16_flat_sel.gif"        "3<"   xmine-number-face)
+    ("xmine-4-glyph"           "4_16_flat.gif"            "4 "   xmine-number-face)
+    ("xmine-4-sel-glyph"       "4_16_flat_sel.gif"        "4<"   xmine-number-face)
+    ("xmine-5-glyph"           "5_16_flat.gif"            "5 "   xmine-number-face)
+    ("xmine-5-sel-glyph"       "5_16_flat_sel.gif"        "5<"   xmine-number-face)
+    ("xmine-6-glyph"           "6_16_flat.gif"            "6 "   xmine-number-face)
+    ("xmine-6-sel-glyph"       "6_16_flat_sel.gif"        "6<"   xmine-number-face)
+    ("xmine-7-glyph"           "7_16_flat.gif"            "7 "   xmine-number-face)
+    ("xmine-7-sel-glyph"       "7_16_flat_sel.gif"        "7<"   xmine-number-face)
+    ("xmine-8-glyph"           "8_16_flat.gif"            "8 "   xmine-number-face)
+    ("xmine-8-sel-glyph"       "8_16_flat_sel.gif"        "8<"   xmine-number-face)))
+
+(defvar xmine-force-textual nil
+  "This is for debugging purposes only. No need to set it. Really.")
 
 (defun xmine-generate-glyphs ()
   (let ((list xmine-glyph-production-list)
 	    text (caddr  elem)
 	    face (cadddr elem))
       (set (intern var)
-	   (make-glyph (if (eq window-system 'x)
+	   (make-glyph (if (and (not xmine-force-textual)
+				(eq window-system 'x))
 			   (concat xmine-glyph-dir gif)
 			 text)))
       (if face
 (defun xmine-activate-function-button (event)
   (interactive "e")
   (let* ((extent (event-glyph-extent event))
-	 (button (event-button event))
-	 (action (intern (concat "action" (number-to-string button))))
+	 (button (number-to-string (event-button event)))
+	 (action (intern (concat "action" button)))
+	 (down-action (intern (concat "down-action" button)))
+	 (restore-down-action (intern (concat "restore-down-action" button)))
 	 (mouse-down t)
-	 (up-glyph nil))
+	 (action-do-it t)
+	 up-glyph)
     ;; make the glyph look pressed
     (cond ((annotation-down-glyph extent)
 	   (setq up-glyph (annotation-glyph extent))
 	   (set-annotation-glyph extent (annotation-down-glyph extent))))
+    (if (extent-property extent down-action)
+	(setq action-do-it
+	      (funcall (extent-property extent down-action) extent)))
     (while mouse-down
       (setq event (next-event event))
       (if (button-release-event-p event)
     (cond ((annotation-down-glyph extent)
 	   (set-annotation-glyph extent up-glyph)))
     (if (eq extent (event-glyph-extent event))
-	(if (extent-property extent action)
-	    (funcall (extent-property extent action) extent)))))
+	(if (and (extent-property extent action) action-do-it)
+	    (funcall (extent-property extent action) extent)
+	  (if (extent-property extent restore-down-action)
+	      (funcall (extent-property extent restore-down-action) extent)))
+      (if (extent-property extent restore-down-action)
+	      (funcall (extent-property extent restore-down-action) extent)))))
 
 ;;; Here we define the button object's constructor function
 
     (set-extent-property ext 'action1 'xmine-action1)
     (set-extent-property ext 'action2 'xmine-beep)
     (set-extent-property ext 'action3 'xmine-action3)
+    (set-extent-property ext 'down-action2 'xmine-down-action2)
+    (set-extent-property ext 'restore-down-action2 'xmine-restore-down-action2)
     (set-extent-property ext 'xmine-glyph (xmine-type-to-glyph type))
     (set-extent-property ext 'xmine-sel-glyph (xmine-type-to-sel-glyph type)) 
     (set-extent-property ext 'xmine-type type)
        (not (extent-property ext 'xmine-hidden))
        (equal "0" (extent-property ext 'xmine-type))))
 
+(defun xmine-enough-flagged-p (ext)
+  (let ((list (xmine-get-neighbours ext))
+	(number (extent-property ext 'xmine-type))
+	(flagged 0) elem res)
+    (if (not (or (equal number "mine")
+		 (equal number "0")))
+	(progn
+	  (setq number (string-to-number number))
+	  (while (setq elem (pop list))
+	    (if (extent-property elem 'xmine-flagged)
+		(setq flagged (1+ flagged))))
+	  (setq res (>= flagged number))
+	  ))
+    res))
+    
+		 
 (defun xmine-mine-button-p (ext)
   (and ext
        (equal "mine" (extent-property ext 'xmine-type))))
 (defun xmine-type-to-sel-glyph (type)
   (eval (intern-soft (concat "xmine-" type "-sel-glyph"))))
 
-;;; the next three functions are the main functions that are used
+;;; the next 3 functions are the main functions that are used
 ;;; inside the button objects and which are bound to the 'action1,
 ;;; 'action2 and 'action3 slots respectively
 
   (let ((list (xmine-get-neighbours ext))
 	(xmine-no-unhide-sound t)
 	next)
+;;    (xmine-restore-down-action2 ext)
     (if list (xmine-unhide-many-sound))
     (while (setq next (pop list))
       (if (not (xmine-flat-button-p next)) (xmine-action1 next)))))
 					  xmine-number-of-flagged))))))))
 
 
+(defun xmine-down-action2 (ext)
+  (let ((list (xmine-get-neighbours ext))
+	(do-it (xmine-enough-flagged-p ext))
+	elem)
+    (if (not do-it)
+	(while (setq elem (pop list))
+	  (set-extent-property elem 'xmine-temp-glyph (annotation-glyph elem))
+	  (set-annotation-glyph elem (annotation-down-glyph elem))))
+    do-it))
+
+(defun xmine-restore-down-action2 (ext)
+  (let ((list (xmine-get-neighbours ext))
+	elem)
+    (while (setq elem (pop list))
+      (set-annotation-glyph elem (extent-property elem 'xmine-temp-glyph)))))
+  
 ;;; the sounds...
 (defcustom xmine-play-sounds nil
   "If XMine should play some sounds for various events to happen."
 (defun xmine-key-action2 ()
   (interactive)
   (let ((action (extent-property xmine-key-sel-button 'action2)))
-    (if action
-	(funcall action xmine-key-sel-button))))
+    (if (and action (xmine-enough-flagged-p xmine-key-sel-button))
+	(funcall action xmine-key-sel-button)
+      (beep))))
 
 (defun xmine-key-action3 ()
   (interactive)

File lisp/hyperbole/hsite-ex.el

 ;; ORG:          InfoDock Associates
 ;;
 ;; ORIG-DATE:    15-Apr-91 at 00:48:49
-;; LAST-MOD:      8-Mar-97 at 22:52:36 by Bob Weiner
+;; LAST-MOD:     24-Apr-97 at 22:41:33 by Bob Weiner
 ;;
 ;; This file is part of Hyperbole.
 ;; Available for use and distribution under the same terms as GNU Emacs.
    (list 'one-window  (function (lambda (f)
 				  (if (br-in-browser) (br-quit))
 				  (delete-other-windows) (find-file f))))
-   (list 'new-frame   'find-file-new-frame)
+   (list 'new-frame   (function (lambda (f)
+				  (if (fboundp 'find-file-new-frame)
+				      (find-file-new-frame f)
+				    (find-file-other-frame f)))))
    (list 'other-frame 'hpath:find-other-frame)
    (list 'other-frame-one-window
 	 (function (lambda (f) (hpath:find-other-frame f) (delete-other-windows)))))

File lisp/hyperbole/hui-mouse.el

 ;; ORG:          InfoDock Associates
 ;;
 ;; ORIG-DATE:    04-Feb-89
-;; LAST-MOD:     20-Feb-97 at 11:55:00 by Bob Weiner
+;; LAST-MOD:     24-Apr-97 at 22:37:14 by Bob Weiner
 ;;
 ;; This file is part of Hyperbole.
 ;; Available for use and distribution under the same terms as GNU Emacs.
 	 (goto-char (point-max)))
 	((looking-at "~") (dired-flag-backup-files))
 	((looking-at "#") (dired-flag-auto-save-files))
-	(t (dired-flag-file-deleted 1))))
+	(t (if (fboundp 'dired-flag-file-deletion)
+	       (dired-flag-file-deletion 1)
+	     (dired-flag-file-deleted 1)))))
 
 ;;; ************************************************************************
 ;;; smart-gnus functions

File lisp/ilisp/ilisp-cmu.el

 
 	ilisp-reset ":q"
 
-	comint-interrupt-regexp "Interrupted at"
+	comint-interrupt-regexp "Interrupted at")
 
-	ilisp-binary-extension "sparcf"
-	ilisp-init-binary-extension "sparcf"
-	ilisp-binary-command "\"sparcf\""
-	))
+  (if (progn
+	  (shell-command "uname -s")
+	  (save-excursion
+	    (set-buffer "*Shell Command Output*")
+	    (goto-char (point-min))
+	    (looking-at "[Ll]inux")))
+      (setq
+       ilisp-binary-extension "x86f"
+       ilisp-init-binary-extension "x86f"
+       ilisp-binary-command "\"x86f\"")
+    ;; else assume sparc.
+    (setq ilisp-binary-extension "sparcf"
+	  ilisp-init-binary-extension "sparcf"
+	  ilisp-binary-command "\"sparcf\"")))
+

File lisp/modes/cperl-mode.el

 ;;; Corrections made by Ilya Zakharevich ilya@math.mps.ohio-state.edu
 ;;; XEmacs changes by Peter Arius arius@informatik.uni-erlangen.de
 
-;; $Id: cperl-mode.el,v 1.4 1997/03/16 03:05:17 steve Exp $
+;; $Id: cperl-mode.el,v 1.5 1997/04/27 19:30:26 steve Exp $
 
 ;;; To use this mode put the following into your .emacs file:
 
     (save-excursion
       (cond (inbuffer nil)		; Already there
 	    ((file-exists-p tags-file-name)
-	     (visit-tags-table-buffer tags-file-name))
+	     ;;(visit-tags-table-buffer tags-file-name))
+	     (visit-tags-table-buffer))
 	    (t (set-buffer (find-file-noselect tags-file-name))))
       (cond
        (dir

File lisp/modes/sh-script.el

   (interactive)
   (let ((previous (save-excursion
 		    (while (and (not (bobp))
+				(not (eq (point-min) (point-at-bol)))
 				(progn
 				  (forward-line -1)
 				  (back-to-indentation)

File lisp/mule/canna.el

 
 ;; Author: Akira Kon <kon@d1.bs2.mt.nec.co.jp>
 ;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Revision: 1.5 $
+;; Version: $Revision: 1.6 $
 ;; Keywords: Canna, Japanese, input method, mule, multilingual
 
 ;; This file is not a part of Emacs yet.
 ;; end
 
 (defconst canna-rcs-version
-  "$Id: canna.el,v 1.5 1997/04/10 05:55:27 steve Exp $")
+  "$Id: canna.el,v 1.6 1997/04/27 19:30:30 steve Exp $")
 
 (defun canna-version ()
   "Display version of canna.el in mini-buffer."
 	 (or (canna:memq-recursive 'mode-line-canna-mode
 				   default-modeline-format)
 	     (setq-default default-modeline-format
-			   (nconc '("" mode-line-canna-mode)
+			   (append '("" mode-line-canna-mode)
 				  default-modeline-format))
 	     )
 	 (mapcar (function
 		      (or (canna:memq-recursive 'mode-line-canna-mode
 						modeline-format)
 			  (setq modeline-format
-				(nconc '("" mode-line-canna-mode)
+				(append '("" mode-line-canna-mode)
 				       modeline-format))
 			  )
 		      )))
 		       (- (point) arg) (point)))
 	(if (= last-command-char ? ) (canna:do-auto-fill))))))
 
+;; wire us into pending-delete
+(put 'canna-self-insert-command 'pending-delete t)
+
 (defun canna-toggle-japanese-mode ()
   "Toggle canna japanese mode."
   (interactive)

File lisp/mule/chinese-hooks.el

 ;; Please add your own quail package if any.
 
 ;; For GB character input
-;;(add-hook 'quail-package-alist '("py"      "quail/py"))
-;;(add-hook 'quail-package-alist '("qj"      "quail/qj"))
-;;(add-hook 'quail-package-alist '("punct"   "quail/punct"))
-;;(add-hook 'quail-package-alist '("sw"      "quail/sw"))
-;;(add-hook 'quail-package-alist '("tonepy"  "quail/tonepy"))
-;;(add-hook 'quail-package-alist '("ccdospy" "quail/ccdospy"))
-;;(add-hook 'quail-package-alist '("ctlau"   "quail/ctlau"))
+(add-hook 'quail-package-alist '("py"      "quail-py"))
+(add-hook 'quail-package-alist '("qj"      "quail-qj"))
+(add-hook 'quail-package-alist '("punct"   "quail-punct"))
+(add-hook 'quail-package-alist '("sw"      "quail-sw"))
+(add-hook 'quail-package-alist '("tonepy"  "quail-tonepy"))
+(add-hook 'quail-package-alist '("ccdospy" "quail-ccdospy"))
+(add-hook 'quail-package-alist '("ctlau"   "quail-ctlau"))
 
 ;; For BIG5 character input
-;;(add-hook 'quail-package-alist '("py-b5"    "quail/py-b5"))
-;;(add-hook 'quail-package-alist '("qj-b5"    "quail/qj-b5"))
-;;(add-hook 'quail-package-alist '("punct-b5" "quail/punct-b5"))
-;;(add-hook 'quail-package-alist '("ctlaub"   "quail/ctlaub"))
-;;(add-hook 'quail-package-alist '("zozy"     "quail/zozy"))
-;;(add-hook 'quail-package-alist '("etzy"     "quail/etzy"))
+;;(add-hook 'quail-package-alist '("py-b5"    "quail-py-b5"))
+;;(add-hook 'quail-package-alist '("qj-b5"    "quail-qj-b5"))
+;;(add-hook 'quail-package-alist '("punct-b5" "quail-punct-b5"))
+;;(add-hook 'quail-package-alist '("ctlaub"   "quail-ctlaub"))
+;;(add-hook 'quail-package-alist '("zozy"     "quail-zozy"))
+;;(add-hook 'quail-package-alist '("etzy"     "quail-etzy"))
 
 ;; For Big5 handling
 

File lisp/mule/cyrillic-hooks.el

 
 ;; For syntax of Cyrillic
 (modify-syntax-entry 'cyrillic-iso8859-5 "w")
-(modify-syntax-entry ?,L-(B ".")
-(modify-syntax-entry ?,Lp(B ".")
-(modify-syntax-entry ?,L}(B ".")
+(modify-syntax-entry ?-L� ".")-A
+(modify-syntax-entry ?-L� ".")-A
+(modify-syntax-entry ?-L� ".")-A
 
 
 
    mnemonic "ISO8/Cyr"
    ))
 
-;;(add-hook 'quail-package-alist '("jcuken" "quail/cyrillic"))
-;;(add-hook 'quail-package-alist '("macedonian" "quail/cyrillic"))
-;;(add-hook 'quail-package-alist '("serbian" "quail/cyrillic"))
-;;(add-hook 'quail-package-alist '("beylorussian" "quail/cyrillic"))
-;;(add-hook 'quail-package-alist '("ukrainian" "quail/cyrillic"))
-;;(add-hook 'quail-package-alist '("yawerty" "quail/cyrillic"))
+;;(add-hook 'quail-package-alist '("jcuken" "quail-cyrillic"))
+;;(add-hook 'quail-package-alist '("macedonian" "quail-cyrillic"))
+;;(add-hook 'quail-package-alist '("serbian" "quail-cyrillic"))
+;;(add-hook 'quail-package-alist '("beylorussian" "quail-cyrillic"))
+;;(add-hook 'quail-package-alist '("ukrainian" "quail-cyrillic"))
+(add-hook 'quail-package-alist '("yawerty" "quail-cyrillic"))
 
 (define-language-environment 'cyrillic
   "Cyrillic"
     (set-default-buffer-file-coding-system 'iso-8859-5)
     (setq terminal-coding-system 'iso-8859-5)
     (setq keyboard-coding-system 'iso-8859-5)
-;;    (setq-default quail-current-package
-;;		  (assoc "yawerty" quail-package-alist))))
+    (setq-default quail-current-package
+		  (assoc "yawerty" quail-package-alist))
     ))

File lisp/mule/ethiopic-hooks.el

 
 (set-charset-ccl-program 'ethiopic ccl-ethiopic)
 
-(add-hook 'quail-package-alist '("ethio" "quail/ethio"))
+(add-hook 'quail-package-alist '("ethio" "quail-ethio"))
 
 (define-language-environment 'ethiopic
   "Ethiopic"

File lisp/mule/european-hooks.el

 ;;; Synched up with: Mule 2.3.
 
 ;; For syntax of Latin-1 characters.
-(loop for c from 64 to 127		; from ',A@(B' to ',A(B'
+(loop for c from 64 to 127		; from '�' to '�'
       do (modify-syntax-entry (make-char 'latin-iso8859-1 c) "w"))
 
 (modify-syntax-entry (make-char 'latin-iso8859-1 32) "w") ; no-break space
-(modify-syntax-entry ?,AW(B "_")
-(modify-syntax-entry ?,Aw(B "_")
+(modify-syntax-entry ?� "_")
+(modify-syntax-entry ?� "_")
 
 ;; For syntax of Latin-2
-(loop for c in '(?,B!(B ?,B#(B ?,B%(B ?,B&(B ?,B)(B ?,B*(B ?,B+(B ?,B,(B ?,B.(B ?,B/(B ?,B1(B ?,B3(B ?,B5(B ?,B6(B ?,B9(B ?,B:(B ?,B;(B ?,B<(B)
+(loop for c in '(?-B� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?�)-A
       do (modify-syntax-entry c "w"))
 
 (loop for c from 62 to 126
       do (modify-syntax-entry (make-char 'latin-iso8859-2 c) "w"))
 
 (modify-syntax-entry (make-char 'latin-iso8859-2 32) "w") ; no-break space
-(modify-syntax-entry ?,BW(B ".")
-(modify-syntax-entry ?,Bw(B ".")
+(modify-syntax-entry ?-B� ".")-A
+(modify-syntax-entry ?-B� ".")-A
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; EUROPEANS
    mnemonic "MIME/Ltn-5"
    ))
 
-;;(add-hook 'quail-package-alist '("latin-1" "quail/latin"))
-;;(add-hook 'quail-package-alist '("latin-2" "quail/latin"))
-;;(add-hook 'quail-package-alist '("latin-3" "quail/latin"))
-;;(add-hook 'quail-package-alist '("latin-4" "quail/latin"))
-;;(add-hook 'quail-package-alist '("latin-5" "quail/latin"))
+(add-hook 'quail-package-alist '("latin-1" "quail-latin"))
+(add-hook 'quail-package-alist '("latin-2" "quail-latin"))
+(add-hook 'quail-package-alist '("latin-3" "quail-latin"))
+(add-hook 'quail-package-alist '("latin-4" "quail-latin"))
+(add-hook 'quail-package-alist '("latin-5" "quail-latin"))
 
 (define-language-environment 'european
   "European (for Latin-1 through Latin-5)"
     (set-buffer-file-coding-system-for-read 'no-conversion) ; iso-8859-1
     ;;(setq display-coding-system 'iso-8859-1)
     ;;(setq keyboard-coding-system 'iso-8859-1)
-    ;;(setq-default quail-current-package
-    ;;              (assoc "latin-1" quail-package-alist))))
+    (setq-default quail-current-package
+                  (assoc "latin-1" quail-package-alist))
     ))

File lisp/mule/greek-hooks.el

 (loop for c from 54 to 126
       do (modify-syntax-entry (make-char 'greek-iso8859-7 c) "w"))
 (modify-syntax-entry (make-char 'greek-iso8859-7 32) "w") ; no-break space
-(modify-syntax-entry ?,F7(B ".")
-(modify-syntax-entry ?,F;(B ".")
-(modify-syntax-entry ?,F=(B ".")
+(modify-syntax-entry ?-F� ".")-A
+(modify-syntax-entry ?-F� ".")-A
+(modify-syntax-entry ?-F� ".")-A
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    mnemonic "MIME/Grk"
    ))
 
-;;(add-hook 'quail-package-alist '("greek" "quail/greek"))
+(add-hook 'quail-package-alist '("greek" "quail-greek"))
 
 (define-language-environment 'greek
   "Greek"
     (set-default-buffer-file-coding-system 'iso-8859-7)
     (setq terminal-coding-system 'iso-8859-7)
     (setq keyboard-coding-system 'iso-8859-7)
-;;  (setq-default quail-current-package
-;;		  (assoc "greek" quail-package-alist))))
+    (setq-default quail-current-package
+		  (assoc "greek" quail-package-alist))
     ))

File lisp/mule/hebrew-hooks.el

    mnemonic "CText/Hbrw"
 ))
 
-;;(add-hook 'quail-package-alist '("hebrew" "quail/hebrew"))
+(add-hook 'quail-package-alist '("hebrew" "quail-hebrew"))
 
 (define-language-environment 'hebrew
   "Hebrew"
     (set-default-buffer-file-coding-system 'iso-8859-8)
     (setq terminal-coding-system    'iso-8859-8)
     (setq keyboard-coding-system    'iso-8859-8)
-;;  (setq-default quail-current-package
-;;                (assoc "hebrew" quail-package-alist))))
+    (setq-default quail-current-package
+		  (assoc "hebrew" quail-package-alist))
     ))

File lisp/mule/ipa-hooks.el

 ;;; OTHERS
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(add-hook 'quail-package-alist '("ipa" "quail/ipa"))
+(add-hook 'quail-package-alist '("ipa" "quail-ipa"))
 

File lisp/mule/isearch-mule.el

     (isearch-fep-quail  isearch-fep-prompt-quail  isearch-fep-read-quail)))
 
 ;; the followings are defined in isearch.el
-;;  (define-key isearch-mode-map "\C-k"  'isearch-fep-string)
-;;  (define-key isearch-mode-map "\C-\\" 'isearch-fep-egg)
-;;  (define-key isearch-mode-map "\M-k"  'isearch-fep-egg)
-;;  (define-key isearch-mode-map "\C-o"  'isearch-fep-canna)
+(define-key isearch-mode-map "\C-k"  'isearch-fep-string)
+(define-key isearch-mode-map "\C-\\" 'isearch-fep-egg)
+(define-key isearch-mode-map "\M-k"  'isearch-fep-egg)
+(define-key isearch-mode-map "\C-o"  'isearch-fep-canna)
 ;;  (define-key isearch-mode-map "\C-\]" 'isearch-fep-quail)
 
 (defun isearch-fep-mode ()

File lisp/mule/japanese-hooks.el

    mnemonic "EUC/Ja"
    ))
 
+;; EGG specific setup
+(define-egg-environment 'japanese
+  "Japanese settings for egg."
+  (lambda ()
+    (when (not (featurep 'egg-jpn))
+      (load "its/its-hira")
+      (load "its/its-kata")
+      (load "its/its-hankaku")
+      (load "its/its-zenkaku")
+      (setq its:*standard-modes*
+	    (append
+	     (list (its:get-mode-map "roma-kana")
+		   (its:get-mode-map "roma-kata")
+		   (its:get-mode-map "downcase")
+		   (its:get-mode-map "upcase")
+		   (its:get-mode-map "zenkaku-downcase")
+		   (its:get-mode-map "zenkaku-upcase"))
+	     its:*standard-modes*))
+      (provide 'egg-jpn))
+    (setq wnn-server-type 'jserver)
+    (setq egg-default-startup-file "eggrc-wnn")
+    (setq-default its:*current-map* (its:get-mode-map "roma-kana"))))
+
 (define-language-environment 'japanese
   "Japanese (includes JIS and EUC)"
   (lambda ()
     (set-coding-priority-list '(iso-7 iso-8-2 shift-jis no-conversion))
     ;;'(iso-8-2 iso-8-designate iso-8-1 shift-jis big5)
     
-    ;; EGG specific setup 97.02.05 jhod
-    (when (featurep 'egg)
-      (when (not (featurep 'egg-jpn))
-	(provide 'egg-jpn)
-	(setq wnn-server-type 'jserver)
-	(load "its/its-hira")
-	(load "its/its-kata")
-	(load "its/its-hankaku")
-	(load "its/its-zenkaku")
-	(setq its:*standard-modes*
-	      (append
-	       (list (its:get-mode-map "roma-kana")
-		     (its:get-mode-map "roma-kata")
-		     (its:get-mode-map "downcase")
-		     (its:get-mode-map "upcase")
-		     (its:get-mode-map "zenkaku-downcase")
-		     (its:get-mode-map "zenkaku-upcase"))
-	       its:*standard-modes*)))
-      (setq-default its:*current-map* (its:get-mode-map "roma-kana")))
-
     ;; Added by mrb, who doesn't speak japanese - so be sceptical...
     ;; (when (string-match "solaris\\|sunos" system-configuration)
     ;;(set-native-coding-system          'euc-japan) ; someday

File lisp/mule/korean-hooks.el

 (loop for row from 38 to  41  do (modify-syntax-entry `[korean-ksc5601 ,row] "."))
 (loop for row from 42 to 126  do (modify-syntax-entry `[korean-ksc5601 ,row] "w"))
 
-;; EGG specific setup
-;(if (featurep 'egg)
-;    (progn
-;      (load "its-hangul")
-;      (setq its:*standard-modes*
-;	    (cons (its:get-mode-map "hangul") its:*standard-modes*))
-;      (setq-default its:*current-map* (its:get-mode-map "hangul"))))
-
-;(add-hook 'quail-package-alist '("hangul"    "quail/hangul"))
-;(add-hook 'quail-package-alist '("hangul3"   "quail/hangul3"))
-;(add-hook 'quail-package-alist '("hanja-jis" "quail/hanja-jis"))
-;(add-hook 'quail-package-alist '("hanja-ksc" "quail/hanja-ksc"))
+(add-hook 'quail-package-alist '("hangul"    "quail-hangul"))
+(add-hook 'quail-package-alist '("hangul3"   "quail-hangul3"))
+(add-hook 'quail-package-alist '("hanja-jis" "quail-hanja-jis"))
+(add-hook 'quail-package-alist '("hanja-ksc" "quail-hanja-ksc"))
 
 (make-coding-system
  'euc-korea 'iso2022
    mnemonic "ISO7/Ko"
    ))
 
+;; EGG specific setup
+(define-egg-environment 'korean
+  "Korean settings for egg"
+  (lambda ()
+    (when (not (featurep 'egg-kor))
+      (load "its-hangul")
+      (setq its:*standard-modes*
+	    (cons (its:get-mode-map "hangul") its:*standard-modes*))
+      (provide 'egg-kor))
+    (setq wnn-server-type 'kserver)
+    (setq egg-default-startup-file "eggrc-wnn")
+    (setq-default its:*current-map* (its:get-mode-map "hangul"))))
+
 (define-language-environment 'korean
   "Korean"
   (lambda ()
 	    (cons (its:get-mode-map "hangul") its:*standard-modes*)))
       (setq-default its:*current-map* (its:get-mode-map "hangul")))
 
-;    (setq-default quail-current-package
-;                  (assoc "hangul" quail-package-alist))))
+    (setq-default quail-current-package
+		  (assoc "hangul" quail-package-alist))
     ))

File lisp/mule/mule-files.el

 (setq-default buffer-file-coding-system 'iso-2022-8)
 (put 'buffer-file-coding-system 'permanent-local t)
 
-(define-obsolete-variable-alias 'file-coding-system 'buffer-file-coding-system)
+(define-obsolete-variable-alias
+  'file-coding-system
+  'buffer-file-coding-system)
+
+(define-obsolete-variable-alias
+  'overriding-file-coding-system
+  'coding-system-for-read)
 
 (defvar buffer-file-coding-system-for-read 'automatic-conversion
   "Coding system used when reading a file.

File lisp/mule/mule-keyboard.el

   (self-insert-internal char)
   (check-auto-fill))
 
+;; ### I think this is the right function to put this on... must check further
+;; wire us into pending-delete
+(put 'keyboard-self-insert-do-insert 'pending-delete t)
+
 (defun keyboard-use-local-map-do-insert (map)
   (use-local-map map))
 

File lisp/mule/mule-misc.el

-;;; mule-misc.el --- Miscellaneous Mule functions.
+;; mule-misc.el --- Miscellaneous Mule functions.
 
 ;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Amdahl Corporation.
   (let ((func (get env 'set-lang-environ)))
     (if (not (null func))
 	(funcall func)))
-  (setq current-language-environment env))
+  (setq current-language-environment env)
+  (if (fboundp 'egg)
+      (egg-lang-switch-callback))
+;;  (if (fboundp 'quail)
+;;      (quail-lang-switch-callback))
+)
 
 (defun define-language-environment (env-sym doc-string enable-function)
   "Define a new language environment, named by ENV-SYM.
   (put env-sym 'lang-environ-doc-string doc-string)
   (put env-sym 'set-lang-environ enable-function)
   (setq language-environment-list (cons env-sym language-environment-list)))
+
+(defun define-egg-environment (env-sym doc-string enable-function)
+  "Define a new language environment for egg, named by ENV-SYM.
+DOC-STRING should be a string describing the environment.
+ENABLE-FUNCTION should be a function of no arguments that will be called
+when the language environment is made current."
+  (put env-sym 'egg-environ-doc-string doc-string)
+  (put env-sym 'set-egg-environ enable-function))
+
+(defun define-quail-environment (env-sym doc-string enable-function)
+  "Define a new language environment for quail, named by ENV-SYM.
+DOC-STRING should be a string describing the environment.
+ENABLE-FUNCTION should be a function of no arguments that will be called
+when the language environment is made current."
+  (put env-sym 'quail-environ-doc-string doc-string)
+  (put env-sym 'set-quail-environ enable-function))
+

File lisp/mule/thai-hooks.el

    pre-write-conversion decompose-region
    ))
 
-(add-hook 'quail-package-alist '("thai" "quail/thai"))
+(add-hook 'quail-package-alist '("thai" "quail-thai"))
 
 (define-language-environment 'thai
   "Thai"
   (lambda ()
     (set-coding-category-system 'iso-8-designate 'tis620)
     (set-coding-priority-list '(iso-8-designate iso-8-1))
-    (set-default-buffer-file-coding-system 'tis620)))
-    ;;(setq-default quail-current-package (assoc "thai" quail-package-alist))))
+    (set-default-buffer-file-coding-system 'tis620)
+    (setq-default quail-current-package (assoc "thai" quail-package-alist))
+    ))

File lisp/mule/vietnamese-hooks-2.el

       (loop
 	  (write-read-repeat
 	   r0
-	   [ 0 1 ?,2F(B 3 4 ?,2G(B ?,2g(B 7 8 9 10 11 12 13 14 15
-	     16 17 18 19 ?,2V(B 21 22 23 24 ?,2[(B 26 27 28 29 ?,2\(B 31
+	   [ 0 1 ?-2� 3 4 ?� ?� 7 8 9 10 11 12 13 14 15-A
+	     16 17 18 19 ?-2� 21 22 23 24 ?� 26 27 28 29 ?� 31-A
 	     32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
 	     48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
 	     64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
 	     80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
 	     96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
 	     112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 
-	     ?,2U(B ?,2!(B ?,2"(B ?,2#(B ?,2$(B ?,2%(B ?,2&(B ?,2'(B ?,2((B ?,2)(B ?,2*(B ?,2+(B ?,2,(B ?,2-(B ?,2.(B ?,2/(B
-	     ?,20(B ?,21(B ?,22(B ?,25(B ?,2~(B ?,2>(B ?,26(B ?,27(B ?,28(B ?,2v(B ?,2w(B ?,2o(B ?,2|(B ?,2{(B ?,2x(B ?,2O(B
-	     ?,2u(B ?,1!(B ?,1"(B ?,1#(B ?,1$(B ?,1%(B ?,1&(B ?,1'(B ?,1((B ?,1)(B ?,1*(B ?,1+(B ?,1,(B ?,1-(B ?,1.(B ?,1/(B
-	     ?,10(B ?,11(B ?,12(B ?,2^(B ?,2=(B ?,15(B ?,16(B ?,17(B ?,18(B ?,2q(B ?,2Q(B ?,2W(B ?,2X(B ?,1=(B ?,1>(B ?,2_(B
-	     ?,2`(B ?,2a(B ?,2b(B ?,2c(B ?,2d(B ?,2e(B ?,1F(B ?,1G(B ?,2h(B ?,2i(B ?,2j(B ?,2k(B ?,2l(B ?,2m(B ?,2n(B ?,1O(B
-	     ?,2p(B ?,1Q(B ?,2r(B ?,2s(B ?,2t(B ?,1U(B ?,1V(B ?,1W(B ?,1X(B ?,2y(B ?,2z(B ?,1[(B ?,1\(B ?,2}(B ?,1^(B ?,1_(B
-	     ?,1`(B ?,1a(B ?,1b(B ?,1c(B ?,1d(B ?,1e(B ?,1f(B ?,1g(B ?,1h(B ?,1i(B ?,1j(B ?,1k(B ?,1l(B ?,1m(B ?,1n(B ?,1o(B
-	     ?,1p(B ?,1q(B ?,1r(B ?,1s(B ?,1t(B ?,1u(B ?,1v(B ?,1w(B ?,1x(B ?,1y(B ?,1z(B ?,1{(B ?,1|(B ?,1}(B ?,1~(B ?,2f(B ]))))
+	     ?-2� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?�-A
+	     ?-2� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?�-A
+	     ?-2� ?-1� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?�-A
+	     ?-1� ?� ?� ?-2� ?� ?-1� ?� ?� ?� ?-2� ?� ?� ?� ?-1� ?� ?-2�-A
+	     ?-2� ?� ?� ?� ?� ?� ?-1� ?� ?-2� ?� ?� ?� ?� ?� ?� ?-1�-A
+	     ?-2� ?-1� ?-2� ?� ?� ?-1� ?� ?� ?� ?-2� ?� ?-1� ?� ?-2� ?-1� ?�-A
+	     ?-1� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?�-A
+	     ?-1� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?-2� ]))))-A
   "CCL program to read VISCII 1.1")
 
 (define-ccl-program ccl-write-viscii
   '(((read r0)
       (loop
 	  (write-read-repeat r0
-       [0 ?,2z(B ?,2x(B 3 ?,2W(B ?,2X(B ?,2f(B 7 8 9 10 11 12 13 14 15
-	16 ?,2Q(B ?,2_(B ?,2O(B ?,2V(B ?,2[(B ?,2}(B ?,2\(B 24 25 26 27 28 29 30 31
+       [0 ?-2� ?� 3 ?� ?� ?� 7 8 9 10 11 12 13 14 15-A
+	16 ?-2� ?� ?� ?� ?� ?� ?� 24 25 26 27 28 29 30 31-A
 	32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
 	48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
 	64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
 	80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
 	96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
 	112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 
-	?,2`(B ?,2d(B ?,2c(B ?,2a(B ?,2U(B ?,2#(B ?,2'(B ?,2h(B ?,2k(B ?,2((B ?,2i(B ?,2)(B ?,2.(B ?,2l(B ?,2o(B ?,2n(B
-	?,2m(B ?,28(B ?,2r(B ?,2v(B ?,2u(B ?,2s(B ?,2w(B ?,25(B ?,26(B ?,27(B ?,2^(B ?,2>(B ?,2~(B ?,2y(B ?,2|(B ?,2{(B
-	160 ?,2e(B ?,2b(B ?,2j(B ?,2t(B ?,2=(B ?,2_(B ?,2p(B ?,1e(B ?,1b(B ?,1j(B ?,1t(B ?,1>(B ?,1y(B ?,1p(B ?,2"(B
-	192 193 194 195 196 ?,1`(B ?,1d(B ?,1c(B ?,1a(B ?,1U(B ?,2F(B ?,1"(B ?,1F(B ?,1G(B ?,1!(B ?,2G(B
-	?,2!(B ?,2%(B ?,2&(B ?,2g(B ?,2%(B ?,2+(B ?,1#(B ?,1%(B ?,1&(B ?,1g(B ?,1$(B ?,1'(B ?,1h(B ?,2,(B ?,1k(B ?,1((B
-	?,1i(B ?,1)(B ?,1+(B ?,1,(B ?,1-(B ?,1*(B ?,1.(B ?,1l(B ?,1o(B ?,2-(B ?,2*(B ?,20(B ?,1n(B ?,1m(B ?,18(B ?,1r(B
-	?,21(B ?,1v(B ?,1u(B ?,1s(B ?,1w(B ?,10(B ?,11(B ?,12(B ?,1/(B ?,15(B ?,16(B ?,17(B ?,1^(B ?,1>(B ?,1~(B ?,1y(B
-	?,22(B ?,1|(B ?,1{(B ?,1z(B ?,1x(B ?,1W(B ?,1X(B ?,1f(B ?,1Q(B ?,1q(B ?,1O(B ?,1V(B ?,1[(B ?,1}(B ?,1\(B ?,2/(B]))))
+	?-2� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?�-A
+	?-2� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?�-A
+	160 ?-2� ?� ?� ?� ?� ?� ?� ?-1� ?� ?� ?� ?� ?� ?� ?-2�-A
+	192 193 194 195 196 ?-1� ?� ?� ?� ?� ?-2� ?-1� ?� ?� ?� ?-2�-A
+	?-2� ?� ?� ?� ?� ?� ?-1� ?� ?� ?� ?� ?� ?� ?-2� ?-1� ?�-A
+	?-1� ?� ?� ?� ?� ?� ?� ?� ?� ?-2� ?� ?� ?-1� ?� ?� ?�-A
+	?-2� ?-1� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?�-A
+	?-2� ?-1� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?� ?-2�]))))-A
   "CCL program to read VSCII-1.")
 
 (define-ccl-program ccl-write-vscii
 ;; (set-charset-ccl-program 'vietnamese-lower ccl-vietnamese-lower-to-vscii)
 ;; (set-charset-ccl-program 'vietnamese-upper ccl-vietnamese-upper-to-vscii)
 
-(add-hook 'quail-package-alist '("viqr" "quail/viet"))
+(add-hook 'quail-package-alist '("viqr" "quail-viet"))
 
 (define-language-environment 'vietnamese
   "Vietnamese"

File lisp/mule/visual-mode.el

 (defvar *visual-punctuations*
   '(?  ?. ?, ?: ?; ?? ?! ?- ?_ ?' ?\" ?/ ?( ?) ?[ ?] ?{ ?} ?\n ?\t ; ASCII
     ?  ?. ?, ?: ?; ?? ?! ?- ?_ ?' ?" ?( ?) ?[ ?]		   ; Hebrew
-    ?[2](3![0](B ?[2](3&[0](B ?[2](3%[0](B ?[2](3)[0](B ?[2](3"[0](B ?[2](3'[0](B ?[2](3([0](B ?[2](3#[0](B ?[2](3$[0](B ?[2](3*[0](B ?[2](3+[0](B ))				   ; Arabic
+    ?�2](3!�0](B ?�2](3&�0](B ?�2](3%�0](B ?�2](3)�0](B ?�2](3"�0](B ?�2](3'�0](B ?�2](3(�0](B ?�2](3#�0](B ?�2](3$�0](B ?�2](3*�0](B ?�2](3+�0](B ))				   ; Arabic
 
 (defun visual-forward-word (arg)
   "Move the cursor visually forward by ARG (integer) words.
   (if display-direction
       (visual-backward-char arg)))
 
+;; wire us into pending-delete
+(put 'visual-self-insert-command 'pending-delete t)
+
 (defun visual-newline (arg)
   "newline command for visual-mode.
 With ARG (integer), insert that many newlines."

File lisp/packages/balloon-help.el

-;;; Balloon help for XEmacs (requires 19.12 or later)
+;;; Balloon help for XEmacs (requires 19.15 or later)
 ;;; Copyright (C) 1995, 1997 Kyle E. Jones
 ;;;
 ;;; This program is free software; you can redistribute it and/or modify
 ;; following line to your .emacs:
 ;;
 ;; (require 'balloon-help)
+;; (balloon-help-mode 1)
 ;;
-;; For 19.12 users:
-;;    If you are using fvwm, [tv]twm or ol[v]wm, you can also add
-;;    the following lines to various configuration file to use
-;;    minimal decorations on the balloon help frames.
+;; The balloon-help frame is a transient window that is not
+;; normally decorated by window managers, so the following
+;; window manager directives may not be needed.  But if they
+;; are:
 ;;
-;;    In .emacs:
-;;       (setq balloon-help-frame-name "balloon-help")
+;; For ol[v]wm use this in .Xdefaults:
+;;    olvwm.NoDecor: balloon-help
+;;      or
+;;    olwm.MinimalDecor: balloon-help
 ;;
-;;    For ol[v]wm use this in .Xdefaults:
-;;       olvwm.NoDecor: balloon-help
-;;         or
-;;       olwm.MinimalDecor: balloon-help
+;; For fvvm version 1 use this in your .fvwmrc:
+;;    NoTitle balloon-help
+;; or
+;;    Style "balloon-help" NoTitle, NoHandles, BorderWidth 0
 ;;
-;;    For fvvm use this in your .fvwmrc:
-;;       NoTitle balloon-help
-;;    or
-;;       Style "balloon-help" NoTitle, NoHandles, BorderWidth 0
+;; For twm use this in your .twmrc:
+;;    NoTitle { "balloon-help" }
 ;;
-;;    For twm use this in your .twmrc:
-;;       NoTitle { "balloon-help" }
-;; 
-;; Under 19.13 and later versions the balloon-help frame uses a
-;; transient window that is not normally decorated by window
-;; managers.  So the window manager directives should not be
-;; needed for XEmacs 19.13 and beyond.
 
 (provide 'balloon-help)
 
-(defvar balloon-help-version "1.05"
+(require 'custom)
+
+(defgroup balloon-help nil
+  "Balloon-help support in XEmacs"
+  :group 'frames)
+
+(defvar balloon-help-version "1.06"
   "Version string for Balloon Help.")
 
-(defvar balloon-help-mode t
+(defvar balloon-help-mode nil
   "*Non-nil means Balloon help mode is enabled.")
 
-(defvar balloon-help-timeout 1500
-  "*Display help after this many milliseconds of mouse inactivity.")
+(defcustom balloon-help-timeout 1500
+  "*Display help after this many milliseconds of mouse inactivity."
+  :type 'integer
+  :group 'balloon-help)
 
-(defvar balloon-help-foreground "black"
-  "*The foreground color for displaying balloon help text.")
+(defcustom balloon-help-foreground "black"
+  "*The foreground color for displaying balloon help text."
+  :type 'string
+  :group 'balloon-help)
 
-(defvar balloon-help-background "rgb:c0/c0/c0"
-  "*The background color for the balloon help frame.")
+(defcustom balloon-help-background "gray80"
+  "*The background color for the balloon help frame."
+  :type 'string
+  :group 'balloon-help)
 
-(defvar balloon-help-background-pixmap ""
-  "*The background pixmap for the balloon help frame.")
+(defcustom balloon-help-background-pixmap ""
+  "*The background pixmap for the balloon help frame."
+  :type 'string
+  :group 'balloon-help)
 
-(defvar balloon-help-font "fixed"
-  "*The font for displaying balloon help text.")
+(defcustom balloon-help-font "variable"
+  "*The font for displaying balloon help text."
+  :type 'string
+  :group 'balloon-help)
 
-(defvar balloon-help-border-color "black"
-  "*The color for displaying balloon help frame's border.")
+(defcustom balloon-help-border-color "black"
+  "*The color for displaying balloon help frame's border."
+  :type 'string
+  :group 'balloon-help)
 
-(defvar balloon-help-border-width 2
-  "*The width of the balloon help frame's border.")
+(defcustom balloon-help-border-width 1
+  "*The width of the balloon help frame's border."
+  :type 'integer
+  :group 'balloon-help)
 
-(defvar balloon-help-use-sound nil
+(defcustom balloon-help-use-sound nil
   "*Non-nil value means play a sound to herald the appearance
 and disappearance of the help frame.
 
 `balloon-help-disappears' will be played when the frame disappears.
 
 See the documentation for the function load-sound-file to see how
-define sounds.")
+define sounds."
+  :type 'boolean
+  :group 'balloon-help)
 
-(defvar balloon-help-frame-name nil
-  "*The frame name to use for the frame to display the balloon help.")
+(defcustom balloon-help-frame-name "balloon-help"
+  "*The frame name to use for the frame to display the balloon help."
+  :type 'string
+  :group 'balloon-help)
 
-(defvar balloon-help-aggressively-follow-mouse nil
+(defcustom balloon-help-aggressively-follow-mouse nil
   "*Non-nil means the balloon should move with the mouse even if the mouse
-is over the same object as the last mouse motion event.")
+is over the same object as the last mouse motion event."
+  :type 'boolean
+  :group 'balloon-help)
 
 ;;;
 ;;; End of user variables.
 
 (defvar mouse-motion-hook mouse-motion-handler
   "Hooks to be run whenever the user moves the mouse.
-Each hook is called with one argument, the mouse motion event.")
+Each hook is called with one argument, the mouse motion event.
+This hooks variable does not exist unless the \"balloon-help\" library
+has been loaded.")
 
 (defun mouse-motion-hook (event)
   "Run the hooks attached to mouse-motion-hook."
 (defvar balloon-help-frame nil
   "Balloon help is displayed in this frame.")
 
+(defvar balloon-help-junk-frame nil
+  "Junk parent frame of balloon-help-frame.")
+
 (defvar balloon-help-help-object nil
   "Object that the mouse is over that has a help property, nil otherwise.")
 
 (defvar balloon-help-help-object-y nil
   "Last vertical mouse position over balloon-help-help-object.")
 
-(defvar balloon-help-buffer nil
+(defvar balloon-help-buffer (get-buffer-create " *balloon-help*")
   "Buffer used to display balloon help.")
 
 (defvar balloon-help-timeout-id nil
 
 (defun balloon-help-displayed ()
   (and (frame-live-p balloon-help-frame)
-       (frame-visible-p balloon-help-frame)))
+       (frame-visible-p balloon-help-frame)
+       (eq (frame-device balloon-help-frame) (selected-device))))
+
+(defun balloon-help (&optional event)
+  "Display Balloon Help for the object under EVENT.
+If EVENT is nil, then point in the selected window is used instead.
+See the documentation for balloon-help-mode to find out what this means.
+This command must be bound to a mouse event."
+  (interactive "e")
+  (unless (device-on-window-system-p)
+    (error "Cannot display balloon help on %s device" (device-type)))
+  (let ((balloon-help-mode t))
+    (balloon-help-motion-hook event))
+  (when balloon-help-timeout-id
+    (disable-timeout balloon-help-timeout-id)
+    (setq balloon-help-timeout-id nil))
+  (balloon-help-display-help))
 
 (defun balloon-help-motion-hook (event)
   (cond
    ((null balloon-help-mode) t)
-   ((button-press-event-p event)
-    (setq balloon-help-help-object nil)
-    (if balloon-help-timeout-id
-	(disable-timeout balloon-help-timeout-id))
-    (if (balloon-help-displayed)
-	(balloon-help-undisplay-help)))
    (t
-    (let* ((buffer (event-buffer event))
-	   (frame (event-frame event))
-	   (point (and buffer (event-point event)))
-	   (modeline-point (and buffer (event-modeline-position event)))
+    (let* ((buffer (if event (event-buffer event) (current-buffer)))
+	   (frame (if event (event-frame event) (selected-frame)))
+	   (point (if event (event-point event) (point)))
+	   (modeline-point (if event (event-modeline-position event)))
 	   (modeline-extent (and modeline-point
 				 (map-extents
 				  (function (lambda (e ignored) e))
 				  modeline-point modeline-point
 				  nil nil
 				  'balloon-help)))
-	   (glyph-extent (event-glyph-extent event))
+	   (glyph-extent (and event (event-glyph-extent event)))
 	   (glyph-extent (if (and glyph-extent
 				  (extent-property glyph-extent
 						   'balloon-help))
 			     glyph-extent))
 	   (extent (and point
 			(extent-at point buffer 'balloon-help)))
-	   (button (event-toolbar-button event))
+	   (button (and event (event-toolbar-button event)))
 	   (button (if (and button (toolbar-button-help-string button))
 		       button
 		     nil))
 		   (not (eq frame balloon-help-frame)))
 	      (progn
 		(setq balloon-help-help-object nil)
-		(if id
-		    (disable-timeout id))
+		(when id
+		  (disable-timeout id)
+		  (setq balloon-help-timeout-id nil))
 		(if (balloon-help-displayed)
 		    (balloon-help-undisplay-help))))
 	(let* ((params (frame-parameters frame))
 			 (save-excursion (set-buffer buffer) current-menubar))
 		    22 0)))
 	  (setq balloon-help-help-object-x
-		(+ left xleft-toolbar-width (event-x-pixel event))
+		(if event
+		    (+ left xleft-toolbar-width
+		       (event-x-pixel event))
+		  (/ (* (device-pixel-width) 2) 5))
 		balloon-help-help-object-y
-		(+ top xtop-toolbar-height menubar-height
-		   (event-y-pixel event))))
+		(if event
+		    (+ top xtop-toolbar-height menubar-height
+		       (event-y-pixel event))
+		  (/ (* (device-pixel-height) 2) 5))))
 	(cond ((eq frame balloon-help-frame) t)
 	      ((eq object balloon-help-help-object)
 	       (if (and (balloon-help-displayed)
 				  (function balloon-help-display-help)
 				  nil)))))))))
 
-(defun balloon-help-pre-command-hook (&rest ignored)
-  (setq balloon-help-help-object nil)
-  (if (balloon-help-displayed)
-      (balloon-help-undisplay-help)))
-
-(fset 'balloon-help-post-command-hook 'balloon-help-pre-command-hook)
-(fset 'balloon-help-mouse-leave-frame-hook 'balloon-help-pre-command-hook)
-(fset 'balloon-help-deselect-frame-hook 'balloon-help-pre-command-hook)
-
 (defun balloon-help-display-help (&rest ignored)
   (setq balloon-help-timeout-id nil)
-  (if balloon-help-help-object
+  (if (and balloon-help-help-object (device-on-window-system-p))
       (let* ((object balloon-help-help-object)
 	     (help (or (and (extent-live-p object)
 			    (extent-property object 'balloon-help))
 	     (setq help (format "help function signaled: %S" data)))))
 	(if (stringp help)
 	    (save-excursion
-	      (if (not (bufferp balloon-help-buffer))
-		  (setq balloon-help-buffer
-			(get-buffer-create " *balloon-help*")))
-	      (if (not (frame-live-p balloon-help-frame))
+	      (if (or (not (frame-live-p balloon-help-frame))
+		      (not (eq (selected-device)
+			       (frame-device balloon-help-frame))))
 		  (setq balloon-help-frame (balloon-help-make-help-frame)))
 	      (set-buffer balloon-help-buffer)
 	      (erase-buffer)
 	      (insert help)
 	      (if (not (bolp))
 		  (insert ?\n))
-	      ;; help strings longer than 2 lines have the last
-	      ;; line stolen by the minibuffer, so make sure the
-	      ;; last line is blank.  Make the top line blank for
-	      ;; some symmetry.
-	      (if (< 2 (count-lines (point-min) (point-max)))
-		  (progn
-		    (insert ?\n)
-		    ;; add a second blank line at the end to
-		    ;; prevent the modeline bar from clipping the
-		    ;; descenders of the last line of text.
-		    (insert ?\n)
-		    (goto-char (point-min))
-		    (insert ?\n)))
-	      ;; cursor will be at point-min because we're just
-	      ;; moving point which doesn't affect window-point
-	      ;; when the window isn't selected.  Indent
-	      ;; everything so that the cursor will be over a
-	      ;; space.  The 1-pixel bar cursor will be
-	      ;; completely invisible this way.
+;;;	      ;; help strings longer than 2 lines have the last
+;;;	      ;; line stolen by the minibuffer, so make sure the
+;;;	      ;; last line is blank.  Make the top line blank for
+;;;	      ;; some symmetry.
+;;;	      (if (< 2 (count-lines (point-min) (point-max)))
+;;;		  (progn
+;;;		    (insert ?\n)
+;;;		    ;; add a second blank line at the end to
+;;;		    ;; prevent the modeline bar from clipping the
+;;;		    ;; descenders of the last line of text.
+;;;		    (insert ?\n)
+;;;		    (goto-char (point-min))
+;;;		    (insert ?\n)))
+	      ;; indent everything by a space for readability
  	      (indent-rigidly (point-min) (point-max) 1)
+	      (balloon-help-set-frame-properties)
+	      (balloon-help-resize-help-frame)
 	      (balloon-help-move-help-frame)
-	      (balloon-help-resize-help-frame)
 	      (balloon-help-expose-help-frame))))))
 
 (defun balloon-help-undisplay-help ()
 	    (play-sound 'balloon-help-appears))
 	(setq balloon-help-display-pending t))))
 
+(defun balloon-help-set-frame-properties ()
+  (let ((frame balloon-help-frame))
+    ;; don't set the font unconditionally because it makes the
+    ;; frame size flap visibly while XEmacs figures out the new
+    ;; frame size.
+    (if (not (equal (face-font 'default frame) balloon-help-font))
+	(set-face-font 'default balloon-help-font frame))
+    (set-face-foreground 'default balloon-help-foreground frame)
+    (set-face-background 'default balloon-help-background frame)
+    (set-face-background 'modeline balloon-help-background frame)
+    (set-face-background-pixmap 'default balloon-help-background-pixmap frame)
+    (set-frame-property frame 'border-color balloon-help-border-color)
+    (set-frame-property frame 'border-width balloon-help-border-width)))
+
+;;;(defun balloon-help-resize-help-frame ()
+;;;  (save-excursion
+;;;    (set-buffer balloon-help-buffer)
+;;;    (let ((longest 0)
+;;;	  (lines 0)
+;;;	  (done nil)
+;;;	  (window-min-height 1)
+;;;	  (window-min-width 1))
+;;;      (goto-char (point-min))
+;;;      (while (not done)
+;;;	(end-of-line)
+;;;	(setq longest (max longest (current-column))
+;;;	      done (not (= 0 (forward-line))))
+;;;	(and (not done) (setq lines (1+ lines))))
+;;;      (set-frame-size balloon-help-frame (+ 1 longest) lines))))
+
 (defun balloon-help-resize-help-frame ()
   (save-excursion
     (set-buffer balloon-help-buffer)
-    (let ((longest 0)
-	  (lines 0)
-	  (done nil)
-	  (window-min-height 1)
-	  (window-min-width 1))
+    (let* ((longest 0)
+	   (lines 0)
+	   (done nil)
+	   (inst (vector 'string ':data nil))
+	   (window (frame-selected-window balloon-help-frame))
+	   (font-width (font-width (face-font 'default) balloon-help-frame))
+	   start width
+	   (window-min-height 1)
+	   (window-min-width 1))
       (goto-char (point-min))
       (while (not done)
+	(setq start (point))
 	(end-of-line)
-	(setq longest (max longest (current-column))
+	(aset inst 2 (buffer-substring start (point)))
+	(setq longest (max longest (glyph-width (make-glyph inst) window))
 	      done (not (= 0 (forward-line))))
 	(and (not done) (setq lines (1+ lines))))
-      (set-frame-size balloon-help-frame (+ 1 longest) lines))))
+      (setq width (/ longest font-width)
+	    width (if (> longest (* width font-width)) (1+ width) width))
+      (set-frame-size balloon-help-frame (+ 0 width) lines))))
+
+(defun balloon-help-compute-help-frame-y-location ()
+  (let* ((device-bottom (device-pixel-height
+			 (frame-device balloon-help-frame)))
+	 (y-pos (max 0 (+ 48 balloon-help-help-object-y)))
+	 (height (frame-pixel-height balloon-help-frame))
+	 (bottom (+ y-pos height)))
+    (if (>= bottom device-bottom)
+	(setq y-pos (max 0 (- y-pos (- bottom device-bottom)))))
+    y-pos ))
+
+(defun balloon-help-compute-help-frame-x-location ()
+  (let* ((device-right (device-pixel-width (frame-device balloon-help-frame)))
+	 (x-pos (max 0 (+ 32 balloon-help-help-object-x)))
+	 (width (frame-pixel-width balloon-help-frame))
+	 (right (+ x-pos width)))
+    (if (>= right device-right)
+	(setq x-pos (max 0 (- x-pos (- right device-right)))))
+    x-pos ))
+
+(defun balloon-help-move-help-frame ()
+  (let ((x (balloon-help-compute-help-frame-x-location))
+	(y (balloon-help-compute-help-frame-y-location)))
+    (set-frame-position balloon-help-frame x y)))
 
 (defun balloon-help-make-junk-frame ()
   (let ((window-min-height 1)
 	(window-min-width 1))
-    (save-excursion
-      (set-buffer (generate-new-buffer "*junk-frame-buffer*"))
-      (prog1
-	  (make-frame '(minibuffer t initially-unmapped t width 1 height 1))
-	(rename-buffer " *junk-frame-buffer*" t)))))
+    (when (framep balloon-help-junk-frame)
+      (delete-frame balloon-help-junk-frame)
+      (setq balloon-help-junk-frame nil))
+    (prog1
+	(setq balloon-help-junk-frame
+	      (make-frame '(minibuffer t
+			    initially-unmapped t
+			    width 1
+			    height 1)))
+      (set-window-buffer (frame-selected-window balloon-help-junk-frame)
+			 balloon-help-buffer))))
 
 (defun balloon-help-make-help-frame ()
+  (when (framep balloon-help-frame)
+    (delete-frame balloon-help-frame)
+    (setq balloon-help-frame nil))
   (save-excursion
     (set-buffer balloon-help-buffer)
+    (setq truncate-lines t)
     (set-buffer-menubar nil)
     (let* ((x (balloon-help-compute-help-frame-x-location))
 	   (y (balloon-help-compute-help-frame-y-location))
 	   (window-min-height 1)
 	   (window-min-width 1)
+	   (junk-frame (balloon-help-make-junk-frame))
 	   (frame (make-frame (list
 			       '(initially-unmapped . t)
 			       ;; try to evade frame decorations
-			       (cons 'name (or balloon-help-frame-name
-					       "xclock"))
+			       (cons 'name balloon-help-frame-name)
 			       (cons 'border-width balloon-help-border-width)
 			       (cons 'border-color balloon-help-border-color)
 			       (cons 'top y)
 			       (cons 'left x)
-			       (cons 'popup (balloon-help-make-junk-frame))
+			       (cons 'popup junk-frame)
+			       (cons 'minibuffer
+				     (minibuffer-window junk-frame))
 			       '(width . 3)
 			       '(height . 1)))))
       (set-face-font 'default balloon-help-font frame)
       (set-specifier left-toolbar-width (cons frame 0))
       (set-specifier right-toolbar-width (cons frame 0))
       (set-specifier bottom-toolbar-height (cons frame 0))
+      (set-specifier top-toolbar-visible-p (cons frame nil))
+      (set-specifier left-toolbar-visible-p (cons frame nil))
+      (set-specifier right-toolbar-visible-p (cons frame nil))
+      (set-specifier bottom-toolbar-visible-p (cons frame nil))
       (set-specifier top-toolbar (cons frame nil))
       (set-specifier left-toolbar (cons frame nil))
       (set-specifier right-toolbar (cons frame nil))
       (set-specifier bottom-toolbar (cons frame nil))
       (set-specifier scrollbar-width (cons frame 0))
       (set-specifier scrollbar-height (cons frame 0))
-      (and (boundp 'text-cursor-visible-p)
-	   (specifierp text-cursor-visible-p)
-	   (set-specifier text-cursor-visible-p (cons frame nil)))
+      (set-specifier text-cursor-visible-p (cons frame nil))
+      (set-specifier has-modeline-p (cons frame nil))
       (set-specifier modeline-shadow-thickness (cons frame 0))
+      (set-specifier (glyph-image truncation-glyph) [nothing] frame '(x))
       (set-face-background 'modeline balloon-help-background frame)
       frame )))
 
-(defun balloon-help-compute-help-frame-x-location ()
-  (max 0 (+ 32 balloon-help-help-object-x)))
+(defun balloon-help-pre-command-hook ()
+  (unless (eq this-command 'balloon-help)
+    (balloon-help-go-away)))
 
-(defun balloon-help-compute-help-frame-y-location ()
-  (max 0 (+ 48 balloon-help-help-object-y)))
+(defun balloon-help-go-away (&rest ignored)
+  (setq balloon-help-help-object nil)
+  (if (balloon-help-displayed)
+      (balloon-help-undisplay-help)))
 
-(defun balloon-help-move-help-frame ()
-  (let ((x (balloon-help-compute-help-frame-x-location))
-	(y (balloon-help-compute-help-frame-y-location)))
-    (set-frame-position balloon-help-frame x y)))
+(defun balloon-help-mouse-leave-frame-hook (&rest ignored)
+  (let* ((mouse (mouse-position))
+	 (window (car mouse)))