comparison 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
comparison
equal deleted inserted replaced
99:2d83cbd90d8d 100:4be1180a9e89
777 (if obsolete 777 (if obsolete
778 (format "Obsolete; %s" 778 (format "Obsolete; %s"
779 (if (stringp (car obsolete)) 779 (if (stringp (car obsolete))
780 (car obsolete) 780 (car obsolete)
781 (format "use `%s' instead." (car obsolete))))))) 781 (format "use `%s' instead." (car obsolete)))))))
782
783 (defun function-compatible-p (function)
784 "Return non-nil if FUNCTION is present for Emacs compatibility."
785 (not (null (get function 'byte-compatible-info))))
786
787 (defun function-compatibility-doc (function)
788 "If FUNCTION is Emacs compatible, return a string describing this."
789 (let ((compatible (get function 'byte-compatible-info)))
790 (if compatible
791 (format "Emacs Compatible; %s"
792 (if (stringp (car compatible))
793 (car compatible)
794 (format "use `%s' instead." (car compatible)))))))
782 795
783 ;Here are all the possibilities below spelled out, for the benefit 796 ;Here are all the possibilities below spelled out, for the benefit
784 ;of the I18N3 snarfer. 797 ;of the I18N3 snarfer.
785 ; 798 ;
786 ;(gettext "a built-in function") 799 ;(gettext "a built-in function")
892 (t 905 (t
893 ;; tell the user about obsoleteness. 906 ;; tell the user about obsoleteness.
894 ;; If the function is obsolete and is aliased, don't 907 ;; If the function is obsolete and is aliased, don't
895 ;; even bother to report the documentation, as a further 908 ;; even bother to report the documentation, as a further
896 ;; encouragement to use the new function. 909 ;; encouragement to use the new function.
897 (let ((obsolete (function-obsoleteness-doc function))) 910 (let ((obsolete (function-obsoleteness-doc function))
911 (compatible (function-compatibility-doc function)))
898 (if obsolete 912 (if obsolete
899 (progn 913 (progn
900 (princ obsolete stream) 914 (princ obsolete stream)
915 (terpri stream)
916 (terpri stream)))
917 (if compatible
918 (progn
919 (princ compatible stream)
901 (terpri stream) 920 (terpri stream)
902 (terpri stream))) 921 (terpri stream)))
903 (if (not (and obsolete aliases)) 922 (if (not (and obsolete aliases))
904 (progn 923 (progn
905 (princ doc stream) 924 (princ doc stream)
952 (if obsolete 971 (if obsolete
953 (format "Obsolete; %s" 972 (format "Obsolete; %s"
954 (if (stringp obsolete) 973 (if (stringp obsolete)
955 obsolete 974 obsolete
956 (format "use `%s' instead." obsolete)))))) 975 (format "use `%s' instead." obsolete))))))
976
977 (defun variable-compatible-p (variable)
978 "Return non-nil if VARIABLE is Emacs compatible."
979 (not (null (get variable 'byte-compatible-variable))))
980
981 (defun variable-compatibility-doc (variable)
982 "If VARIABLE is Emacs compatible, return a string describing this."
983 (let ((compatible (get variable 'byte-compatible-variable)))
984 (if compatible
985 (format "Emacs Compatible; %s"
986 (if (stringp compatible)
987 compatible
988 (format "use `%s' instead." compatible))))))
957 989
958 (defun built-in-variable-doc (variable) 990 (defun built-in-variable-doc (variable)
959 "Return a string describing whether VARIABLE is built-in." 991 "Return a string describing whether VARIABLE is built-in."
960 (let ((type (built-in-variable-type variable))) 992 (let ((type (built-in-variable-type variable)))
961 (cond ((eq type 'integer) "a built-in integer variable") 993 (cond ((eq type 'integer) "a built-in integer variable")
1043 (terpri)))) 1075 (terpri))))
1044 (terpri) 1076 (terpri)
1045 (princ "Documentation:") 1077 (princ "Documentation:")
1046 (terpri) 1078 (terpri)
1047 (let ((doc (documentation-property variable 'variable-documentation)) 1079 (let ((doc (documentation-property variable 'variable-documentation))
1048 (obsolete (variable-obsoleteness-doc origvar))) 1080 (obsolete (variable-obsoleteness-doc origvar))
1081 (compatible (variable-compatibility-doc origvar)))
1049 (if obsolete 1082 (if obsolete
1050 (progn 1083 (progn
1051 (princ obsolete) 1084 (princ obsolete)
1085 (terpri)
1086 (terpri)))
1087 (if compatible
1088 (progn
1089 (princ compatible)
1052 (terpri) 1090 (terpri)
1053 (terpri))) 1091 (terpri)))
1054 ;; don't bother to print anything if variable is obsolete and aliased. 1092 ;; don't bother to print anything if variable is obsolete and aliased.
1055 (if (or (not obsolete) (not aliases)) 1093 (if (or (not obsolete) (not aliases))
1056 (if doc 1094 (if doc