Commit 863666eb authored by Chong Yidong's avatar Chong Yidong
Browse files

Minor fixes for the function obsolescence feature.

* lisp/help-fns.el (help-fns--obsolete): Handle macros properly.

* lisp/subr.el (declare): Doc fix.
parent 59f7af81
2012-09-25 Chong Yidong <cyd@gnu.org>
* subr.el (declare): Doc fix.
* help-fns.el (help-fns--obsolete): Handle macros properly.
2012-09-25 Chong Yidong <cyd@gnu.org>
 
* bookmark.el (bookmark-jump-noselect): Use a declare form to mark
......
......@@ -488,13 +488,17 @@ suitable file is found, return nil."
(insert "'.\n"))))
(defun help-fns--obsolete (function)
(let* ((obsolete (and
;; `function' might be a lambda construct.
(symbolp function)
(get function 'byte-obsolete-info)))
;; Ignore lambda constructs, keyboard macros, etc.
(let* ((obsolete (and (symbolp function)
(get function 'byte-obsolete-info)))
(use (car obsolete)))
(when obsolete
(insert "\nThis function is obsolete")
(insert "\nThis "
(if (eq (car-safe (symbol-function 'with-current-buffer))
'macro)
"macro"
"function")
" is obsolete")
(when (nth 2 obsolete)
(insert (format " since %s" (nth 2 obsolete))))
(insert (cond ((stringp use) (concat ";\n" use))
......@@ -611,7 +615,7 @@ FILE is the file where FUNCTION was probably defined."
(fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point))
(point)))
(terpri)(terpri)
(let* ((doc-raw (condition-case err
(documentation function t)
(error (format "No Doc! %S" err))))
......
......@@ -271,9 +271,14 @@ the return value (nil if RESULT is omitted).
,@(cdr (cdr spec))))))
(defmacro declare (&rest _specs)
"Do not evaluate any arguments and return nil.
Treated as a declaration when used at the right place in a
`defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)"
"Do not evaluate any arguments, and return nil.
If a `declare' form appears as the first form in the body of a
`defun' or `defmacro' form, SPECS specifies various additional
information about the function or macro; these go into effect
during the evaluation of the `defun' or `defmacro' form.
The possible values of SPECS are specified by
`defun-declarations-alist' and `macro-declarations-alist'."
;; FIXME: edebug spec should pay attention to defun-declarations-alist.
nil)
))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment