]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/miscellany/mhe/mh-shell.ml
ap: Fix write past end of addrs[] array.
[nmh] / docs / historical / mh-6.8.5 / miscellany / mhe / mh-shell.ml
1 ; These functions are used to run shell commands and check for errors.
2 ; this file is loaded from mh-e with an explicit load command.
3 (defun
4 (send-to-shell pname progress
5 (save-excursion
6 (temp-use-buffer "mh-temp") (erase-buffer)
7 (insert-string (arg 1))
8 (beginning-of-file) (setq progress -1)
9 (while (& (! (eobp)) (< progress 50))
10 (beginning-of-line)
11 (setq progress (+ progress 1))
12 (if (! (eolp))
13 (progn
14 (set-mark) (end-of-line)
15 (setq pname (region-to-string))
16 (delete-to-killbuffer)
17 (fast-filter-region pname)
18 )
19 )
20 (next-line)
21 )
22 )
23 )
24
25 (show-shell-errors
26 (save-excursion
27 (temp-use-buffer "mh-temp")
28 (if (!= (buffer-size) 0)
29 (progn
30 (pop-to-buffer "mh-temp")
31 (sit-for 0)
32 (beginning-of-file) (set-mark)
33 (error-occured (re-replace-string "\n\n* *" "; "))
34 (end-of-line)
35 (backward-character) (backward-character)
36 (kill-to-end-of-line)
37 (send-string-to-terminal "\\a")
38 (message (region-to-string))
39 (send-string-to-terminal "\\a")
40 (sit-for 15)
41 )
42 )
43 )
44 )
45 )