Added -clobber switch to mhstore(1) [Bug #11160].
[mmh] / docs / historical / mh-6.8.5 / miscellany / mhe / mh-inc.ml
1 ;  This autoloaded file implements the "i" command of mhe
2 (defun 
3     (&mh-inc old-folder
4         (&mh-save-killbuffer)
5         (setq old-folder mh-folder)
6         (if (!= mh-folder "inbox")
7             (save-window-excursion  ffl
8                 (setq ffl (get-folder-name "inc into" "inbox" 1))
9                 (&mh-read-folder ffl "" t-buffer-filename ffl)
10             )
11         )
12         (message "Checking for new mail...") (sit-for 0)
13         (send-to-shell (concat mh-progs "/inc +" mh-folder))
14         (temp-use-buffer "mh-temp")
15         (beginning-of-file)
16         (if (looking-at "^Incorporating")
17             (progn 
18                    (pop-to-buffer (concat "+" old-folder))
19                    (switch-to-buffer (concat "+" mh-folder))
20                    (end-of-file)
21                    (&mh-update-headers)
22                    (&mh-unmark-all-headers 0)
23                    (beginning-of-line)
24                    (goto-character (+ (dot) 3))
25                    (delete-next-character)
26                    (insert-character '+')
27                    (beginning-of-line)
28                    (setq mh-direction 1)
29                    (temp-use-buffer "mh-temp") (erase-buffer)
30                    (insert-string global-mode-string)
31                    (beginning-of-file)
32                    (error-occured (search-forward " Mail")
33                        (region-around-match 0)
34                        (erase-region)
35                        (set-mark) (beginning-of-file)
36                        (setq global-mode-string (region-to-string))
37                    )
38                    (temp-use-buffer (concat "+" mh-folder))
39             )
40             (progn 
41                    (message "No new mail.") (sit-for 10)
42                    (send-string-to-terminal "\a")
43                    (pop-to-buffer (concat "+" mh-folder))
44             )
45         )
46         (&mh-restore-killbuffer)
47     )
48 )