Mercurial > hg > xemacs-beta
comparison lisp/help.el @ 211:78478c60bfcd r20-4b4
Import from CVS: tag r20-4b4
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:05:51 +0200 |
parents | 41ff10fd062f |
children | 1f0dabaa0855 |
comparison
equal
deleted
inserted
replaced
210:49f55ca3ba57 | 211:78478c60bfcd |
---|---|
34 ;; 06/11/1997 -- Converted to use char-after instead of broken | 34 ;; 06/11/1997 -- Converted to use char-after instead of broken |
35 ;; following-char. -slb | 35 ;; following-char. -slb |
36 | 36 |
37 ;;; Code: | 37 ;;; Code: |
38 | 38 |
39 ;#### FSFmacs | |
40 ;; Get the macro make-help-screen when this is compiled, | 39 ;; Get the macro make-help-screen when this is compiled, |
41 ;; or run interpreted, but not when the compiled code is loaded. | 40 ;; or run interpreted, but not when the compiled code is loaded. |
42 ;(eval-when-compile (require 'help-macro)) | 41 (eval-when-compile (require 'help-macro)) |
43 | 42 |
44 (defgroup help-appearance nil | 43 (defgroup help-appearance nil |
45 "Appearance of help buffers" | 44 "Appearance of help buffers" |
46 :group 'help) | 45 :group 'help) |
47 | 46 |
682 (forward-line -1 buffer) | 681 (forward-line -1 buffer) |
683 (insert-buffer-substring buffer (point buffer) oldpoint) | 682 (insert-buffer-substring buffer (point buffer) oldpoint) |
684 (setq count (1+ count)))))))) | 683 (setq count (1+ count)))))))) |
685 | 684 |
686 (define-function 'help 'help-for-help) | 685 (define-function 'help 'help-for-help) |
687 ;; #### FSF calls `make-help-screen' here. We need to port `help-macro.el'. | 686 |
688 (defun help-for-help () | 687 (make-help-screen help-for-help |
689 "You have typed \\[help-for-help], the help character. Type a Help option: | 688 "A B C F I K L M N P S T V W C-c C-d C-f C-i C-k C-n C-w; ? for more help:" |
689 "Type a Help option: | |
690 \(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.) | 690 \(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.) |
691 | 691 |
692 \\[hyper-apropos] Type a substring; it shows a hypertext list of | 692 \\[hyper-apropos] Type a substring; it shows a hypertext list of |
693 functions and variables that contain that substring. | 693 functions and variables that contain that substring. |
694 See also the `apropos' command. | 694 See also the `apropos' command. |
695 \\[command-apropos] Type a substring; it shows a list of commands | 695 \\[command-apropos] Type a substring; it shows a list of commands |
696 (interactively callable functions) that contain that substring. | 696 (interactively callable functions) that contain that substring. |
697 \\[describe-bindings] Table of all key bindings. | 697 \\[describe-bindings] Table of all key bindings. |
698 \\[describe-key-briefly] Type a command key sequence; | 698 \\[describe-key-briefly] Type a command key sequence; |
699 it displays the function name that sequence runs. | 699 it displays the function name that sequence runs. |
700 \\[customize] Customize Emacs options. | |
700 \\[Info-goto-emacs-command-node] Type a function name; it displays the Info node for that command. | 701 \\[Info-goto-emacs-command-node] Type a function name; it displays the Info node for that command. |
701 \\[describe-function] Type a function name; it shows its documentation. | 702 \\[describe-function] Type a function name; it shows its documentation. |
702 \\[Info-elisp-ref] Type a function name; it jumps to the full documentation | 703 \\[Info-elisp-ref] Type a function name; it jumps to the full documentation |
703 in the XEmacs Lisp Programmer's Manual. | 704 in the XEmacs Lisp Programmer's Manual. |
704 \\[xemacs-local-faq] Local copy of the XEmacs FAQ. | 705 \\[xemacs-local-faq] Local copy of the XEmacs FAQ. |
717 \\[help-with-tutorial] XEmacs learn-by-doing tutorial. | 718 \\[help-with-tutorial] XEmacs learn-by-doing tutorial. |
718 \\[describe-variable] Type a variable name; it displays its documentation and value. | 719 \\[describe-variable] Type a variable name; it displays its documentation and value. |
719 \\[where-is] Type a command name; it displays which keystrokes invoke that command. | 720 \\[where-is] Type a command name; it displays which keystrokes invoke that command. |
720 \\[describe-distribution] XEmacs ordering information. | 721 \\[describe-distribution] XEmacs ordering information. |
721 \\[describe-no-warranty] Information on absence of warranty for XEmacs. | 722 \\[describe-no-warranty] Information on absence of warranty for XEmacs. |
722 \\[describe-copying] XEmacs copying permission (General Public License)." | 723 \\[describe-copying] XEmacs copying permission (General Public License)." |
723 (interactive) | 724 help-map) |
724 (let ((help-key (copy-event last-command-event)) | |
725 event char) | |
726 (message (gettext "A B C F I K L M N P S T V W C-c C-d C-n C-w. Type %s again for more help: ") | |
727 ;; arrgh, no room for "C-i C-k C-f" !! | |
728 (single-key-description help-key)) | |
729 (setq event (next-command-event) | |
730 char (event-to-character event)) | |
731 (if (or (equal event help-key) | |
732 (eq char ??) | |
733 (eq 'help-command (key-binding event))) | |
734 (save-window-excursion | |
735 (switch-to-buffer "*Help*") | |
736 ;; #### I18N3 should mark buffer as output-translating | |
737 (delete-other-windows) | |
738 (let ((buffer-read-only nil)) | |
739 (erase-buffer) | |
740 (insert (documentation 'help-for-help))) | |
741 (goto-char (point-min)) | |
742 (while (or (equal event help-key) | |
743 (eq char ??) | |
744 (eq 'help-command (key-binding event)) | |
745 (eq char ?\ ) | |
746 (eq 'scroll-up (key-binding event)) | |
747 (eq char ?\177) | |
748 (and (not (eq char ?b)) | |
749 (eq 'scroll-down (key-binding event)))) | |
750 (if (or (eq char ?\ ) | |
751 (eq 'scroll-up (key-binding event))) | |
752 (scroll-up)) | |
753 (if (or (eq char ?\177) | |
754 (and (not (eq char ?b)) | |
755 (eq 'scroll-down (key-binding event)))) | |
756 (scroll-down)) | |
757 ;; write this way for I18N3 snarfing | |
758 (if (pos-visible-in-window-p (point-max)) | |
759 (message "A B C F I K L M N P S T V W C-c C-d C-n C-w C-i C-k C-f: ") | |
760 (message "A B C F I K L M N P S T V W C-c C-d C-n C-w C-i C-k C-f or Space to scroll: ")) | |
761 (let ((cursor-in-echo-area t)) | |
762 (setq event (next-command-event event) | |
763 char (or (event-to-character event) event)))))) | |
764 (let ((defn (or (lookup-key help-map (vector event)) | |
765 (and (numberp char) | |
766 (lookup-key help-map (make-string 1 (downcase char))))))) | |
767 (message nil) | |
768 (if defn | |
769 (call-interactively defn) | |
770 (ding))))) | |
771 | 725 |
772 (defun function-called-at-point () | 726 (defun function-called-at-point () |
773 "Return the function which is called by the list containing point. | 727 "Return the function which is called by the list containing point. |
774 If that gives no function, return the function whose name is around point. | 728 If that gives no function, return the function whose name is around point. |
775 If that doesn't give a function, return nil." | 729 If that doesn't give a function, return nil." |
1144 (let ((newvar (variable-alias variable))) | 1098 (let ((newvar (variable-alias variable))) |
1145 (if aliases | 1099 (if aliases |
1146 ;; I18N3 Need gettext due to concat | 1100 ;; I18N3 Need gettext due to concat |
1147 (setq aliases | 1101 (setq aliases |
1148 (concat aliases | 1102 (concat aliases |
1149 (format "\n which is an alias for `%s'," | 1103 (format "\n which is an alias for `%s', " |
1150 (symbol-name newvar)))) | 1104 (symbol-name newvar)))) |
1151 (setq aliases | 1105 (setq aliases |
1152 (format "an alias for `%s'," | 1106 (format "an alias for `%s', " |
1153 (symbol-name newvar)))) | 1107 (symbol-name newvar)))) |
1154 (setq variable newvar))) | 1108 (setq variable newvar))) |
1155 (if aliases | 1109 (if aliases |
1156 (princ (format "%s" aliases))) | 1110 (princ (format "%s" aliases))) |
1157 (princ (built-in-variable-doc variable)) | 1111 (princ (built-in-variable-doc variable)) |