annotate lisp/edebug/advise-eval-region.el @ 8:4b173ad71786 r19-15b5

Import from CVS: tag r19-15b5
author cvs
date Mon, 13 Aug 2007 08:47:35 +0200
parents b82b59fe008d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 ;;; advise-eval-region.el --- Wrap advice around eval-region
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2 ;; Copyright (C) 1996 Miranova Systems, Inc.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
3
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4 ;; Original-Author: Unknown
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 ;; Adapted-By: Steven L Baur <steve@miranova.com>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
6 ;; Keywords: extensions lisp
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
7
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 ;; any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 ;; General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 ;; 02111-1307, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25 ;;; Synched up with: Not in FSF.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 ;;; Commentary:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 ;; This file splits out advice to eval-region formerly done in cl-read.el.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 ;; Due to the way cl-read.el reads itself in twice during bytecompilation,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 ;; and the fact that functions shouldn't be advised twice, I split this out
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32 ;; into its own file.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 ;;; Code:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 (require 'advice)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 ;; Advise the redefined eval-region
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 (defadvice eval-region (around cl-read activate)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 "Use the reader::read instead of the original read if cl-read-active."
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 (with-elisp-eval-region (not cl-read-active)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 ad-do-it))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 (provide 'advise-eval-region)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 ;;; advise-eval-region.el ends here