branch: master
commit db933b6e8ff0d543b2480339022e230251008759
Author: mas <mas>
Commit: mas <mas>
(mmm-make-temp-buffer): Added as workaround for make-indirect-buffer.
---
mmm-compat.el | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/mmm-compat.el b/mmm-compat.el
index 2d34dc2..c18501e 100644
--- a/mmm-compat.el
+++ b/mmm-compat.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2000 by Michael Abraham Shulman
;; Author: Michael Abraham Shulman <[email protected]>
-;; Version: $Id: mmm-compat.el,v 1.3 2000/07/11 02:44:06 mas Exp $
+;; Version: $Id: mmm-compat.el,v 1.4 2000/07/11 21:57:28 mas Exp $
;;{{{ GPL
@@ -27,9 +27,9 @@
;;; Commentary:
;; This file provides a number of hacks that are necessary for MMM
-;; Mode to function in different Emacsen. MMM Mode is designed for FSF
+;; Mode to function in different Emacsen. MMM Mode is designed for
;; Emacs 20, but these hacks usually enable it to work almost
-;; perfectly in FSF Emacs 19 or XEmacs.
+;; perfectly in Emacs 19 and XEmacs 20 or 21.
;;; Code:
@@ -153,6 +153,17 @@ This makes `@' in skeletons act approximately like it does
in FSF."
'(@ ''(push (point) skeleton-positions)))))
;;}}}
+
+(defmacro mmm-make-temp-buffer (buffer name)
+ "Return a buffer called NAME including the text of BUFFER.
+This text should not be modified."
+ (if (fboundp 'make-indirect-buffer)
+ `(make-indirect-buffer ,buffer ,name)
+ `(save-excursion
+ (set-buffer (get-buffer-create ,name))
+ (insert-buffer ,buffer)
+ (current-buffer))))
+
;;{{{ Font Lock (Emacs w/o X)
(defvar mmm-font-lock-available-p (or window-system mmm-xemacs)