Minor fixes for the function obsolescence feature.
authorChong Yidong <cyd@gnu.org>
Tue, 25 Sep 2012 05:33:43 +0000 (13:33 +0800)
committerChong Yidong <cyd@gnu.org>
Tue, 25 Sep 2012 05:33:43 +0000 (13:33 +0800)
* lisp/help-fns.el (help-fns--obsolete): Handle macros properly.

* lisp/subr.el (declare): Doc fix.

lisp/ChangeLog
lisp/help-fns.el
lisp/subr.el

index 375fea9..090a8be 100644 (file)
@@ -1,3 +1,9 @@
+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
index fa0484f..7dc7eeb 100644 (file)
@@ -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))))
index e5725b3..8dfe78d 100644 (file)
@@ -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)
 ))