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