changeset 93247:5fc9c77f2aea

(describe-function-1, describe-variable): If CURRENT-NAME is nil, don't end obsolescence info with semicolon.
author Juanma Barranquero <lekktu@gmail.com>
date Wed, 26 Mar 2008 14:49:15 +0000
parents 6ac54c43b7ca
children 072dbbf778d2
files lisp/help-fns.el
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/help-fns.el	Wed Mar 26 14:13:06 2008 +0000
+++ b/lisp/help-fns.el	Wed Mar 26 14:49:15 2008 +0000
@@ -421,19 +421,19 @@
 	      (insert (car high) "\n")
 	      (fill-region fill-begin (point)))
             (setq doc (cdr high))))
-        (let ((obsolete (and
-                         ;; function might be a lambda construct.
-                         (symbolp function)
-                         (get function 'byte-obsolete-info))))
+        (let* ((obsolete (and
+			  ;; function might be a lambda construct.
+			  (symbolp function)
+			  (get function 'byte-obsolete-info)))
+	       (use (car obsolete)))
           (when obsolete
             (princ "\nThis function is obsolete")
             (when (nth 2 obsolete)
               (insert (format " since %s" (nth 2 obsolete))))
-            (insert ";\n"
-                    (if (stringp (car obsolete)) (car obsolete)
-                      (if (null (car obsolete)) ""
-                        (format "use `%s' instead." (car obsolete))))
-                    "\n"))
+	    (insert (cond ((stringp use) (concat ";\n" use))
+			  (use (format ";\nuse `%s' instead." use))
+			  (t "."))
+		    "\n"))
           (insert "\n"
                   (or doc "Not documented.")))))))
 
@@ -640,6 +640,7 @@
                               (indirect-variable variable)
                             (error variable)))
                    (obsolete (get variable 'byte-obsolete-variable))
+		   (use (car obsolete))
 		   (safe-var (get variable 'safe-local-variable))
                    (doc (or (documentation-property variable 'variable-documentation)
                             (documentation-property alias 'variable-documentation)))
@@ -661,10 +662,9 @@
                 (setq extra-line t)
                 (princ "  This variable is obsolete")
                 (if (cdr obsolete) (princ (format " since %s" (cdr obsolete))))
-                (princ ";\n  ")
-                (princ (if (stringp (car obsolete)) (car obsolete)
-                         (if (null (car obsolete)) ""
-                           (format "use `%s' instead." (car obsolete)))))
+		(princ (cond ((stringp use) (concat ";\n  " use))
+			     (use (format ";\n  use `%s' instead." (car obsolete)))
+			     (t ".")))
                 (terpri))
 	      (when safe-var
                 (setq extra-line t)