Mercurial > hg > xemacs-beta
comparison lisp/emulators/mlconvert.el @ 4:b82b59fe008d r19-15b3
Import from CVS: tag r19-15b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:56 +0200 |
parents | 376386a54a3c |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
3:30df88044ec6 | 4:b82b59fe008d |
---|---|
1 ;;; mlconvert.el --- convert buffer of Mocklisp code to real lisp. | 1 ;;; mlconvert.el --- convert buffer of Mocklisp code to real lisp. |
2 | |
3 ;; Copyright (C) 1985 Free Software Foundation, Inc. | |
4 | |
5 ;; Maintainer: FSF | |
2 ;; Keywords: emulations | 6 ;; Keywords: emulations |
3 | |
4 ;; Copyright (C) 1985 Free Software Foundation, Inc. | |
5 | 7 |
6 ;; This file is part of XEmacs. | 8 ;; This file is part of XEmacs. |
7 | 9 |
8 ;; XEmacs is free software; you can redistribute it and/or modify it | 10 ;; XEmacs is free software; you can redistribute it and/or modify it |
9 ;; under the terms of the GNU General Public License as published by | 11 ;; under the terms of the GNU General Public License as published by |
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 ;; General Public License for more details. | 18 ;; General Public License for more details. |
17 | 19 |
18 ;; You should have received a copy of the GNU General Public License | 20 ;; You should have received a copy of the GNU General Public License |
19 ;; along with XEmacs; see the file COPYING. If not, write to the Free | 21 ;; along with XEmacs; see the file COPYING. If not, write to the Free |
20 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
23 ;; 02111-1307, USA. | |
24 | |
25 ;;; Synched up with: FSF 19.34 | |
26 | |
27 ;;; Commentary: | |
28 | |
29 ;; This package converts Mocklisp code written under a Gosling or UniPress | |
30 ;; Emacs for use with GNU Emacs. The translated code will require runtime | |
31 ;; support from the mlsupport.el equivalent. | |
32 | |
33 ;;; Code: | |
21 | 34 |
22 ;;;###autoload | 35 ;;;###autoload |
23 (defun convert-mocklisp-buffer () | 36 (defun convert-mocklisp-buffer () |
24 "Convert buffer of Mocklisp code to real Lisp that GNU Emacs can run." | 37 "Convert buffer of Mocklisp code to real Lisp that GNU Emacs can run." |
25 (interactive) | 38 (interactive) |
98 (ml-expansion 'if "ml-if") | 111 (ml-expansion 'if "ml-if") |
99 (ml-expansion 'setq '(lambda () | 112 (ml-expansion 'setq '(lambda () |
100 (if (looking-at "setq[ \t\n]+buffer-modified-p") | 113 (if (looking-at "setq[ \t\n]+buffer-modified-p") |
101 (replace-match "set-buffer-modified-p")))) | 114 (replace-match "set-buffer-modified-p")))) |
102 | 115 |
103 (ml-expansion 'while '(lambda () | 116 ;;(ml-expansion 'while '(lambda () |
104 (let ((end (progn (forward-sexp 2) (point-marker))) | 117 ;; (let ((end (progn (forward-sexp 2) (point-marker))) |
105 (start (progn (forward-sexp -1) (point)))) | 118 ;; (start (progn (forward-sexp -1) (point)))) |
106 (let ((cond (buffer-substring start end))) | 119 ;; (let ((cond (buffer-substring start end))) |
107 (cond ((equal cond "1") | 120 ;; (cond ((equal cond "1") |
108 (delete-region (point) end) | 121 ;; (delete-region (point) end) |
109 (insert "t")) | 122 ;; (insert "t")) |
110 (t | 123 ;; (t |
111 (insert "(not (zerop ") | 124 ;; (insert "(not (zerop ") |
112 (goto-char end) | 125 ;; (goto-char end) |
113 (insert "))"))) | 126 ;; (insert "))"))) |
114 (set-marker end nil) | 127 ;; (set-marker end nil) |
115 (goto-char start))))) | 128 ;; (goto-char start))))) |
116 | 129 |
117 (ml-expansion 'arg "ml-arg") | 130 (ml-expansion 'arg "ml-arg") |
118 (ml-expansion 'nargs "ml-nargs") | 131 (ml-expansion 'nargs "ml-nargs") |
119 (ml-expansion 'interactive "ml-interactive") | 132 (ml-expansion 'interactive "ml-interactive") |
120 (ml-expansion 'message "ml-message") | 133 (ml-expansion 'message "ml-message") |
182 (ml-expansion 'get-tty-command "read-command") | 195 (ml-expansion 'get-tty-command "read-command") |
183 (ml-expansion 'get-tty-variable "read-variable") | 196 (ml-expansion 'get-tty-variable "read-variable") |
184 (ml-expansion 'get-tty-no-blanks-input "read-no-blanks-input") | 197 (ml-expansion 'get-tty-no-blanks-input "read-no-blanks-input") |
185 (ml-expansion 'get-tty-key "read-key") | 198 (ml-expansion 'get-tty-key "read-key") |
186 | 199 |
200 (ml-expansion 'concat "ml-concat") | |
187 (ml-expansion 'c= "char-equal") | 201 (ml-expansion 'c= "char-equal") |
188 (ml-expansion 'goto-character "goto-char") | 202 (ml-expansion 'goto-character "goto-char") |
189 (ml-expansion 'substr "ml-substr") | 203 (ml-expansion 'substr "ml-substr") |
190 (ml-expansion 'variable-apropos "apropos") | 204 (ml-expansion 'variable-apropos "apropos") |
191 (ml-expansion 'execute-mlisp-buffer "eval-current-buffer") | 205 (ml-expansion 'execute-mlisp-buffer "eval-current-buffer") |
271 (ml-expansion '! "ml-not") | 285 (ml-expansion '! "ml-not") |
272 (ml-expansion '<< "lsh") | 286 (ml-expansion '<< "lsh") |
273 | 287 |
274 ;Variable pause-writes-files | 288 ;Variable pause-writes-files |
275 | 289 |
290 ;;; mlconvert.el ends here |