Mercurial > emacs
comparison lisp/help.el @ 22417:e78006d10683
(help-make-xrefs): When scanning keymap binding listings,
scan from the very beginning.
(help-follow-mouse): Avoid save-excursion, so can set point properly.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 10 Jun 1998 00:27:04 +0000 |
parents | e7ec3ed4c814 |
children | eec1f722bded |
comparison
equal
deleted
inserted
replaced
22416:a517da228cb9 | 22417:e78006d10683 |
---|---|
968 (let ((sym (intern-soft (match-string 1)))) | 968 (let ((sym (intern-soft (match-string 1)))) |
969 (if (fboundp sym) | 969 (if (fboundp sym) |
970 (help-xref-button 1 #'describe-function sym))))) | 970 (help-xref-button 1 #'describe-function sym))))) |
971 ;; Look for commands in whole keymap substitutions: | 971 ;; Look for commands in whole keymap substitutions: |
972 (save-excursion | 972 (save-excursion |
973 ;; Make sure to find the first keymap. | |
974 (goto-char (point-min)) | |
973 ;; Find a header and the column at which the command | 975 ;; Find a header and the column at which the command |
974 ;; name will be found. | 976 ;; name will be found. |
975 (while (re-search-forward "^key +binding\n\\(-+ +\\)-+\n\n" | 977 (while (re-search-forward "^key +binding\n\\(-+ +\\)-+\n\n" |
976 nil t) | 978 nil t) |
977 (let ((col (- (match-end 1) (match-beginning 1)))) | 979 (let ((col (- (match-end 1) (match-beginning 1)))) |
1052 ;;; Navigation/hyperlinking with xrefs | 1054 ;;; Navigation/hyperlinking with xrefs |
1053 | 1055 |
1054 (defun help-follow-mouse (click) | 1056 (defun help-follow-mouse (click) |
1055 "Follow the cross-reference that you click on." | 1057 "Follow the cross-reference that you click on." |
1056 (interactive "e") | 1058 (interactive "e") |
1057 (save-excursion | 1059 (let* ((start (event-start click)) |
1058 (let* ((start (event-start click)) | 1060 (window (car start)) |
1059 (window (car start)) | 1061 (pos (car (cdr start)))) |
1060 (pos (car (cdr start)))) | 1062 (with-current-buffer (window-buffer window) |
1061 (set-buffer (window-buffer window)) | |
1062 (help-follow pos)))) | 1063 (help-follow pos)))) |
1063 | 1064 |
1064 (defun help-xref-go-back (buffer) | 1065 (defun help-xref-go-back (buffer) |
1065 "Go back to the previous help buffer text using info on `help-xref-stack'." | 1066 "Go back to the previous help buffer text using info on `help-xref-stack'." |
1066 (interactive) | 1067 (interactive) |