diff options
| author | Kenichi Handa | 2000-09-07 02:37:37 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-09-07 02:37:37 +0000 |
| commit | 96ede6b2d5eea0b4865bb0b05978c4f86a125d6a (patch) | |
| tree | b7598451aa7940b6a222d2eff92e483d55f15adb | |
| parent | 0a42d1341165a40c91317d854e690cef011dd4d2 (diff) | |
| download | emacs-96ede6b2d5eea0b4865bb0b05978c4f86a125d6a.tar.gz emacs-96ede6b2d5eea0b4865bb0b05978c4f86a125d6a.zip | |
(help-make-xrefs): Adjusted for the change of
help-xref-mule-regexp.
(help-insert-xref-button): New function.
| -rw-r--r-- | lisp/help.el | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/lisp/help.el b/lisp/help.el index cb5083664a4..638ad6fa89e 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -1130,27 +1130,36 @@ that." | |||
| 1130 | (if help-xref-mule-regexp | 1130 | (if help-xref-mule-regexp |
| 1131 | (save-excursion | 1131 | (save-excursion |
| 1132 | (while (re-search-forward help-xref-mule-regexp nil t) | 1132 | (while (re-search-forward help-xref-mule-regexp nil t) |
| 1133 | (let* ((data (match-string 5)) | 1133 | (let* ((data (match-string 7)) |
| 1134 | (sym (intern-soft data))) | 1134 | (sym (intern-soft data))) |
| 1135 | (cond | 1135 | (cond |
| 1136 | ((match-string 3) ; coding system | 1136 | ((match-string 3) ; coding system |
| 1137 | (and sym (coding-system-p sym) | 1137 | (and sym (coding-system-p sym) |
| 1138 | (help-xref-button | 1138 | (help-xref-button |
| 1139 | 5 #'describe-coding-system sym | 1139 | 7 #'describe-coding-system sym |
| 1140 | "mouse-2, RET: describe this coding system"))) | 1140 | "mouse-2, RET: describe this coding system"))) |
| 1141 | ((match-string 4) ; input method | 1141 | ((match-string 4) ; input method |
| 1142 | (and (assoc data input-method-alist) | 1142 | (and (assoc data input-method-alist) |
| 1143 | (help-xref-button | 1143 | (help-xref-button |
| 1144 | 5 #'describe-input-method data | 1144 | 7 #'describe-input-method data |
| 1145 | "mouse-2, RET: describe this input method"))) | 1145 | "mouse-2, RET: describe this input method"))) |
| 1146 | ((or (match-string 5) (match-string 6)) ; charset | ||
| 1147 | (and sym (charsetp sym) | ||
| 1148 | (help-xref-button | ||
| 1149 | 7 #'describe-character-set sym | ||
| 1150 | "mouse-2, RET: describe this character set"))) | ||
| 1151 | ((assoc data input-method-alist) | ||
| 1152 | (help-xref-button | ||
| 1153 | 7 #'describe-input-method data | ||
| 1154 | "mouse-2, RET: describe this input method")) | ||
| 1146 | ((and sym (coding-system-p sym)) | 1155 | ((and sym (coding-system-p sym)) |
| 1147 | (help-xref-button | 1156 | (help-xref-button |
| 1148 | 5 #'describe-coding-system sym | 1157 | 7 #'describe-coding-system sym |
| 1149 | "mouse-2, RET: describe this coding system")) | 1158 | "mouse-2, RET: describe this coding system")) |
| 1150 | ((assoc data input-method-alist) | 1159 | ((and sym (charsetp sym)) |
| 1151 | (help-xref-button | 1160 | (help-xref-button |
| 1152 | 5 #'describe-input-method data | 1161 | 7 #'describe-character-set sym |
| 1153 | "mouse-2, RET: describe this input method"))))))) | 1162 | "mouse-2, RET: describe this character set"))))))) |
| 1154 | ;; Quoted symbols | 1163 | ;; Quoted symbols |
| 1155 | (save-excursion | 1164 | (save-excursion |
| 1156 | (while (re-search-forward help-xref-symbol-regexp nil t) | 1165 | (while (re-search-forward help-xref-symbol-regexp nil t) |
| @@ -1271,6 +1280,20 @@ If optional arg HELP-ECHO is supplied, it is used as a help string." | |||
| 1271 | (match-end match-number) | 1280 | (match-end match-number) |
| 1272 | 'face help-highlight-face)))) | 1281 | 'face help-highlight-face)))) |
| 1273 | 1282 | ||
| 1283 | (defun help-insert-xref-button (string function data &optional help-echo) | ||
| 1284 | "Insert STRING and make a hyperlink fro cross-reference text on it. | ||
| 1285 | |||
| 1286 | FUNCTION is a function to invoke when the button is activated, applied | ||
| 1287 | to DATA. DATA may be a single value or a list. See | ||
| 1288 | `help-make-xrefs'. | ||
| 1289 | If optional arg HELP-ECHO is supplied, it is used as a help string." | ||
| 1290 | (let ((pos (point))) | ||
| 1291 | (insert string) | ||
| 1292 | (goto-char pos) | ||
| 1293 | (search-forward string) | ||
| 1294 | (help-xref-button 0 function data help-echo))) | ||
| 1295 | |||
| 1296 | |||
| 1274 | 1297 | ||
| 1275 | ;; Additional functions for (re-)creating types of help buffers. | 1298 | ;; Additional functions for (re-)creating types of help buffers. |
| 1276 | (defun help-xref-interned (symbol) | 1299 | (defun help-xref-interned (symbol) |