aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-09-25 13:33:43 +0800
committerChong Yidong2012-09-25 13:33:43 +0800
commit863666ebae563a9a83dd8bce54227dfd6f66987d (patch)
tree7255a48e992de06961e6530fec878048bfbfb7ed
parent59f7af816e98a74abf42d724bcfdfa9bfe9964ce (diff)
downloademacs-863666ebae563a9a83dd8bce54227dfd6f66987d.tar.gz
emacs-863666ebae563a9a83dd8bce54227dfd6f66987d.zip
Minor fixes for the function obsolescence feature.
* lisp/help-fns.el (help-fns--obsolete): Handle macros properly. * lisp/subr.el (declare): Doc fix.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/help-fns.el16
-rw-r--r--lisp/subr.el11
3 files changed, 24 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 375fea957c0..090a8bef4e9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12012-09-25 Chong Yidong <cyd@gnu.org> 12012-09-25 Chong Yidong <cyd@gnu.org>
2 2
3 * subr.el (declare): Doc fix.
4
5 * help-fns.el (help-fns--obsolete): Handle macros properly.
6
72012-09-25 Chong Yidong <cyd@gnu.org>
8
3 * bookmark.el (bookmark-jump-noselect): Use a declare form to mark 9 * bookmark.el (bookmark-jump-noselect): Use a declare form to mark
4 this function obsolete. 10 this function obsolete.
5 11
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index fa0484ff4e5..7dc7eebb061 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -488,13 +488,17 @@ suitable file is found, return nil."
488 (insert "'.\n")))) 488 (insert "'.\n"))))
489 489
490(defun help-fns--obsolete (function) 490(defun help-fns--obsolete (function)
491 (let* ((obsolete (and 491 ;; Ignore lambda constructs, keyboard macros, etc.
492 ;; `function' might be a lambda construct. 492 (let* ((obsolete (and (symbolp function)
493 (symbolp function) 493 (get function 'byte-obsolete-info)))
494 (get function 'byte-obsolete-info)))
495 (use (car obsolete))) 494 (use (car obsolete)))
496 (when obsolete 495 (when obsolete
497 (insert "\nThis function is obsolete") 496 (insert "\nThis "
497 (if (eq (car-safe (symbol-function 'with-current-buffer))
498 'macro)
499 "macro"
500 "function")
501 " is obsolete")
498 (when (nth 2 obsolete) 502 (when (nth 2 obsolete)
499 (insert (format " since %s" (nth 2 obsolete)))) 503 (insert (format " since %s" (nth 2 obsolete))))
500 (insert (cond ((stringp use) (concat ";\n" use)) 504 (insert (cond ((stringp use) (concat ";\n" use))
@@ -611,7 +615,7 @@ FILE is the file where FUNCTION was probably defined."
611 (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point)) 615 (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point))
612 (point))) 616 (point)))
613 (terpri)(terpri) 617 (terpri)(terpri)
614 618
615 (let* ((doc-raw (condition-case err 619 (let* ((doc-raw (condition-case err
616 (documentation function t) 620 (documentation function t)
617 (error (format "No Doc! %S" err)))) 621 (error (format "No Doc! %S" err))))
diff --git a/lisp/subr.el b/lisp/subr.el
index e5725b3b3fa..8dfe78d8c75 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -271,9 +271,14 @@ the return value (nil if RESULT is omitted).
271 ,@(cdr (cdr spec)))))) 271 ,@(cdr (cdr spec))))))
272 272
273(defmacro declare (&rest _specs) 273(defmacro declare (&rest _specs)
274 "Do not evaluate any arguments and return nil. 274 "Do not evaluate any arguments, and return nil.
275Treated as a declaration when used at the right place in a 275If a `declare' form appears as the first form in the body of a
276`defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" 276`defun' or `defmacro' form, SPECS specifies various additional
277information about the function or macro; these go into effect
278during the evaluation of the `defun' or `defmacro' form.
279
280The possible values of SPECS are specified by
281`defun-declarations-alist' and `macro-declarations-alist'."
277 ;; FIXME: edebug spec should pay attention to defun-declarations-alist. 282 ;; FIXME: edebug spec should pay attention to defun-declarations-alist.
278 nil) 283 nil)
279)) 284))