;;; mlsupport.el --- run-time support for mocklisp code.
+;; Copyright (C) 1985 Free Software Foundation, Inc.
+
;; Maintainer: FSF
-;; Last-Modified: 16 Mar 1992
;; Keywords: extensions
-;; Copyright (C) 1985 Free Software Foundation, Inc.
-
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This package provides equivalents of certain primitives from Gosling
+;; Emacs (including the commercial UniPress versions). These have an
+;; ml- prefix to distinguish them from native GNU Emacs functions with
+;; similar names. The package mlconvert.el translates Mocklisp code
+;; to use these names.
;;; Code:
(defun define-keymap (name)
(fset (intern name) (make-keymap)))
+;; Make it work to use ml-use-...-map on "esc" and such.
+(fset 'esc-map esc-map)
+(fset 'ctl-x-map ctl-x-map)
+
(defun ml-use-local-map (name)
(use-local-map (intern (concat name "-map"))))
(fset (intern name) defn))
(defun push-back-character (char)
- (setq unread-command-char char))
+ (setq unread-command-events (list char)))
(defun to-col (column)
(indent-to column 0))
(if (/= (aref pattern 0) ?*)
(error "Only patterns starting with * supported in auto-execute"))
(setq auto-mode-alist (cons (cons (concat "\\." (substring pattern 1)
- "$")
+ "\\'")
function)
auto-mode-alist)))
(if (< to 0) (setq to (+ to length)))
(substring string from (+ from to))))
+(defun ml-concat (&rest args)
+ (let ((newargs nil) this)
+ (while args
+ (setq this (car args))
+ (if (numberp this)
+ (setq this (number-to-string this)))
+ (setq newargs (cons this newargs)
+ args (cdr args)))
+ (apply 'concat (nreverse newargs))))
+
(provide 'mlsupport)
;;; mlsupport.el ends here