diff lisp/edebug/cl-read.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents ec9a17fef872
children b9518feda344
line wrap: on
line diff
--- a/lisp/edebug/cl-read.el	Mon Aug 13 09:00:04 2007 +0200
+++ b/lisp/edebug/cl-read.el	Mon Aug 13 09:02:59 2007 +0200
@@ -2,27 +2,23 @@
 ;; 
 ;; Copyright (C) 1993 by Guido Bosch <Guido.Bosch@loria.fr>
 
-;; This file is part of XEmacs
+;; This file is written in GNU Emacs Lisp, but not (yet) part of GNU Emacs.
 
-;; XEmacs is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; The software contained in this file is free software; you can
+;; redistribute it and/or modify it under the terms of the GNU General
+;; Public License as published by the Free Software Foundation; either
+;; version 2, or (at your option) any later version.
 
-;; XEmacs is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;; General Public License for more details.
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with XEmacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-;; 02111-1307, USA.
 
-;;; Synched up with: Not in FSF
-
-;;; Commentary:
-
+;; along with GNU Emacs; see the file COPYING.  If not, write to
+;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; 
 ;; Please send bugs and comments to the author.
 ;;
 ;; <DISCLAIMER>
@@ -83,7 +79,7 @@
 ;; Dispatch Character Macro" `#'
 ;;
 ;; #'<function>			function quoting
-;; #\<character>		character syntax
+;; #\<charcter>			character syntax
 ;; #.<form>    			read time evaluation
 ;; #p<path>, #P<path> 		paths
 ;; #+<feature>, #-<feature> 	conditional reading
@@ -208,8 +204,8 @@
 ; Change History
 ; 
 ; $Log: cl-read.el,v $
-; Revision 1.2  1997/03/09 02:36:46  steve
-; Patches to beta98
+; Revision 1.1.1.1  1996/12/18 22:43:07  steve
+; XEmacs 20.0 -- Beta 30
 ;
 ; Revision 1.19  94/03/21  19:59:24  liberte
 ; Add invalid-cl-read-syntax error symbol.
@@ -306,15 +302,11 @@
 ;
 ;
 
-;;; Code:
-
+;; 
 (require 'cl)
-;; Thou shalt evaluate a defadvice only once, or thou shalt surely lose. -sb
-(require 'advise-eval-region)
 
+(provide 'cl-read)
 ;; load before compiling
-;; This is ugly, but apparently the only way to do it :-(  -sb
-(provide 'cl-read)
 (require 'cl-read)
 
 ;; bootstrapping with cl-packages
@@ -382,8 +374,8 @@
 ;;    character is a macro character.
 ;;
 ;; 3. A vector of length `reader::readtable-size'. Elements of this vector
-;;    may be `nil' or a function (see 2.). It means the character is a
-;;    dispatch character, and the vector its dispatch function table.
+;;    may be `nil' or a function (see 2.). It means the charater is a
+;;    dispatch character, and the vector its dispatch fucntion table.
 
 (defvar *readtable*)
 (defvar reader::internal-standard-readtable)
@@ -1300,7 +1292,7 @@
 ;; in lisp, and based on more primitive read functions we already
 ;; replaced. The reading happens during the interactive parameter
 ;; retrieval, which is written in lisp, too.  So this replacement of
-;; eval-expression is only required for (FSF) Emacs 18 (and 19?).
+;; eval-expresssion is only required fro (FSF) Emacs 18 (and 19?).
 
 (or (fboundp 'reader::original-eval-expression)
     (fset 'reader::original-eval-expression 
@@ -1323,7 +1315,7 @@
   (prin1 (car values) t))
 
 (require 'eval-reg "eval-reg")
-; (require 'advice)
+(require 'advice)
 
 
 ;; installing/uninstalling the cl reader
@@ -1353,6 +1345,14 @@
 (cl-reader-install)
 (cl-reader-uninstall)
 
+;; Advise the redefined eval-region
+(defadvice eval-region (around cl-read activate)
+  "Use the reader::read instead of the original read if cl-read-active."
+  (with-elisp-eval-region (not cl-read-active)
+    (ad-do-it)))
+;;(ad-unadvise 'eval-region)
+
+
 (add-hook 'emacs-lisp-mode-hook 'cl-reader-autoinstall-function)
 
 '(defvar read-syntax)
@@ -1397,5 +1397,4 @@
 
 
 (run-hooks 'cl-read-load-hooks)
-
-;; cl-read.el ends here
+;; end cl-read.el