-(cond ((or running-emacs-19_29-or-later running-xemacs)
- ;; for Emacs 19.29 or later and XEmacs
- (defalias 'tl:read-string 'read-string)
- )
- (t
- ;; for Emacs 19.28 or earlier
- (defun tl:read-string (prompt &optional initial-input history)
- (read-string prompt initial-input)
- )
- ))
+(or running-emacs-19_29-or-later
+ running-xemacs
+ ;; for Emacs 19.28 or earlier
+ (fboundp 'si:read-string)
+ (progn
+ (fset 'si:read-string (symbol-function 'read-string))
+
+ (defun read-string (prompt &optional initial-input history)
+ "Read a string from the minibuffer, prompting with string PROMPT.
+If non-nil, second arg INITIAL-INPUT is a string to insert before reading.
+The third arg HISTORY, is dummy for compatibility. [emu.el]
+See `read-from-minibuffer' for details of HISTORY argument."
+ (si:read-string prompt initial-input)
+ )
+ ))
+
+(or (fboundp 'add-to-list)
+ ;; This function was imported Emacs 19.30.
+ (defun add-to-list (list-var element)
+ "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
+If you want to use `add-to-list' on a variable that is not defined
+until a certain package is loaded, you should put the call to `add-to-list'
+into a hook function that will be run only after loading the package.
+\[emu.el; EMACS 19.30 emulating function]"
+ (or (member element (symbol-value list-var))
+ (set list-var (cons element (symbol-value list-var)))))
+ )
+
+
+;;; @ EMACS 19.31 emulation
+;;;
+
+(or (fboundp 'buffer-live-p)
+ (defun buffer-live-p (object)
+ "Return non-nil if OBJECT is a buffer which has not been killed.
+Value is nil if OBJECT is not a buffer or if it has been killed.
+\[emu.el; EMACS 19.31 emulating function]"
+ (and object
+ (get-buffer object)
+ (buffer-name (get-buffer object))
+ ))
+ )
+
+(or (fboundp 'save-selected-window)
+ ;; This function was imported Emacs 19.33.
+ (defmacro save-selected-window (&rest body)
+ "Execute BODY, then select the window that was selected before BODY.
+\[emu.el; EMACS 19.31 emulating function]"
+ (list 'let
+ '((save-selected-window-window (selected-window)))
+ (list 'unwind-protect
+ (cons 'progn body)
+ (list 'select-window 'save-selected-window-window))))
+ )