Mercurial > hg > xemacs-beta
comparison lisp/prim/help.el @ 24:4103f0995bd7 r19-15b95
Import from CVS: tag r19-15b95
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:51:03 +0200 |
parents | 8fc7fe29b841 |
children | 441bb1e64a06 |
comparison
equal
deleted
inserted
replaced
23:0edd3412f124 | 24:4103f0995bd7 |
---|---|
780 (if obsolete | 780 (if obsolete |
781 (format "Obsolete; %s" | 781 (format "Obsolete; %s" |
782 (if (stringp (car obsolete)) | 782 (if (stringp (car obsolete)) |
783 (car obsolete) | 783 (car obsolete) |
784 (format "use `%s' instead." (car obsolete))))))) | 784 (format "use `%s' instead." (car obsolete))))))) |
785 | |
786 (defun function-compatible-p (function) | |
787 "Return non-nil if FUNCTION is present for Emacs compatibility." | |
788 (not (null (get function 'byte-compatible-info)))) | |
789 | |
790 (defun function-compatibility-doc (function) | |
791 "If FUNCTION is Emacs compatible, return a string describing this." | |
792 (let ((compatible (get function 'byte-compatible-info))) | |
793 (if compatible | |
794 (format "Emacs Compatible; %s" | |
795 (if (stringp (car compatible)) | |
796 (car compatible) | |
797 (format "use `%s' instead." (car compatible))))))) | |
785 | 798 |
786 ;Here are all the possibilities below spelled out, for the benefit | 799 ;Here are all the possibilities below spelled out, for the benefit |
787 ;of the I18N3 snarfer. | 800 ;of the I18N3 snarfer. |
788 ; | 801 ; |
789 ;(gettext "a built-in function") | 802 ;(gettext "a built-in function") |
895 (t | 908 (t |
896 ;; tell the user about obsoleteness. | 909 ;; tell the user about obsoleteness. |
897 ;; If the function is obsolete and is aliased, don't | 910 ;; If the function is obsolete and is aliased, don't |
898 ;; even bother to report the documentation, as a further | 911 ;; even bother to report the documentation, as a further |
899 ;; encouragement to use the new function. | 912 ;; encouragement to use the new function. |
900 (let ((obsolete (function-obsoleteness-doc function))) | 913 (let ((obsolete (function-obsoleteness-doc function)) |
914 (compatible (function-compatibility-doc function))) | |
901 (if obsolete | 915 (if obsolete |
902 (progn | 916 (progn |
903 (princ obsolete stream) | 917 (princ obsolete stream) |
918 (terpri stream) | |
919 (terpri stream))) | |
920 (if compatible | |
921 (progn | |
922 (princ compatible stream) | |
904 (terpri stream) | 923 (terpri stream) |
905 (terpri stream))) | 924 (terpri stream))) |
906 (if (not (and obsolete aliases)) | 925 (if (not (and obsolete aliases)) |
907 (progn | 926 (progn |
908 (princ doc stream) | 927 (princ doc stream) |
955 (if obsolete | 974 (if obsolete |
956 (format "Obsolete; %s" | 975 (format "Obsolete; %s" |
957 (if (stringp obsolete) | 976 (if (stringp obsolete) |
958 obsolete | 977 obsolete |
959 (format "use `%s' instead." obsolete)))))) | 978 (format "use `%s' instead." obsolete)))))) |
979 | |
980 (defun variable-compatible-p (variable) | |
981 "Return non-nil if VARIABLE is Emacs compatible." | |
982 (not (null (get variable 'byte-compatible-variable)))) | |
983 | |
984 (defun variable-compatibility-doc (variable) | |
985 "If VARIABLE is Emacs compatible, return a string describing this." | |
986 (let ((compatible (get variable 'byte-compatible-variable))) | |
987 (if compatible | |
988 (format "Emacs Compatible; %s" | |
989 (if (stringp compatible) | |
990 compatible | |
991 (format "use `%s' instead." compatible)))))) | |
960 | 992 |
961 (defun built-in-variable-doc (variable) | 993 (defun built-in-variable-doc (variable) |
962 "Return a string describing whether VARIABLE is built-in." | 994 "Return a string describing whether VARIABLE is built-in." |
963 (let ((type (built-in-variable-type variable))) | 995 (let ((type (built-in-variable-type variable))) |
964 (cond ((eq type 'integer) "a built-in integer variable") | 996 (cond ((eq type 'integer) "a built-in integer variable") |
1046 (terpri)))) | 1078 (terpri)))) |
1047 (terpri) | 1079 (terpri) |
1048 (princ "Documentation:") | 1080 (princ "Documentation:") |
1049 (terpri) | 1081 (terpri) |
1050 (let ((doc (documentation-property variable 'variable-documentation)) | 1082 (let ((doc (documentation-property variable 'variable-documentation)) |
1051 (obsolete (variable-obsoleteness-doc origvar))) | 1083 (obsolete (variable-obsoleteness-doc origvar)) |
1084 (compatible (variable-compatibility-doc origvar))) | |
1052 (if obsolete | 1085 (if obsolete |
1053 (progn | 1086 (progn |
1054 (princ obsolete) | 1087 (princ obsolete) |
1088 (terpri) | |
1089 (terpri))) | |
1090 (if compatible | |
1091 (progn | |
1092 (princ compatible) | |
1055 (terpri) | 1093 (terpri) |
1056 (terpri))) | 1094 (terpri))) |
1057 ;; don't bother to print anything if variable is obsolete and aliased. | 1095 ;; don't bother to print anything if variable is obsolete and aliased. |
1058 (if (or (not obsolete) (not aliases)) | 1096 (if (or (not obsolete) (not aliases)) |
1059 (if doc | 1097 (if doc |