aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2005-06-14 15:50:22 +0000
committerJuanma Barranquero2005-06-14 15:50:22 +0000
commitfbb70c539bbc905a9bad90ad2c6540f8008f3138 (patch)
tree26b7550547bde58d083453952bc686b1973a2952
parent8ab2275f108d8c1988f504813e294d37b64c2715 (diff)
downloademacs-fbb70c539bbc905a9bad90ad2c6540f8008f3138.tar.gz
emacs-fbb70c539bbc905a9bad90ad2c6540f8008f3138.zip
(make-obsolete, define-obsolete-function-alias): Rename arguments FUNCTION and
NEW to OBSOLETE-NAME and CURRENT-NAME respectively. (make-obsolete-variable, define-obsolete-variable-alias): Rename arguments VARIABLE and NEW to OBSOLETE-NAME and CURRENT-NAME respectively.
-rw-r--r--lisp/emacs-lisp/byte-run.el46
1 files changed, 23 insertions, 23 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 7fc01901cfe..d3def79c8fb 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -100,23 +100,23 @@ The return value of this function is not used."
100 (eval-and-compile 100 (eval-and-compile
101 (put ',name 'byte-optimizer 'byte-compile-inline-expand)))) 101 (put ',name 'byte-optimizer 'byte-compile-inline-expand))))
102 102
103(defun make-obsolete (function new &optional when) 103(defun make-obsolete (obsolete-name current-name &optional when)
104 "Make the byte-compiler warn that FUNCTION is obsolete. 104 "Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
105The warning will say that NEW should be used instead. 105The warning will say that CURRENT-NAME should be used instead.
106If NEW is a string, that is the `use instead' message. 106If CURRENT-NAME is a string, that is the `use instead' message.
107If provided, WHEN should be a string indicating when the function 107If provided, WHEN should be a string indicating when the function
108was first made obsolete, for example a date or a release number." 108was first made obsolete, for example a date or a release number."
109 (interactive "aMake function obsolete: \nxObsoletion replacement: ") 109 (interactive "aMake function obsolete: \nxObsoletion replacement: ")
110 (let ((handler (get function 'byte-compile))) 110 (let ((handler (get obsolete-name 'byte-compile)))
111 (if (eq 'byte-compile-obsolete handler) 111 (if (eq 'byte-compile-obsolete handler)
112 (setq handler (nth 1 (get function 'byte-obsolete-info))) 112 (setq handler (nth 1 (get obsolete-name 'byte-obsolete-info)))
113 (put function 'byte-compile 'byte-compile-obsolete)) 113 (put obsolete-name 'byte-compile 'byte-compile-obsolete))
114 (put function 'byte-obsolete-info (list new handler when))) 114 (put obsolete-name 'byte-obsolete-info (list current-name handler when)))
115 function) 115 obsolete-name)
116 116
117(defmacro define-obsolete-function-alias (function new 117(defmacro define-obsolete-function-alias (obsolete-name current-name
118 &optional when docstring) 118 &optional when docstring)
119 "Set FUNCTION's function definition to NEW and mark it obsolete. 119 "Set OBSOLETE-NAME's function definition to CURRENT-NAME and mark it obsolete.
120 120
121\(define-obsolete-function-alias 'old-fun 'new-fun \"22.1\" \"old-fun's doc.\") 121\(define-obsolete-function-alias 'old-fun 'new-fun \"22.1\" \"old-fun's doc.\")
122 122
@@ -127,13 +127,13 @@ is equivalent to the following two lines of code:
127 127
128See the docstrings of `defalias' and `make-obsolete' for more details." 128See the docstrings of `defalias' and `make-obsolete' for more details."
129 `(progn 129 `(progn
130 (defalias ,function ,new ,docstring) 130 (defalias ,obsolete-name ,current-name ,docstring)
131 (make-obsolete ,function ,new ,when))) 131 (make-obsolete ,obsolete-name ,current-name ,when)))
132 132
133(defun make-obsolete-variable (variable new &optional when) 133(defun make-obsolete-variable (obsolete-name current-name &optional when)
134 "Make the byte-compiler warn that VARIABLE is obsolete. 134 "Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
135The warning will say that NEW should be used instead. 135The warning will say that CURRENT-NAME should be used instead.
136If NEW is a string, that is the `use instead' message. 136If CURRENT-NAME is a string, that is the `use instead' message.
137If provided, WHEN should be a string indicating when the variable 137If provided, WHEN should be a string indicating when the variable
138was first made obsolete, for example a date or a release number." 138was first made obsolete, for example a date or a release number."
139 (interactive 139 (interactive
@@ -142,12 +142,12 @@ was first made obsolete, for example a date or a release number."
142 (if (equal str "") (error "")) 142 (if (equal str "") (error ""))
143 (intern str)) 143 (intern str))
144 (car (read-from-string (read-string "Obsoletion replacement: "))))) 144 (car (read-from-string (read-string "Obsoletion replacement: ")))))
145 (put variable 'byte-obsolete-variable (cons new when)) 145 (put obsolete-name 'byte-obsolete-variable (cons current-name when))
146 variable) 146 obsolete-name)
147 147
148(defmacro define-obsolete-variable-alias (variable new 148(defmacro define-obsolete-variable-alias (obsolete-name current-name
149 &optional when docstring) 149 &optional when docstring)
150 "Make VARIABLE a variable alias for NEW and mark it obsolete. 150 "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
151 151
152\(define-obsolete-variable-alias 'old-var 'new-var \"22.1\" \"old-var's doc.\") 152\(define-obsolete-variable-alias 'old-var 'new-var \"22.1\" \"old-var's doc.\")
153 153
@@ -159,8 +159,8 @@ is equivalent to the following two lines of code:
159See the docstrings of `defvaralias' and `make-obsolete-variable' or 159See the docstrings of `defvaralias' and `make-obsolete-variable' or
160Info node `(elisp)Variable Aliases' for more details." 160Info node `(elisp)Variable Aliases' for more details."
161 `(progn 161 `(progn
162 (defvaralias ,variable ,new ,docstring) 162 (defvaralias ,obsolete-name ,current-name ,docstring)
163 (make-obsolete-variable ,variable ,new ,when))) 163 (make-obsolete-variable ,obsolete-name ,current-name ,when)))
164 164
165(defmacro dont-compile (&rest body) 165(defmacro dont-compile (&rest body)
166 "Like `progn', but the body always runs interpreted (not compiled). 166 "Like `progn', but the body always runs interpreted (not compiled).