diff options
| author | Dave Love | 2000-05-09 15:51:57 +0000 |
|---|---|---|
| committer | Dave Love | 2000-05-09 15:51:57 +0000 |
| commit | 950cf06f8f023c10ebd0bb17f82f4146b916f435 (patch) | |
| tree | 1b917c0173ee0afae76a1d3863011565bd86de06 | |
| parent | 70d0c3b0635782e468dee87f2b87cc29e2f94d0a (diff) | |
| download | emacs-950cf06f8f023c10ebd0bb17f82f4146b916f435.tar.gz emacs-950cf06f8f023c10ebd0bb17f82f4146b916f435.zip | |
(describe-variable): Have customize button pop the
help-xref stack when invoked.
(help-xref-symbol-regexp): Add `face'.
(help-make-xrefs): Check for quoted face names and adapt regexp
submatch numbers to cope.
(help-xref-interned): Maybe insert face doc too. Separate
sections with a line of hyphens.
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/help.el | 46 |
2 files changed, 47 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ddd988d2d7..3d2e756c573 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2000-05-09 Dave Love <fx@gnu.org> | ||
| 2 | |||
| 3 | Changes mostly following Richard Sharman <rsharman@wave.home.com>. | ||
| 4 | |||
| 5 | * help.el (describe-variable): Have customize button pop the | ||
| 6 | help-xref stack when invoked. | ||
| 7 | (help-xref-symbol-regexp): Add `face'. | ||
| 8 | (help-make-xrefs): Check for quoted face names and adapt regexp | ||
| 9 | submatch numbers to cope. | ||
| 10 | (help-xref-interned): Maybe insert face doc too. Separate | ||
| 11 | sections with a line of hyphens. | ||
| 12 | |||
| 13 | * faces.el: Some doc fixes. | ||
| 14 | (describe-face): Add customize button. Return the help | ||
| 15 | text. Fix prompt. | ||
| 16 | |||
| 1 | 2000-05-09 Eli Zaretskii <eliz@is.elta.co.il> | 17 | 2000-05-09 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 18 | ||
| 3 | * term/internal.el (IT-character-translations): Fix last change. | 19 | * term/internal.el (IT-character-translations): Fix last change. |
diff --git a/lisp/help.el b/lisp/help.el index 6b4b65ef6da..75fc64d7fa2 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -858,11 +858,12 @@ Returns the documentation as a string, also." | |||
| 858 | (save-excursion | 858 | (save-excursion |
| 859 | (re-search-backward | 859 | (re-search-backward |
| 860 | (concat "\\(" customize-label "\\)") nil t) | 860 | (concat "\\(" customize-label "\\)") nil t) |
| 861 | (help-xref-button 1 #'(lambda (v) | 861 | (help-xref-button 1 (lambda (v) |
| 862 | (customize-variable v)) | 862 | (if help-xref-stack |
| 863 | (pop help-xref-stack)) | ||
| 864 | (customize-variable v)) | ||
| 863 | variable | 865 | variable |
| 864 | "mouse-2, RET: customize variable") | 866 | "mouse-2, RET: customize variable"))))) |
| 865 | )))) | ||
| 866 | ;; Make a hyperlink to the library if appropriate. (Don't | 867 | ;; Make a hyperlink to the library if appropriate. (Don't |
| 867 | ;; change the format of the buffer's initial line in case | 868 | ;; change the format of the buffer's initial line in case |
| 868 | ;; anything expects the current format.) | 869 | ;; anything expects the current format.) |
| @@ -1014,6 +1015,7 @@ Must be previously-defined." | |||
| 1014 | (defconst help-xref-symbol-regexp | 1015 | (defconst help-xref-symbol-regexp |
| 1015 | (purecopy (concat "\\(\\<\\(\\(variable\\|option\\)\\|" | 1016 | (purecopy (concat "\\(\\<\\(\\(variable\\|option\\)\\|" |
| 1016 | "\\(function\\|command\\)\\|" | 1017 | "\\(function\\|command\\)\\|" |
| 1018 | "\\(face\\)\\|" | ||
| 1017 | "\\(symbol\\)\\)\\s-+\\)?" | 1019 | "\\(symbol\\)\\)\\s-+\\)?" |
| 1018 | ;; Note starting with word-syntax character: | 1020 | ;; Note starting with word-syntax character: |
| 1019 | "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'")) | 1021 | "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'")) |
| @@ -1077,7 +1079,7 @@ that." | |||
| 1077 | ;; Quoted symbols | 1079 | ;; Quoted symbols |
| 1078 | (save-excursion | 1080 | (save-excursion |
| 1079 | (while (re-search-forward help-xref-symbol-regexp nil t) | 1081 | (while (re-search-forward help-xref-symbol-regexp nil t) |
| 1080 | (let* ((data (match-string 6)) | 1082 | (let* ((data (match-string 7)) |
| 1081 | (sym (intern-soft data))) | 1083 | (sym (intern-soft data))) |
| 1082 | (if sym | 1084 | (if sym |
| 1083 | (cond | 1085 | (cond |
| @@ -1085,28 +1087,35 @@ that." | |||
| 1085 | (and (boundp sym) ; `variable' doesn't ensure | 1087 | (and (boundp sym) ; `variable' doesn't ensure |
| 1086 | ; it's actually bound | 1088 | ; it's actually bound |
| 1087 | (help-xref-button | 1089 | (help-xref-button |
| 1088 | 6 #'describe-variable sym | 1090 | 7 #'describe-variable sym |
| 1089 | "mouse-2, RET: describe this variable"))) | 1091 | "mouse-2, RET: describe this variable"))) |
| 1090 | ((match-string 4) ; `function' &c | 1092 | ((match-string 4) ; `function' &c |
| 1091 | (and (fboundp sym) ; similarly | 1093 | (and (fboundp sym) ; similarly |
| 1092 | (help-xref-button | 1094 | (help-xref-button |
| 1093 | 6 #'describe-function sym | 1095 | 7 #'describe-function sym |
| 1094 | "mouse-2, RET: describe this function"))) | 1096 | "mouse-2, RET: describe this function"))) |
| 1095 | ((match-string 5)) ; nothing for symbol | 1097 | ((match-string 5) ; `face' |
| 1098 | (and (facep sym) | ||
| 1099 | (help-xref-button 7 #'describe-face sym | ||
| 1100 | "mouse-2, RET: describe this face"))) | ||
| 1101 | ((match-string 6)) ; nothing for symbol | ||
| 1096 | ((and (boundp sym) (fboundp sym)) | 1102 | ((and (boundp sym) (fboundp sym)) |
| 1097 | ;; We can't intuit whether to use the | 1103 | ;; We can't intuit whether to use the |
| 1098 | ;; variable or function doc -- supply both. | 1104 | ;; variable or function doc -- supply both. |
| 1099 | (help-xref-button | 1105 | (help-xref-button |
| 1100 | 6 #'help-xref-interned sym | 1106 | 7 #'help-xref-interned sym |
| 1101 | "mouse-2, RET: describe this symbol")) | 1107 | "mouse-2, RET: describe this symbol")) |
| 1102 | ((boundp sym) | 1108 | ((boundp sym) |
| 1103 | (help-xref-button | 1109 | (help-xref-button |
| 1104 | 6 #'describe-variable sym | 1110 | 7 #'describe-variable sym |
| 1105 | "mouse-2, RET: describe this variable")) | 1111 | "mouse-2, RET: describe this variable")) |
| 1106 | ((fboundp sym) | 1112 | ((fboundp sym) |
| 1107 | (help-xref-button | 1113 | (help-xref-button |
| 1108 | 6 #'describe-function sym | 1114 | 7 #'describe-function sym |
| 1109 | "mouse-2, RET: describe this function"))))))) | 1115 | "mouse-2, RET: describe this function")) |
| 1116 | ((facep sym) | ||
| 1117 | (help-xref-button | ||
| 1118 | 7 #'describe-face sym))))))) | ||
| 1110 | ;; An obvious case of a key substitution: | 1119 | ;; An obvious case of a key substitution: |
| 1111 | (save-excursion | 1120 | (save-excursion |
| 1112 | (while (re-search-forward | 1121 | (while (re-search-forward |
| @@ -1194,16 +1203,23 @@ If optional arg HELP-ECHO is supplied, it is used as a help string." | |||
| 1194 | 1203 | ||
| 1195 | Both variable and function documentation are extracted into a single | 1204 | Both variable and function documentation are extracted into a single |
| 1196 | help buffer." | 1205 | help buffer." |
| 1197 | (let ((fdoc (when (fboundp symbol) (describe-function symbol)))) | 1206 | (let ((fdoc (when (fboundp symbol) (describe-function symbol))) |
| 1207 | (facedoc (when (facep symbol) (describe-face symbol)))) | ||
| 1198 | (when (or (boundp symbol) (not fdoc)) | 1208 | (when (or (boundp symbol) (not fdoc)) |
| 1199 | (describe-variable symbol) | 1209 | (describe-variable symbol) |
| 1200 | ;; We now have a help buffer on the variable. Insert the function | 1210 | ;; We now have a help buffer on the variable. Insert the function |
| 1201 | ;; text before it. | 1211 | ;; text before it. |
| 1202 | (when fdoc | 1212 | (when (or fdoc facedoc) |
| 1203 | (with-current-buffer "*Help*" | 1213 | (with-current-buffer "*Help*" |
| 1204 | (goto-char (point-min)) | 1214 | (goto-char (point-min)) |
| 1205 | (let ((inhibit-read-only t)) | 1215 | (let ((inhibit-read-only t)) |
| 1206 | (insert fdoc "\n\n" (symbol-name symbol) " is also a variable.\n\n")) | 1216 | (when fdoc |
| 1217 | (insert fdoc "\n\n")) | ||
| 1218 | (when facedoc | ||
| 1219 | (insert (make-string 30 ?-) "\n\n" (symbol-name symbol) | ||
| 1220 | " is also a " "face." "\n\n" facedoc "\n\n")) | ||
| 1221 | (insert (make-string 30 ?-) "\n\n" (symbol-name symbol) | ||
| 1222 | " is also a " "variable." "\n\n")) | ||
| 1207 | (help-setup-xref (list #'help-xref-interned symbol) nil)))))) | 1223 | (help-setup-xref (list #'help-xref-interned symbol) nil)))))) |
| 1208 | 1224 | ||
| 1209 | (defun help-xref-mode (buffer) | 1225 | (defun help-xref-mode (buffer) |