Mercurial > hg > xemacs-beta
comparison lisp/efs/efs-ovwrt.el @ 40:7e54bd776075 r19-15b103
Import from CVS: tag r19-15b103
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:54:25 +0200 |
parents | 8fc7fe29b841 |
children | 8b8b7f3559a2 |
comparison
equal
deleted
inserted
replaced
39:06f275776fba | 40:7e54bd776075 |
---|---|
1 ;; -*-Emacs-Lisp-*- | 1 ;; -*-Emacs-Lisp-*- |
2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 ;; | 3 ;; |
4 ;; File: efs-ovwrt.el | 4 ;; File: efs-ovwrt.el |
5 ;; Release: $efs release: 1.15 $ | 5 ;; Release: $efs release: 1.15 $ |
6 ;; Version: $Revision: 1.1 $ | 6 ;; Version: $Revision: 1.2 $ |
7 ;; RCS: | 7 ;; RCS: |
8 ;; Description: Utilities for overwriting functions with new definitions. | 8 ;; Description: Utilities for overwriting functions with new definitions. |
9 ;; Author: Andy Norman <ange@hplb.hpl.hp.com> | 9 ;; Author: Andy Norman <ange@hplb.hpl.hp.com> |
10 ;; Modified: Sun Nov 27 18:40:20 1994 by sandy on gandalf | |
11 ;; | 10 ;; |
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 11 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
13 | 12 |
14 ;;; Although used by efs, these utilities could be of general use to other | 13 ;;; Although used by efs, these utilities could be of general use to other |
15 ;;; packages too. Keeping them separate from the main efs program | 14 ;;; packages too. Keeping them separate from the main efs program |
18 (provide 'efs-ovwrt) | 17 (provide 'efs-ovwrt) |
19 | 18 |
20 (defconst efs-ovwrt-version | 19 (defconst efs-ovwrt-version |
21 (concat (substring "$efs release: 1.15 $" 14 -2) | 20 (concat (substring "$efs release: 1.15 $" 14 -2) |
22 "/" | 21 "/" |
23 (substring "$Revision: 1.1 $" 11 -2))) | 22 (substring "$Revision: 1.2 $" 11 -2))) |
24 | 23 |
25 (defvar efs-overwrite-fmt | 24 (defvar efs-overwrite-fmt |
26 "Note: This function has been modified to work with %s.") | 25 "Note: This function has been modified to work with %s.") |
27 | 26 |
28 ;; Make the byte compiler happy. | 27 ;; Make the byte compiler happy. |
64 ;; rather than function definition to allow reloading of this file or | 63 ;; rather than function definition to allow reloading of this file or |
65 ;; redefining of the individual function (e.g., during debugging) | 64 ;; redefining of the individual function (e.g., during debugging) |
66 ;; later after some other code has been loaded on top of our stuff. | 65 ;; later after some other code has been loaded on top of our stuff. |
67 | 66 |
68 (or (fboundp saved) | 67 (or (fboundp saved) |
69 (progn | 68 (let ((advised-p (and (featurep 'advice) |
69 (ad-is-advised fun)))) | |
70 (if advised-p (ad-deactivate fun)) | |
70 (fset saved (symbol-function fun)) | 71 (fset saved (symbol-function fun)) |
71 (fset fun new))) | 72 (fset fun new) |
73 (if advised-p (ad-activate fun)))) | |
72 | 74 |
73 ;; Rewrite the doc string on the new function. This should | 75 ;; Rewrite the doc string on the new function. This should |
74 ;; be done every time the file is loaded (or a function is redefined), | 76 ;; be done every time the file is loaded (or a function is redefined), |
75 ;; because the underlying overloaded function may have changed its doc | 77 ;; because the underlying overloaded function may have changed its doc |
76 ;; string. | 78 ;; string. |