tm 7.83.
[elisp/apel.git] / emu.el
diff --git a/emu.el b/emu.el
index 1d32f1e..929655d 100644 (file)
--- a/emu.el
+++ b/emu.el
@@ -3,8 +3,8 @@
 ;; Copyright (C) 1995,1996 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: emu.el,v 7.22 1996/08/18 07:30:38 morioka Exp $
-;; Keywords: emulation, compatibility, NEmacs, Mule, XEmacs
+;; Version: $Id: emu.el,v 7.26 1996/09/05 16:31:02 morioka Exp $
+;; Keywords: emulation, compatibility, NEmacs, MULE, XEmacs
 
 ;; This file is part of tl (Tiny Library).
 
@@ -97,12 +97,13 @@ and `default-mime-charset'. [emu.el]"
          default-mime-charset)))
 
 
-;;; @ Emacs 19.29 emulation
+;;; @ EMACS 19.29 emulation
 ;;;
 
 (or (fboundp 'buffer-substring-no-properties)
     (defun buffer-substring-no-properties (beg end)
-      "Return the text from BEG to END, without text properties, as a string."
+      "Return the text from BEG to END, without text properties, as a string.
+\[emu.el; EMACS 19.29 emulating function]"
       (let ((string (buffer-substring beg end)))
         (tl:set-text-properties 0 (length string) nil string)
        string))
@@ -131,12 +132,39 @@ See `read-from-minibuffer' for details of HISTORY argument."
 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]"
+\[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)))) 
+    )
+
+
 ;;; @ XEmacs emulation
 ;;;