Mercurial > emacs
comparison lisp/calc/calc-help.el @ 57431:eb0c890a4987
(calc-describe-copying, calc-describe-distribution, calc-describe-thing,
calc-describe-no-warranty, calc-describe-key): Go to appropriate info
node in one step.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Mon, 11 Oct 2004 03:29:45 +0000 |
parents | 695cf19ef79e |
children | cadf61c7f4eb |
comparison
equal
deleted
inserted
replaced
57430:f4e473491598 | 57431:eb0c890a4987 |
---|---|
91 (let ((calc-dispatch-help t)) | 91 (let ((calc-dispatch-help t)) |
92 (calc-help-prefix arg)))) | 92 (calc-help-prefix arg)))) |
93 | 93 |
94 (defun calc-describe-copying () | 94 (defun calc-describe-copying () |
95 (interactive) | 95 (interactive) |
96 (calc-info) | 96 (calc-info-goto-node "Copying")) |
97 (Info-goto-node "Copying")) | |
98 | 97 |
99 (defun calc-describe-distribution () | 98 (defun calc-describe-distribution () |
100 (interactive) | 99 (interactive) |
101 (calc-info) | 100 (calc-info-goto-node "Reporting Bugs")) |
102 (Info-goto-node "Reporting Bugs")) | |
103 | 101 |
104 (defun calc-describe-no-warranty () | 102 (defun calc-describe-no-warranty () |
105 (interactive) | 103 (interactive) |
106 (calc-info) | 104 (calc-info-goto-node "Copying") |
107 (Info-goto-node "Copying") | |
108 (let ((case-fold-search nil)) | 105 (let ((case-fold-search nil)) |
109 (search-forward " NO WARRANTY")) | 106 (search-forward " NO WARRANTY")) |
110 (beginning-of-line) | 107 (beginning-of-line) |
111 (recenter 0)) | 108 (recenter 0)) |
112 | 109 |
188 (if (= (buffer-size) 0) | 185 (if (= (buffer-size) 0) |
189 (progn | 186 (progn |
190 (message "Reading Calc summary from manual...") | 187 (message "Reading Calc summary from manual...") |
191 (save-window-excursion | 188 (save-window-excursion |
192 (save-excursion | 189 (save-excursion |
193 (calc-info) | 190 (calc-info-goto-node "Summary") |
194 (Info-goto-node "Summary") | |
195 (goto-char (point-min)) | 191 (goto-char (point-min)) |
196 (forward-line 1) | 192 (forward-line 1) |
197 (copy-to-buffer "*Calc Summary*" | 193 (copy-to-buffer "*Calc Summary*" |
198 (point) (point-max)) | 194 (point) (point-max)) |
199 (Info-last))) | 195 (if Info-history |
196 (Info-last)))) | |
200 (setq case-fold-search nil) | 197 (setq case-fold-search nil) |
201 (re-search-forward "^\\(.*\\)\\[\\.\\. a b") | 198 (re-search-forward "^\\(.*\\)\\[\\.\\. a b") |
202 (setq calc-summary-indentation | 199 (setq calc-summary-indentation |
203 (- (match-end 1) (match-beginning 1))))) | 200 (- (match-end 1) (match-beginning 1))))) |
204 (goto-char (point-min)) | 201 (goto-char (point-min)) |
324 var))) | 321 var))) |
325 | 322 |
326 (defun calc-describe-thing (thing where &optional target not-quoted) | 323 (defun calc-describe-thing (thing where &optional target not-quoted) |
327 (message "Looking for `%s' in %s..." thing where) | 324 (message "Looking for `%s' in %s..." thing where) |
328 (let ((savewin (current-window-configuration))) | 325 (let ((savewin (current-window-configuration))) |
329 (calc-info) | 326 (calc-info-goto-node where) |
330 (Info-goto-node where) | |
331 (or (let ((case-fold-search nil)) | 327 (or (let ((case-fold-search nil)) |
332 (re-search-forward (format "\n\\* +%s: \\(.*\\)\\." | 328 (re-search-forward (format "\n\\* +%s: \\(.*\\)\\." |
333 (regexp-quote thing)) | 329 (regexp-quote thing)) |
334 nil t)) | 330 nil t)) |
335 (and (string-match "\\`\\([a-z ]*\\)[0-9]\\'" thing) | 331 (and (string-match "\\`\\([a-z ]*\\)[0-9]\\'" thing) |
336 (re-search-forward (format "\n\\* +%s[01]-9: \\(.*\\)\\." | 332 (re-search-forward (format "\n\\* +%s[01]-9: \\(.*\\)\\." |
337 (substring thing 0 -1)) | 333 (substring thing 0 -1)) |
338 nil t) | 334 nil t) |
339 (setq thing (format "%s9" (substring thing 0 -1)))) | 335 (setq thing (format "%s9" (substring thing 0 -1)))) |
340 (progn | 336 (progn |
341 (Info-last) | 337 (if Info-history |
338 (Info-last)) | |
342 (set-window-configuration savewin) | 339 (set-window-configuration savewin) |
343 (error "Can't find `%s' in %s" thing where))) | 340 (error "Can't find `%s' in %s" thing where))) |
344 (let (Info-history) | 341 (let (Info-history) |
345 (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) | 342 (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) |
346 (or (let ((case-fold-search nil)) | 343 (or (let ((case-fold-search nil)) |