Mercurial > hg > xemacs-beta
diff lisp/prim/help.el @ 100:4be1180a9e89 r20-1b2
Import from CVS: tag r20-1b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:15:11 +0200 |
parents | 0d2f883870bc |
children | cf808b4c4290 |
line wrap: on
line diff
--- a/lisp/prim/help.el Mon Aug 13 09:13:58 2007 +0200 +++ b/lisp/prim/help.el Mon Aug 13 09:15:11 2007 +0200 @@ -780,6 +780,19 @@ (car obsolete) (format "use `%s' instead." (car obsolete))))))) +(defun function-compatible-p (function) + "Return non-nil if FUNCTION is present for Emacs compatibility." + (not (null (get function 'byte-compatible-info)))) + +(defun function-compatibility-doc (function) + "If FUNCTION is Emacs compatible, return a string describing this." + (let ((compatible (get function 'byte-compatible-info))) + (if compatible + (format "Emacs Compatible; %s" + (if (stringp (car compatible)) + (car compatible) + (format "use `%s' instead." (car compatible))))))) + ;Here are all the possibilities below spelled out, for the benefit ;of the I18N3 snarfer. ; @@ -894,12 +907,18 @@ ;; If the function is obsolete and is aliased, don't ;; even bother to report the documentation, as a further ;; encouragement to use the new function. - (let ((obsolete (function-obsoleteness-doc function))) + (let ((obsolete (function-obsoleteness-doc function)) + (compatible (function-compatibility-doc function))) (if obsolete (progn (princ obsolete stream) (terpri stream) (terpri stream))) + (if compatible + (progn + (princ compatible stream) + (terpri stream) + (terpri stream))) (if (not (and obsolete aliases)) (progn (princ doc stream) @@ -955,6 +974,19 @@ obsolete (format "use `%s' instead." obsolete)))))) +(defun variable-compatible-p (variable) + "Return non-nil if VARIABLE is Emacs compatible." + (not (null (get variable 'byte-compatible-variable)))) + +(defun variable-compatibility-doc (variable) + "If VARIABLE is Emacs compatible, return a string describing this." + (let ((compatible (get variable 'byte-compatible-variable))) + (if compatible + (format "Emacs Compatible; %s" + (if (stringp compatible) + compatible + (format "use `%s' instead." compatible)))))) + (defun built-in-variable-doc (variable) "Return a string describing whether VARIABLE is built-in." (let ((type (built-in-variable-type variable))) @@ -1045,12 +1077,18 @@ (princ "Documentation:") (terpri) (let ((doc (documentation-property variable 'variable-documentation)) - (obsolete (variable-obsoleteness-doc origvar))) + (obsolete (variable-obsoleteness-doc origvar)) + (compatible (variable-compatibility-doc origvar))) (if obsolete (progn (princ obsolete) (terpri) (terpri))) + (if compatible + (progn + (princ compatible) + (terpri) + (terpri))) ;; don't bother to print anything if variable is obsolete and aliased. (if (or (not obsolete) (not aliases)) (if doc