comparison lisp/help.el @ 31243:30007aab98df

(help-xref-mule-regexp): New variable (help-make-xrefs): Handle help-xref-mule-regexp.
author Kenichi Handa <handa@m17n.org>
date Tue, 29 Aug 2000 05:36:45 +0000
parents 67bba5cea7bf
children c3f064fd988f
comparison
equal deleted inserted replaced
31242:83c09215d4a1 31243:30007aab98df
1054 "Regexp matching doc string references to symbols. 1054 "Regexp matching doc string references to symbols.
1055 1055
1056 The words preceding the quoted symbol can be used in doc strings to 1056 The words preceding the quoted symbol can be used in doc strings to
1057 distinguish references to variables, functions and symbols.") 1057 distinguish references to variables, functions and symbols.")
1058 1058
1059 (defconst help-xref-mule-regexp nil
1060 "Regexp matching doc string references to multilingualization related keywords.
1061
1062 It is usually nil, and temporarily bound to a proper regexp while
1063 executing multilingualiation related help commands
1064 (e.g. describe-coding-system).")
1065
1066
1059 (defconst help-xref-info-regexp 1067 (defconst help-xref-info-regexp
1060 (purecopy "\\<[Ii]nfo[ \t\n]+node[ \t\n]+`\\([^']+\\)'") 1068 (purecopy "\\<[Ii]nfo[ \t\n]+node[ \t\n]+`\\([^']+\\)'")
1061 "Regexp matching doc string references to an Info node.") 1069 "Regexp matching doc string references to an Info node.")
1062 1070
1063 (defun help-setup-xref (item interactive-p) 1071 (defun help-setup-xref (item interactive-p)
1081 `help-highlight-p' is non-nil, highlight it with face defined by 1089 `help-highlight-p' is non-nil, highlight it with face defined by
1082 `help-highlight-face'; activate such cross references for selection 1090 `help-highlight-face'; activate such cross references for selection
1083 with `help-follow'. Cross-references have the canonical form `...' 1091 with `help-follow'. Cross-references have the canonical form `...'
1084 and the type of reference may be disambiguated by the preceding 1092 and the type of reference may be disambiguated by the preceding
1085 word(s) used in `help-xref-symbol-regexp'. 1093 word(s) used in `help-xref-symbol-regexp'.
1094
1095 If the variable `help-xref-mule-regexp' is non-nil, find also
1096 cross-reference information related to multiligualization issues
1097 \(e.g. coding-system). This variable is also used to disambiguate the
1098 type of reference as the same way as `help-xref-symbol-regexp'.
1086 1099
1087 A special reference `back' is made to return back through a stack of 1100 A special reference `back' is made to return back through a stack of
1088 help buffers. Variable `help-back-label' specifies the text for 1101 help buffers. Variable `help-back-label' specifies the text for
1089 that." 1102 that."
1090 (interactive "b") 1103 (interactive "b")
1109 (save-match-data 1122 (save-match-data
1110 (unless (string-match "^([^)]+)" data) 1123 (unless (string-match "^([^)]+)" data)
1111 (setq data (concat "(emacs)" data)))) 1124 (setq data (concat "(emacs)" data))))
1112 (help-xref-button 1 #'info data 1125 (help-xref-button 1 #'info data
1113 "mouse-2, RET: read this Info node")))) 1126 "mouse-2, RET: read this Info node"))))
1127 ;; Mule related keywords. Do this before trying
1128 ;; `help-xref-symbol-regexp' because some of Mule
1129 ;; keywords have variable or function definitions.
1130 (if help-xref-mule-regexp
1131 (save-excursion
1132 (while (re-search-forward help-xref-mule-regexp nil t)
1133 (let* ((data (match-string 5))
1134 (sym (intern-soft data)))
1135 (cond
1136 ((match-string 3) ; coding system
1137 (and (coding-system-p sym)
1138 (help-xref-button
1139 5 #'describe-coding-system sym
1140 "mouse-2, RET: describe this coding system")))
1141 ((match-string 4) ; input method
1142 (and (assoc data input-method-alist)
1143 (help-xref-button
1144 5 #'describe-input-method data
1145 "mouse-2, RET: describe this input method")))
1146 ((coding-system-p sym)
1147 (help-xref-button
1148 5 #'describe-coding-system sym
1149 "mouse-2, RET: describe this coding system"))
1150 ((assoc data input-method-alist)
1151 (help-xref-button
1152 5 #'describe-input-method data
1153 "mouse-2, RET: describe this input method")))))))
1114 ;; Quoted symbols 1154 ;; Quoted symbols
1115 (save-excursion 1155 (save-excursion
1116 (while (re-search-forward help-xref-symbol-regexp nil t) 1156 (while (re-search-forward help-xref-symbol-regexp nil t)
1117 (let* ((data (match-string 7)) 1157 (let* ((data (match-string 7))
1118 (sym (intern-soft data))) 1158 (sym (intern-soft data)))