Mercurial > emacs
comparison lisp/help-fns.el @ 90650:02cf29720f31
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 490-504)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 161-163)
- Update from CVS
- Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-130
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 07 Nov 2006 23:22:48 +0000 |
parents | 7eeafaaa9eab 6deaec97f21b |
children | 6588c6259dfb |
comparison
equal
deleted
inserted
replaced
90649:d53934e7ddef | 90650:02cf29720f31 |
---|---|
33 | 33 |
34 ;;; Code: | 34 ;;; Code: |
35 | 35 |
36 (require 'help-mode) | 36 (require 'help-mode) |
37 | 37 |
38 | |
39 ;;;###autoload | |
40 (defun help-with-tutorial (&optional arg) | |
41 "Select the Emacs learn-by-doing tutorial. | |
42 If there is a tutorial version written in the language | |
43 of the selected language environment, that version is used. | |
44 If there's no tutorial in that language, `TUTORIAL' is selected. | |
45 With ARG, you are asked to choose which language." | |
46 (interactive "P") | |
47 (let ((lang (if arg | |
48 (let ((minibuffer-setup-hook minibuffer-setup-hook)) | |
49 (add-hook 'minibuffer-setup-hook | |
50 'minibuffer-completion-help) | |
51 (read-language-name 'tutorial "Language: " "English")) | |
52 (if (get-language-info current-language-environment 'tutorial) | |
53 current-language-environment | |
54 "English"))) | |
55 file filename) | |
56 (setq filename (get-language-info lang 'tutorial)) | |
57 (setq file (expand-file-name (concat "~/" filename))) | |
58 (delete-other-windows) | |
59 (if (get-file-buffer file) | |
60 (switch-to-buffer (get-file-buffer file)) | |
61 (switch-to-buffer (create-file-buffer file)) | |
62 (setq buffer-file-name file) | |
63 (setq default-directory (expand-file-name "~/")) | |
64 (setq buffer-auto-save-file-name nil) | |
65 (insert-file-contents (expand-file-name filename data-directory)) | |
66 (hack-local-variables) | |
67 (goto-char (point-min)) | |
68 (search-forward "\n<<") | |
69 (beginning-of-line) | |
70 ;; Convert the <<...>> line to the proper [...] line, | |
71 ;; or just delete the <<...>> line if a [...] line follows. | |
72 (cond ((save-excursion | |
73 (forward-line 1) | |
74 (looking-at "\\[")) | |
75 (delete-region (point) (progn (forward-line 1) (point)))) | |
76 ((looking-at "<<Blank lines inserted.*>>") | |
77 (replace-match "[Middle of page left blank for didactic purposes. Text continues below]")) | |
78 (t | |
79 (looking-at "<<") | |
80 (replace-match "[") | |
81 (search-forward ">>") | |
82 (replace-match "]"))) | |
83 (beginning-of-line) | |
84 (let ((n (- (window-height (selected-window)) | |
85 (count-lines (point-min) (point)) | |
86 6))) | |
87 (if (< n 8) | |
88 (progn | |
89 ;; For a short gap, we don't need the [...] line, | |
90 ;; so delete it. | |
91 (delete-region (point) (progn (end-of-line) (point))) | |
92 (newline n)) | |
93 ;; Some people get confused by the large gap. | |
94 (newline (/ n 2)) | |
95 | |
96 ;; Skip the [...] line (don't delete it). | |
97 (forward-line 1) | |
98 (newline (- n (/ n 2))))) | |
99 (goto-char (point-min)) | |
100 (setq buffer-undo-list nil) | |
101 (set-buffer-modified-p nil)))) | |
102 | |
103 | |
104 ;; Functions | 38 ;; Functions |
105 | 39 |
106 ;;;###autoload | 40 ;;;###autoload |
107 (defun describe-function (function) | 41 (defun describe-function (function) |
108 "Display the full documentation of FUNCTION (a symbol)." | 42 "Display the full documentation of FUNCTION (a symbol)." |