diff options
| author | Dave Love | 1998-04-06 09:56:55 +0000 |
|---|---|---|
| committer | Dave Love | 1998-04-06 09:56:55 +0000 |
| commit | ff3453e4d171f566fc372a3edea912afee645813 (patch) | |
| tree | f710db7131590a25eb665da856675dc0d48e027b /lisp | |
| parent | 515e3036c06a8cc4d4566030fd6ca8c12d13c7c3 (diff) | |
| download | emacs-ff3453e4d171f566fc372a3edea912afee645813.tar.gz emacs-ff3453e4d171f566fc372a3edea912afee645813.zip | |
(help-make-xrefs): Grok commands in keymap table
expansions.
(help-xref-button): Simplify.
(help-make-xrefs): Set overriding keymap properly.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/help.el | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/lisp/help.el b/lisp/help.el index bef91749235..2f28e53796e 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -937,7 +937,29 @@ that." | |||
| 937 | "\\<M-x\\s-+\\(\\sw\\(\\sw\\|\\s_\\)+\\)" nil t) | 937 | "\\<M-x\\s-+\\(\\sw\\(\\sw\\|\\s_\\)+\\)" nil t) |
| 938 | (let ((sym (intern-soft (match-string 1)))) | 938 | (let ((sym (intern-soft (match-string 1)))) |
| 939 | (if (fboundp sym) | 939 | (if (fboundp sym) |
| 940 | (help-xref-button 1 #'describe-function sym)))))) | 940 | (help-xref-button 1 #'describe-function sym))))) |
| 941 | ;; Look for commands in whole keymap substitutions: | ||
| 942 | (save-excursion | ||
| 943 | ;; Find a header and the column at which the command | ||
| 944 | ;; name will be found. | ||
| 945 | (while (re-search-forward "^key +binding\n\\(-+ +\\)-+\n\n" | ||
| 946 | nil t) | ||
| 947 | (let ((col (- (match-end 1) (match-beginning 1)))) | ||
| 948 | (while | ||
| 949 | ;; Ignore single blank lines in table, but not | ||
| 950 | ;; double ones, which should terminate it. | ||
| 951 | (and (looking-at "^\n?[^\n]") | ||
| 952 | (progn | ||
| 953 | (if (and (> (move-to-column col) 0) | ||
| 954 | (looking-at "\\(\\sw\\|\\s_\\)+$")) | ||
| 955 | ;; | ||
| 956 | (let ((sym (intern-soft (match-string 0)))) | ||
| 957 | (if (fboundp sym) | ||
| 958 | (help-xref-button | ||
| 959 | 0 #'describe-function sym)))) | ||
| 960 | t) | ||
| 961 | (zerop (forward-line)) | ||
| 962 | (move-to-column 0))))))) | ||
| 941 | (set-syntax-table stab)) | 963 | (set-syntax-table stab)) |
| 942 | ;; Make a back-reference in this buffer if appropriate. | 964 | ;; Make a back-reference in this buffer if appropriate. |
| 943 | (when help-xref-stack | 965 | (when help-xref-stack |
| @@ -951,6 +973,7 @@ that." | |||
| 951 | (set (make-local-variable 'minor-mode-overriding-map-alist) | 973 | (set (make-local-variable 'minor-mode-overriding-map-alist) |
| 952 | (list (cons 'view-mode | 974 | (list (cons 'view-mode |
| 953 | (let ((map (make-sparse-keymap))) | 975 | (let ((map (make-sparse-keymap))) |
| 976 | (set-keymap-parent map view-mode-map) | ||
| 954 | (define-key map "\r" 'help-follow) | 977 | (define-key map "\r" 'help-follow) |
| 955 | map)))) | 978 | map)))) |
| 956 | (set-buffer-modified-p old-modified)))) | 979 | (set-buffer-modified-p old-modified)))) |
| @@ -962,19 +985,17 @@ MATCH-NUMBER is the subexpression of interest in the last matched | |||
| 962 | regexp. FUNCTION is a function to invoke when the button is | 985 | regexp. FUNCTION is a function to invoke when the button is |
| 963 | activated, applied to DATA. DATA may be a single value or a list. | 986 | activated, applied to DATA. DATA may be a single value or a list. |
| 964 | See `help-make-xrefs'." | 987 | See `help-make-xrefs'." |
| 965 | (put-text-property (match-beginning match-number) | 988 | (add-text-properties (match-beginning match-number) |
| 966 | (match-end match-number) | ||
| 967 | 'mouse-face 'highlight) | ||
| 968 | (if help-highlight-p | ||
| 969 | (put-text-property (match-beginning match-number) | ||
| 970 | (match-end match-number) | ||
| 971 | 'face help-highlight-face)) | ||
| 972 | (put-text-property (match-beginning match-number) | ||
| 973 | (match-end match-number) | 989 | (match-end match-number) |
| 990 | (list 'mouse-face 'highlight | ||
| 974 | 'help-xref (cons function | 991 | 'help-xref (cons function |
| 975 | (if (listp data) | 992 | (if (listp data) |
| 976 | data | 993 | data |
| 977 | (list data))))) | 994 | (list data))))) |
| 995 | (if help-highlight-p | ||
| 996 | (put-text-property (match-beginning match-number) | ||
| 997 | (match-end match-number) | ||
| 998 | 'face help-highlight-face))) | ||
| 978 | 999 | ||
| 979 | 1000 | ||
| 980 | ;; Additional functions for (re-)creating types of help buffers. | 1001 | ;; Additional functions for (re-)creating types of help buffers. |
| @@ -1048,8 +1069,8 @@ For the cross-reference format, see `help-make-xrefs'." | |||
| 1048 | (let (pos) | 1069 | (let (pos) |
| 1049 | (while (not pos) | 1070 | (while (not pos) |
| 1050 | (if (get-text-property (point) 'help-xref) ; move off reference | 1071 | (if (get-text-property (point) 'help-xref) ; move off reference |
| 1051 | (or (goto-char (next-single-property-change (point) 'help-xref)) | 1072 | (goto-char (or (next-single-property-change (point) 'help-xref) |
| 1052 | (point))) | 1073 | (point)))) |
| 1053 | (cond ((setq pos (next-single-property-change (point) 'help-xref)) | 1074 | (cond ((setq pos (next-single-property-change (point) 'help-xref)) |
| 1054 | (if pos (goto-char pos))) | 1075 | (if pos (goto-char pos))) |
| 1055 | ((bobp) | 1076 | ((bobp) |