home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / mh-e.pat / mh-e
Lisp/Scheme  |  1993-01-22  |  40KB  |  1,264 lines

  1. *** /tmp/,RCSt1a23165    Wed Jan 20 11:15:09 1993
  2. --- mh-e.el    Wed Jan 20 11:13:30 1993
  3. ***************
  4. *** 5,10
  5.   (setq mh-e-time-stamp "92/01/21 10:59:18 gildea")
  6.   (provide 'mh-e)
  7.   
  8.   ;;; Copyright (c) 1985,1986,1987,1988,1990,1992 Free Software Foundation
  9.   ;;;     Maintainer:  Stephen Gildea <gildea@lcs.mit.edu>
  10.   ;;;    Please send suggestions and corrections to the above address.
  11.  
  12. --- 5,12 -----
  13.   (setq mh-e-time-stamp "92/01/21 10:59:18 gildea")
  14.   (provide 'mh-e)
  15.   
  16. + (require 'mh-db)
  17.   ;;; Copyright (c) 1985,1986,1987,1988,1990,1992 Free Software Foundation
  18.   ;;;     Maintainer:  Stephen Gildea <gildea@lcs.mit.edu>
  19.   ;;;    Please send suggestions and corrections to the above address.
  20. ***************
  21. *** 57,63
  22.   ;;;(defvar mh-lib "/usr/new/lib/mh/" "Directory of MH library.")
  23.   
  24.   (defvar mh-redist-full-contents nil
  25. !   "Non-nil if the `dist' command needs whole letter for redistribution.
  26.   This is the case when `send' is compiled with the BERK option.")
  27.   
  28.   
  29.  
  30. --- 59,65 -----
  31.   ;;;(defvar mh-lib "/usr/new/lib/mh/" "Directory of MH library.")
  32.   
  33.   (defvar mh-redist-full-contents nil
  34. !   "*Non-nil if the `dist' command needs whole letter for redistribution.
  35.   This is the case when `send' is compiled with the BERK option.")
  36.   
  37.   
  38. ***************
  39. *** 85,90
  40.   (defvar mh-quit-hook nil
  41.     "Invoked after quitting mh-e by \\[mh-quit].  See also  mh-before-quit-hook")
  42.   
  43.   
  44.   (defvar mh-ins-string nil
  45.     "Temporarily set by `mh-insert-prefix' prior to running `mh-yank-hooks'.")
  46.  
  47. --- 87,101 -----
  48.   (defvar mh-quit-hook nil
  49.     "Invoked after quitting mh-e by \\[mh-quit].  See also  mh-before-quit-hook")
  50.   
  51. + (defvar mh-signature-func nil
  52. +   "Function to call to obtain a signature when `mh-insert-signature' is called.
  53. + If `mh-signature-func' is nil, the old-style behavior of inserting the
  54. + contents of ~/.signature occurs.  If `mh-signature-func' is non-nil, it is the
  55. + function to invoke to obtain a signature.  If the function returns a string,
  56. + the string is assumed to be the name of the file to insert.  If the function
  57. + returns a list, the list must contain only a single string, which is inserted
  58. + verbatim into the buffer.  If the function returns anything else (like `nil'),
  59. + the contents of ~/.signature are inserted.
  60.   
  61.   When the function is called, the current buffer is the draft buffer, which can
  62.   be scanned by the function to determine an appropriate signature.
  63. ***************
  64. *** 86,91
  65.     "Invoked after quitting mh-e by \\[mh-quit].  See also  mh-before-quit-hook")
  66.   
  67.   
  68.   (defvar mh-ins-string nil
  69.     "Temporarily set by `mh-insert-prefix' prior to running `mh-yank-hooks'.")
  70.   
  71.  
  72. --- 97,108 -----
  73.   verbatim into the buffer.  If the function returns anything else (like `nil'),
  74.   the contents of ~/.signature are inserted.
  75.   
  76. + When the function is called, the current buffer is the draft buffer, which can
  77. + be scanned by the function to determine an appropriate signature.
  78. + `mh-signature-func' is similar to a hook, except that hooks do not return
  79. + values.")
  80.   (defvar mh-ins-string nil
  81.     "Temporarily set by `mh-insert-prefix' prior to running `mh-yank-hooks'.")
  82.   
  83. ***************
  84. *** 118,124
  85.   A value of T means use the default format file.
  86.   Nil means don't use mhl to format messages.")
  87.   
  88. ! (defvar mh-lpr-command-format "lpr -p -J '%s'"
  89.     "*Format for Unix command that prints a message.
  90.   The string should be a Unix command line, with the string '%s' where
  91.   the job's name (folder and message number) should appear.  The message text
  92.  
  93. --- 135,144 -----
  94.   A value of T means use the default format file.
  95.   Nil means don't use mhl to format messages.")
  96.   
  97. ! (defvar mh-lpr-command-format (cond ((eq system-type 'hpux)
  98. !                      "fold -80 | pr -h '%s' | lp")
  99. !                     (t "lpr -p -J '%s'")
  100. !                     )
  101.     "*Format for Unix command that prints a message.
  102.   The string should be a Unix command line, with the string '%s' where
  103.   the job's name (folder and message number) should appear.  The message text
  104. ***************
  105. *** 247,253
  106.     "User's mail folder.")
  107.   
  108.   (defvar mh-last-destination nil
  109. !   "Destination of last refile or write command.")
  110.   
  111.   (defvar mh-folder-mode-map (make-keymap)
  112.     "Keymap for MH folders.")
  113.  
  114. --- 267,274 -----
  115.     "User's mail folder.")
  116.   
  117.   (defvar mh-last-destination nil
  118. !   "Destination of last refile or write command.
  119. ! `(car mh-last-destination)' is one of 'refile, 'write, or 'other.")
  120.   
  121.   (defvar mh-folder-mode-map (make-keymap)
  122.     "Keymap for MH folders.")
  123. ***************
  124. *** 471,478
  125.          (message "Does not appear to be a rejected letter.")))
  126.       (goto-char (point-min))
  127.       (set-buffer-modified-p nil)
  128. !     (mh-compose-and-send-mail draft "" from-folder msg (mh-get-field "To")
  129. !                   (mh-get-field "From") (mh-get-field "cc")
  130.                     nil nil config)))
  131.   
  132.   
  133.  
  134. --- 492,499 -----
  135.          (message "Does not appear to be a rejected letter.")))
  136.       (goto-char (point-min))
  137.       (set-buffer-modified-p nil)
  138. !     (mh-compose-and-send-mail draft "" from-folder msg (mh-get-field "To:")
  139. !                   (mh-get-field "From:") (mh-get-field "cc:")
  140.                     nil nil config)))
  141.   
  142.   
  143. ***************
  144. *** 489,496
  145.                (if current-prefix-arg
  146.                (mh-read-seq-default "Forward" t)
  147.                (mh-get-msg-num t))
  148. !              (read-string "To: ")
  149. !              (read-string "Cc: ")))
  150.     (let* ((folder mh-current-folder)
  151.        (config (current-window-configuration))
  152.        ;; forw always leaves file in "draft" since it doesn't have -draft
  153.  
  154. --- 510,517 -----
  155.                (if current-prefix-arg
  156.                (mh-read-seq-default "Forward" t)
  157.                (mh-get-msg-num t))
  158. !              (mh-read-to-address)
  159. !              (mh-read-cc-address)))
  160.     (let* ((folder mh-current-folder)
  161.        (config (current-window-configuration))
  162.        ;; forw always leaves file in "draft" since it doesn't have -draft
  163. ***************
  164. *** 569,574
  165.       (if (not maildrop-name)
  166.       (cond ((not (get-buffer "+inbox"))
  167.              (mh-make-folder "+inbox")
  168.              (setq mh-previous-window-config config))
  169.             ((not (eq (current-buffer) (get-buffer "+inbox")))
  170.              (switch-to-buffer "+inbox")
  171.  
  172. --- 590,596 -----
  173.       (if (not maildrop-name)
  174.       (cond ((not (get-buffer "+inbox"))
  175.              (mh-make-folder "+inbox")
  176. +            (delete-other-windows)
  177.              (setq mh-previous-window-config config))
  178.             ((not (eq (current-buffer) (get-buffer "+inbox")))
  179.              (switch-to-buffer "+inbox")
  180. ***************
  181. *** 572,577
  182.              (setq mh-previous-window-config config))
  183.             ((not (eq (current-buffer) (get-buffer "+inbox")))
  184.              (switch-to-buffer "+inbox")
  185.              (setq mh-previous-window-config config)))))
  186.     (mh-get-new-mail maildrop-name)
  187.     (run-hooks 'mh-inc-folder-hook))
  188.  
  189. --- 594,600 -----
  190.              (setq mh-previous-window-config config))
  191.             ((not (eq (current-buffer) (get-buffer "+inbox")))
  192.              (switch-to-buffer "+inbox")
  193. +            (delete-other-windows)
  194.              (setq mh-previous-window-config config)))))
  195.     (mh-get-new-mail maildrop-name)
  196.     (run-hooks 'mh-inc-folder-hook))
  197. ***************
  198. *** 653,659
  199.        (mh-maybe-show))
  200.       (t
  201.        (forward-line -1)
  202. !      (if (get-buffer mh-show-buffer)
  203.            (delete-windows-on mh-show-buffer)))))
  204.   
  205.   
  206.  
  207. --- 676,682 -----
  208.        (mh-maybe-show))
  209.       (t
  210.        (forward-line -1)
  211. !      (if (mh-get-buffer mh-show-buffer)
  212.            (delete-windows-on mh-show-buffer)))))
  213.   
  214.   
  215. ***************
  216. *** 684,690
  217.       (shell-command-on-region (point) (point-max) command nil)))
  218.   
  219.   
  220. ! (defun mh-refile-msg (prefix-provided msg-or-seq dest)
  221.     "Refile MESSAGE(s) (default: displayed message) in FOLDER.
  222.   If optional prefix argument provided, then prompt for message sequence."
  223.     (interactive
  224.  
  225. --- 707,713 -----
  226.       (shell-command-on-region (point) (point-max) command nil)))
  227.   
  228.   
  229. ! (defun mh-refile-msg (prefix-provided msg-or-seq folder)
  230.     "Refile MESSAGE(s) (default: displayed message) in FOLDER.
  231.   If optional prefix argument provided, then prompt for message sequence.
  232.   If mh-auto-folder-alist is non-nil, it will be used to determine the name
  233. ***************
  234. *** 686,692
  235.   
  236.   (defun mh-refile-msg (prefix-provided msg-or-seq dest)
  237.     "Refile MESSAGE(s) (default: displayed message) in FOLDER.
  238. ! If optional prefix argument provided, then prompt for message sequence."
  239.     (interactive
  240.      (list current-prefix-arg
  241.        (if current-prefix-arg
  242.  
  243. --- 709,718 -----
  244.   
  245.   (defun mh-refile-msg (prefix-provided msg-or-seq folder)
  246.     "Refile MESSAGE(s) (default: displayed message) in FOLDER.
  247. ! If optional prefix argument provided, then prompt for message sequence.
  248. ! If mh-auto-folder-alist is non-nil, it will be used to determine the name
  249. ! of the default folder.
  250. ! "
  251.     (interactive
  252.      ;; Here, we want to preserve the value of mh-showing, while preserving
  253.      ;; the current value.
  254. ***************
  255. *** 688,696
  256.     "Refile MESSAGE(s) (default: displayed message) in FOLDER.
  257.   If optional prefix argument provided, then prompt for message sequence."
  258.     (interactive
  259. !    (list current-prefix-arg
  260. !      (if current-prefix-arg
  261. !          (mh-read-seq-default "Refile" t)
  262.            (mh-get-msg-num t))
  263.        (intern
  264.         (mh-prompt-for-folder "Destination"
  265.  
  266. --- 714,725 -----
  267.   of the default folder.
  268.   "
  269.     (interactive
  270. !    ;; Here, we want to preserve the value of mh-showing, while preserving
  271. !    ;; the current value.
  272. !    (let ( (mh-showing (and (boundp 'mh-showing) mh-showing)) )
  273. !      (list current-prefix-arg
  274. !        (if current-prefix-arg
  275. !            (mh-read-seq-default "Refile" t)
  276.            (mh-get-msg-num t))
  277.          (intern
  278.           (mh-prompt-for-folder "Destination"
  279. ***************
  280. *** 692,704
  281.        (if current-prefix-arg
  282.            (mh-read-seq-default "Refile" t)
  283.            (mh-get-msg-num t))
  284. !      (intern
  285. !       (mh-prompt-for-folder "Destination"
  286. !                 (if (eq 'refile (car mh-last-destination))
  287. !                     (symbol-name (cdr mh-last-destination))
  288. !                     "")
  289. !                 t))))
  290. !   (setq mh-last-destination (cons 'refile dest))
  291.     (if prefix-provided
  292.         (mh-map-to-seq-msgs 'mh-refile-a-msg msg-or-seq dest)
  293.         (mh-refile-a-msg msg-or-seq dest))
  294.  
  295. --- 721,731 -----
  296.          (if current-prefix-arg
  297.              (mh-read-seq-default "Refile" t)
  298.            (mh-get-msg-num t))
  299. !        (intern
  300. !         (mh-prompt-for-folder "Destination"
  301. !                   (mh-get-default-refile-folder)
  302. !                   t)))))
  303. !   (setq mh-last-destination (cons 'refile folder))
  304.     (if prefix-provided
  305.         (mh-map-to-seq-msgs 'mh-refile-a-msg msg-or-seq folder)
  306.         (mh-refile-a-msg msg-or-seq folder))
  307. ***************
  308. *** 700,707
  309.                   t))))
  310.     (setq mh-last-destination (cons 'refile dest))
  311.     (if prefix-provided
  312. !       (mh-map-to-seq-msgs 'mh-refile-a-msg msg-or-seq dest)
  313. !       (mh-refile-a-msg msg-or-seq dest))
  314.     (mh-next-msg))
  315.   
  316.   
  317.  
  318. --- 727,734 -----
  319.                     t)))))
  320.     (setq mh-last-destination (cons 'refile folder))
  321.     (if prefix-provided
  322. !       (mh-map-to-seq-msgs 'mh-refile-a-msg msg-or-seq folder)
  323. !       (mh-refile-a-msg msg-or-seq folder))
  324.     (mh-next-msg))
  325.   
  326.   
  327. ***************
  328. *** 787,792
  329.   configuration, if one exists.  Finish by running mh-quit-hook."
  330.     (interactive)
  331.     (run-hooks 'mh-before-quit-hook)
  332.     (if mh-previous-window-config
  333.         (set-window-configuration mh-previous-window-config))
  334.     (run-hooks 'mh-quit-hook))
  335.  
  336. --- 814,823 -----
  337.   configuration, if one exists.  Finish by running mh-quit-hook."
  338.     (interactive)
  339.     (run-hooks 'mh-before-quit-hook)
  340. +   (if mh-current-folder
  341. +       (bury-buffer mh-current-folder))
  342. +   (if (and mh-show-buffer (get-buffer mh-show-buffer))
  343. +       (bury-buffer mh-show-buffer))
  344.     (if mh-previous-window-config
  345.         (set-window-configuration mh-previous-window-config))
  346.     (mh-save-variables)
  347. ***************
  348. *** 789,794
  349.     (run-hooks 'mh-before-quit-hook)
  350.     (if mh-previous-window-config
  351.         (set-window-configuration mh-previous-window-config))
  352.     (run-hooks 'mh-quit-hook))
  353.   
  354.   
  355.  
  356. --- 820,826 -----
  357.         (bury-buffer mh-show-buffer))
  358.     (if mh-previous-window-config
  359.         (set-window-configuration mh-previous-window-config))
  360. +   (mh-save-variables)
  361.     (run-hooks 'mh-quit-hook))
  362.   
  363.   
  364. ***************
  365. *** 858,864
  366.     (cond ((re-search-backward mh-good-msg-regexp nil 0 arg)
  367.        (mh-maybe-show))
  368.       (t
  369. !      (if (get-buffer mh-show-buffer)
  370.            (delete-windows-on mh-show-buffer)))))
  371.   
  372.   
  373.  
  374. --- 890,896 -----
  375.     (cond ((re-search-backward mh-good-msg-regexp nil 0 arg)
  376.        (mh-maybe-show))
  377.       (t
  378. !      (if (mh-get-buffer mh-show-buffer)
  379.            (delete-windows-on mh-show-buffer)))))
  380.   
  381.   
  382. ***************
  383. *** 929,935
  384.   messages to display.  Otherwise show the entire folder."
  385.     (interactive (list (if current-prefix-arg
  386.                (mh-read-msg-range "Range to scan [all]? ")
  387. !              nil)))
  388.     (setq mh-next-direction 'forward)
  389.     (mh-scan-folder mh-current-folder (or range "all")))
  390.   
  391.  
  392. --- 961,967 -----
  393.   messages to display.  Otherwise show the entire folder."
  394.     (interactive (list (if current-prefix-arg
  395.                (mh-read-msg-range "Range to scan [all]? ")
  396. !              "")))
  397.     (setq mh-next-direction 'forward)
  398.     (mh-scan-folder mh-current-folder (if (string= range "")
  399.                       "all"
  400. ***************
  401. *** 931,937
  402.                (mh-read-msg-range "Range to scan [all]? ")
  403.                nil)))
  404.     (setq mh-next-direction 'forward)
  405. !   (mh-scan-folder mh-current-folder (or range "all")))
  406.   
  407.   
  408.   (defun mh-redistribute (to cc msg)
  409.  
  410. --- 963,971 -----
  411.                (mh-read-msg-range "Range to scan [all]? ")
  412.                "")))
  413.     (setq mh-next-direction 'forward)
  414. !   (mh-scan-folder mh-current-folder (if (string= range "")
  415. !                     "all"
  416. !                       range)))
  417.   
  418.   
  419.   (defun mh-redistribute (to cc msg)
  420. ***************
  421. *** 938,945
  422.     "Redistribute a letter.
  423.   Depending on how your copy of MH was compiled, you may need to change the
  424.   setting of the variable mh-redist-full-contents.  See its documentation."
  425. !   (interactive (list (read-string "Redist-To: ")
  426. !              (read-string "Redist-Cc: ")
  427.                (mh-get-msg-num t)))
  428.     (save-window-excursion
  429.       (let ((folder mh-current-folder)
  430.  
  431. --- 972,979 -----
  432.     "Redistribute a letter.
  433.   Depending on how your copy of MH was compiled, you may need to change the
  434.   setting of the variable mh-redist-full-contents.  See its documentation."
  435. !   (interactive (list (mh-read-to-address "Redist-To: ")
  436. !              (mh-read-cc-address "Redist-Cc: ")
  437.                (mh-get-msg-num t)))
  438.     (save-window-excursion
  439.       (let ((folder mh-current-folder)
  440. ***************
  441. *** 1011,1017
  442.   The letter is composed in mh-letter-mode; see its documentation for more
  443.   details.  If `mh-compose-letter-function' is defined, it is called on the
  444.   draft and passed three arguments: to, subject, and cc."
  445. !   (interactive "sTo: \nsCc: \nsSubject: ")
  446.     (let ((config (current-window-configuration)))
  447.       (delete-other-windows)
  448.       (mh-send-sub to cc subject config)))
  449.  
  450. --- 1045,1051 -----
  451.   The letter is composed in mh-letter-mode; see its documentation for more
  452.   details.  If `mh-compose-letter-function' is defined, it is called on the
  453.   draft and passed three arguments: to, subject, and cc."
  454. !   (interactive (mh-read-to-cc-subject))
  455.     (let ((config (current-window-configuration)))
  456.       (delete-other-windows)
  457.       (mh-send-sub to cc subject config)))
  458. ***************
  459. *** 1019,1025
  460.   
  461.   (defun mh-send-other-window (to cc subject)
  462.     "Compose and send a letter in another window.."
  463. !   (interactive "sTo: \nsCc: \nsSubject: ")
  464.     (let ((pop-up-windows t))
  465.       (mh-send-sub to cc subject (current-window-configuration))))
  466.   
  467.  
  468. --- 1053,1059 -----
  469.   
  470.   (defun mh-send-other-window (to cc subject)
  471.     "Compose and send a letter in another window.."
  472. !   (interactive (mh-read-to-cc-subject))
  473.     (let ((pop-up-windows t))
  474.       (mh-send-sub to cc subject (current-window-configuration))))
  475.   
  476. ***************
  477. *** 1059,1065
  478.         (setq msg (mh-get-msg-num t)))
  479.     (setq mh-showing t)
  480.     (mh-set-mode-name "mh-e show")
  481. !   (if (not (eql (next-window (minibuffer-window)) (selected-window)))
  482.         (delete-other-windows))        ; force ourself to the top window
  483.     (let ((folder mh-current-folder))
  484.       (mh-show-message-in-other-window)
  485.  
  486. --- 1093,1099 -----
  487.         (setq msg (mh-get-msg-num t)))
  488.     (setq mh-showing t)
  489.     (mh-set-mode-name "mh-e show")
  490. !   (if (not (eql (minibuffer-window) (selected-window)))
  491.         (delete-other-windows))        ; force ourself to the top window
  492.     (let ((folder mh-current-folder))
  493.       (mh-show-message-in-other-window)
  494. ***************
  495. *** 1193,1199
  496.     (interactive (list (mh-prompt-for-folder "Visit" "+inbox" t)
  497.                (mh-read-msg-range "Range [all]? ")))
  498.     (let ((config (current-window-configuration)))
  499. !     (mh-scan-folder folder (or range "all"))
  500.       (setq mh-previous-window-config config))
  501.     nil)
  502.   
  503.  
  504. --- 1227,1235 -----
  505.     (interactive (list (mh-prompt-for-folder "Visit" "+inbox" t)
  506.                (mh-read-msg-range "Range [all]? ")))
  507.     (let ((config (current-window-configuration)))
  508. !    (mh-scan-folder folder (if (string= range "")
  509. !                   "all"
  510. !                 range))
  511.       (setq mh-previous-window-config config))
  512.     nil)
  513.   
  514. ***************
  515. *** 1300,1306
  516.   
  517.   (defun mh-invalidate-show-buffer ()
  518.     ;; Invalidate the show buffer so we must update it to use it.
  519. !   (if (get-buffer mh-show-buffer)
  520.         (save-excursion
  521.       (set-buffer mh-show-buffer)
  522.       (setq buffer-file-name nil))))
  523.  
  524. --- 1336,1342 -----
  525.   
  526.   (defun mh-invalidate-show-buffer ()
  527.     ;; Invalidate the show buffer so we must update it to use it.
  528. !   (if (mh-get-buffer mh-show-buffer)
  529.         (save-excursion
  530.       (set-buffer mh-show-buffer)
  531.       (setq buffer-file-name nil))))
  532. ***************
  533. *** 1307,1313
  534.   
  535.   
  536.   (defun mh-show-message-in-other-window ()
  537. !   (switch-to-buffer-other-window mh-show-buffer)
  538.     (if mh-bury-show-buffer (bury-buffer (current-buffer))))
  539.   
  540.   
  541.  
  542. --- 1343,1349 -----
  543.   
  544.   
  545.   (defun mh-show-message-in-other-window ()
  546. !   (switch-to-buffer-other-window (mh-get-buffer mh-show-buffer))
  547.     (if mh-bury-show-buffer (bury-buffer (current-buffer))))
  548.   
  549.   
  550. ***************
  551. *** 1404,1410
  552.     ;; Move backward or forward to the next undeleted message in the buffer.
  553.     (if (eq mh-next-direction 'forward)
  554.         (mh-next-undeleted-msg 1)
  555. !       (mh-previous-undeleted-msg 1)))
  556.   
  557.   
  558.   (defun mh-set-scan-mode ()
  559.  
  560. --- 1440,1446 -----
  561.     ;; Move backward or forward to the next undeleted message in the buffer.
  562.     (if (eq mh-next-direction 'forward)
  563.         (mh-next-undeleted-msg 1)
  564. !     (mh-previous-undeleted-msg 1)))
  565.   
  566.   
  567.   (defun mh-set-scan-mode ()
  568. ***************
  569. *** 1409,1415
  570.   
  571.   (defun mh-set-scan-mode ()
  572.     ;; Display the scan listing buffer, but do not show a message.
  573. !   (if (get-buffer mh-show-buffer)
  574.         (delete-windows-on mh-show-buffer))
  575.     (mh-set-mode-name "mh-e scan")
  576.     (setq mh-showing nil)
  577.  
  578. --- 1445,1451 -----
  579.   
  580.   (defun mh-set-scan-mode ()
  581.     ;; Display the scan listing buffer, but do not show a message.
  582. !   (if (mh-get-buffer mh-show-buffer)
  583.         (delete-windows-on mh-show-buffer))
  584.     (mh-set-mode-name "mh-e scan")
  585.     (setq mh-showing nil)
  586. ***************
  587. *** 1429,1434
  588.     (save-excursion (set-buffer (other-buffer)))
  589.     (set-buffer-modified-p (buffer-modified-p)))
  590.   
  591.   
  592.   
  593.   ;;; The folder data abstraction.
  594.  
  595. --- 1465,1479 -----
  596.     (save-excursion (set-buffer (other-buffer)))
  597.     (set-buffer-modified-p (buffer-modified-p)))
  598.   
  599. + (defun mh-get-buffer (buf)
  600. +   "Create buffer BUF and mark it as not keeping undo information."
  601. +   (let ( (buffer (get-buffer-create buf)) )
  602. +     (buffer-flush-undo buffer)
  603. +     buffer
  604. +     ))
  605.   
  606.   
  607.   ;;; The folder data abstraction.
  608. ***************
  609. *** 1539,1544
  610.     (setq write-file-hooks '(mh-execute-commands))
  611.     (make-local-variable 'revert-buffer-function)
  612.     (setq revert-buffer-function 'mh-undo-folder)
  613.     (run-hooks 'mh-folder-mode-hook))
  614.   
  615.   
  616.  
  617. --- 1584,1590 -----
  618.     (setq write-file-hooks '(mh-execute-commands))
  619.     (make-local-variable 'revert-buffer-function)
  620.     (setq revert-buffer-function 'mh-undo-folder)
  621. +   (mh-load-variables-if-necessary)
  622.     (run-hooks 'mh-folder-mode-hook))
  623.   
  624.   
  625. ***************
  626. *** 1569,1575
  627.   
  628.   (defun mh-regenerate-headers (range)
  629.     ;; Replace buffer with scan of its contents over range RANGE.
  630. !   (let ((folder mh-current-folder))
  631.       (message "Scanning %s..." folder)
  632.       (with-mh-folder-updating (nil)
  633.         (erase-buffer)
  634.  
  635. --- 1615,1626 -----
  636.   
  637.   (defun mh-regenerate-headers (range)
  638.     ;; Replace buffer with scan of its contents over range RANGE.
  639. !   (let ((folder mh-current-folder)
  640. !     real-folder
  641. !     index-cache-dir
  642. !     index-cache
  643. !     (downcase-range (downcase range))
  644. !     )
  645.       (message "Scanning %s..." folder)
  646.       (setq real-folder (substring folder 1))
  647.       (setq index-cache-dir (concat mh-user-path real-folder))
  648. ***************
  649. *** 1571,1576
  650.     ;; Replace buffer with scan of its contents over range RANGE.
  651.     (let ((folder mh-current-folder))
  652.       (message "Scanning %s..." folder)
  653.       (with-mh-folder-updating (nil)
  654.         (erase-buffer)
  655.         (mh-exec-cmd-output "scan" nil
  656.  
  657. --- 1622,1630 -----
  658.       (downcase-range (downcase range))
  659.       )
  660.       (message "Scanning %s..." folder)
  661. +     (setq real-folder (substring folder 1))
  662. +     (setq index-cache-dir (concat mh-user-path real-folder))
  663. +     (setq index-cache (concat mh-user-path real-folder "/.mh-e-index"))
  664.       (with-mh-folder-updating (nil)
  665.         (erase-buffer)
  666.         (setq truncate-lines t)
  667. ***************
  668. *** 1573,1582
  669.       (message "Scanning %s..." folder)
  670.       (with-mh-folder-updating (nil)
  671.         (erase-buffer)
  672. !       (mh-exec-cmd-output "scan" nil
  673. !               "-noclear" "-noheader"
  674. !               "-width" (window-width)
  675. !               folder range)
  676.         (goto-char (point-min))
  677.         (cond ((looking-at "scan: no messages in")
  678.            (keep-lines mh-valid-scan-line)) ; Flush random scan lines
  679.  
  680. --- 1627,1654 -----
  681.       (setq index-cache (concat mh-user-path real-folder "/.mh-e-index"))
  682.       (with-mh-folder-updating (nil)
  683.         (erase-buffer)
  684. !       (setq truncate-lines t)
  685. !       (if (or (not (string= downcase-range "all"))
  686. !           (not (file-exists-p index-cache))
  687. !           (file-newer-than-file-p index-cache-dir index-cache)
  688. !           )
  689. !       (progn
  690. !         (mh-exec-cmd-output "scan" nil
  691. !                 "-noclear" "-noheader"
  692. !                 "-width" (window-width)
  693. !                 folder range)
  694. !         (if (and (file-writable-p index-cache)
  695. !              (string= downcase-range "all")
  696. !              )
  697. !         (progn
  698. !           (write-region (point-min) (point-max) index-cache)
  699. !           )
  700. !           )
  701. !         )
  702. !     (progn
  703. !       (insert-file index-cache)
  704. !       )
  705. !     )
  706.         (goto-char (point-min))
  707.         (cond ((looking-at "scan: no messages in")
  708.            (keep-lines mh-valid-scan-line)) ; Flush random scan lines
  709. ***************
  710. *** 1837,1842
  711.     (setq major-mode 'mh-letter-mode)
  712.     (mh-set-mode-name "mh-e letter")
  713.     (set-syntax-table mh-letter-mode-syntax-table)
  714.     (run-hooks 'text-mode-hook 'mh-letter-mode-hook)
  715.     (mh-when auto-fill-hook
  716.       (make-local-variable 'auto-fill-hook)
  717.  
  718. --- 1909,1915 -----
  719.     (setq major-mode 'mh-letter-mode)
  720.     (mh-set-mode-name "mh-e letter")
  721.     (set-syntax-table mh-letter-mode-syntax-table)
  722. +   (mh-load-variables-if-necessary)
  723.     (run-hooks 'text-mode-hook 'mh-letter-mode-hook)
  724.     (mh-when auto-fill-hook
  725.       (make-local-variable 'auto-fill-hook)
  726. ***************
  727. *** 1862,1867
  728.         (< cur-point (point)))))
  729.   
  730.   
  731.   (defun mh-to-field ()
  732.     "Move point to the end of a specified header field.
  733.   The field is indicated by the previous keystroke.  Create the field if
  734.  
  735. --- 1935,1951 -----
  736.         (< cur-point (point)))))
  737.   
  738.   
  739. + (defun mh-insert-header-line (line)
  740. +   "Move to the header, and insert the text given by LINE.
  741. + This function assumes that a similar header line does not already exist."
  742. +   (let ()
  743. +     (goto-char (dot-min))
  744. +     (re-search-forward "\\(^--------\\)\\|\\(^$\\)")
  745. +     (beginning-of-line 1)
  746. +     (insert line)
  747. +     ))
  748.   (defun mh-to-field ()
  749.     "Move point to the end of a specified header field.
  750.   The field is indicated by the previous keystroke.  Create the field if
  751. ***************
  752. *** 1904,1911
  753.   (defun mh-insert-signature ()
  754.     "Insert the file ~/.signature at the current point."
  755.     (interactive)
  756. !   (insert-file-contents "~/.signature")
  757. !   (set-buffer-modified-p (buffer-modified-p))) ; force mode line update
  758.   
  759.   
  760.   (defun mh-check-whom ()
  761.  
  762. --- 1988,2019 -----
  763.   (defun mh-insert-signature ()
  764.     "Insert the file ~/.signature at the current point."
  765.     (interactive)
  766. !   (let ( (file "~/.signature") result)
  767. !     (save-window-excursion
  768. !       (if mh-signature-func
  769. !       (progn
  770. !         (save-window-excursion
  771. !           (save-excursion
  772. !         ;;
  773. !         ;; The environment is preserved during the function call
  774. !         ;;
  775. !         (setq result (funcall mh-signature-func))
  776. !         ))
  777. !         (cond
  778. !          ( (stringp result)
  779. !            (setq file result)
  780. !            )
  781. !          ( (and (listp result) (stringp (car result)))
  782. !            (insert (car result))
  783. !            (setq file nil)
  784. !            )
  785. !          )
  786. !         ))
  787. !       (if file
  788. !       (insert-file-contents file))
  789. !       )
  790. !     (set-buffer-modified-p (buffer-modified-p)) ; force mode line update
  791. !     ))
  792.   
  793.   
  794.   (defun mh-check-whom ()
  795. ***************
  796. *** 2053,2058
  797.   Run mh-before-send-letter-hook before doing anything."
  798.     (interactive "P")
  799.     (run-hooks 'mh-before-send-letter-hook)
  800.     (set-buffer-modified-p t)        ; Make sure buffer is written
  801.     (save-buffer)
  802.     (message "Sending...")
  803.  
  804. --- 2161,2168 -----
  805.   Run mh-before-send-letter-hook before doing anything."
  806.     (interactive "P")
  807.     (run-hooks 'mh-before-send-letter-hook)
  808. +   (if (and (boundp 'mh-add-md4-signature) mh-add-md4-signature)
  809. +       (mh-add-md4-header))
  810.     (set-buffer-modified-p t)        ; Make sure buffer is written
  811.     (save-buffer)
  812.     (message "Sending...")
  813. ***************
  814. *** 2136,2142
  815.       (set-buffer mh-sent-from-folder)
  816.       (if mh-delete-yanked-msg-window
  817.           (delete-windows-on mh-show-buffer))
  818. !     (set-buffer mh-show-buffer)    ; Find displayed message
  819.       (let ((mh-ins-str (cond ((mark)
  820.                    (buffer-substring (region-beginning)
  821.                              (region-end)))
  822.  
  823. --- 2246,2252 -----
  824.       (set-buffer mh-sent-from-folder)
  825.       (if mh-delete-yanked-msg-window
  826.           (delete-windows-on mh-show-buffer))
  827. !     (set-buffer (mh-get-buffer mh-show-buffer))    ; Find displayed message
  828.       (let ((mh-ins-str (cond ((mark)
  829.                    (buffer-substring (region-beginning)
  830.                              (region-end)))
  831. ***************
  832. *** 2484,2489
  833.       (yank)
  834.       (goto-char beginning-of-line)))
  835.   
  836.   
  837.   
  838.   ;;; Issue commands to MH.
  839.  
  840. --- 2594,2650 -----
  841.       (yank)
  842.       (goto-char beginning-of-line)))
  843.   
  844. + (defun mh-insert-sequence-list (seq)
  845. +   "Format and insert, into the current buf, a description of the sequence SEQ."
  846. +   (let ( (name (car seq))
  847. +      (s (sort (copy-sequence (cdr seq)) '<))
  848. +      (last-col 76)
  849. +      name-spec
  850. +      )
  851. +     (insert (setq name-spec (format "%20s:" name)))
  852. +     (while s
  853. +       (if (> (current-column) last-col)
  854. +       (progn
  855. +         (insert "\n")
  856. +         (move-to-column (length name-spec))
  857. +         )
  858. +     )
  859. +       (insert (format " %s" (car s)))
  860. +       (setq s (cdr s))
  861. +       )
  862. +     (insert "\n")
  863. +     )
  864. +   )
  865. + (defun mh-list-sequences (folder)
  866. +   "List the sequences defined in FOLDER."
  867. +   (interactive (list (mh-prompt-for-folder "List sequences in"
  868. +                        mh-current-folder t)))
  869. +   (let ( (temp-buffer " *mh-temp*")
  870. +      (l mh-seq-list)
  871. +      )
  872. +     (with-output-to-temp-buffer temp-buffer
  873. +       (save-excursion
  874. +     (set-buffer temp-buffer)
  875. +     (setq buffer-read-only nil)
  876. +     (erase-buffer)
  877. +     (message "Listing sequences ...")
  878. +     (insert "Sequences in folder " folder ":\n\n")
  879. +     (while l
  880. +       (mh-insert-sequence-list (car l))
  881. +       (setq l (cdr l))
  882. +       )
  883. +     (goto-char (point-min))
  884. +     (message "Listing sequences...done")
  885. +     )
  886. +       )
  887. +     )
  888. +   )
  889.   
  890.   
  891.   ;;; Issue commands to MH.
  892. ***************
  893. *** 2492,2498
  894.     ;; Execute MH command COMMAND with ARGS.
  895.     ;; Any output is assumed to be an error and is shown to the user.
  896.     (save-excursion
  897. !     (set-buffer " *mh-temp*")
  898.       (erase-buffer)
  899.       (apply 'call-process
  900.          (expand-file-name command mh-progs) nil t nil
  901.  
  902. --- 2653,2659 -----
  903.     ;; Execute MH command COMMAND with ARGS.
  904.     ;; Any output is assumed to be an error and is shown to the user.
  905.     (save-excursion
  906. !     (buffer-flush-undo (set-buffer " *mh-temp*"))
  907.       (erase-buffer)
  908.       (apply 'call-process
  909.          (expand-file-name command mh-progs) nil t nil
  910. ***************
  911. *** 2507,2513
  912.     ;; In BUFFER, execute MH command COMMAND with ARGS.
  913.     ;; ARGS is a list of strings.  Return in BUFFER, if one exists.
  914.     (mh-when (stringp buffer)
  915. !     (set-buffer buffer)
  916.       (erase-buffer))
  917.     (apply 'call-process
  918.        (expand-file-name command mh-progs) nil buffer nil
  919.  
  920. --- 2668,2674 -----
  921.     ;; In BUFFER, execute MH command COMMAND with ARGS.
  922.     ;; ARGS is a list of strings.  Return in BUFFER, if one exists.
  923.     (mh-when (stringp buffer)
  924. !     (buffer-flush-undo (set-buffer buffer))
  925.       (erase-buffer))
  926.     (apply 'call-process
  927.        (expand-file-name command mh-progs) nil buffer nil
  928. ***************
  929. *** 2603,2611
  930.   
  931.   ;;; User prompting commands.
  932.   
  933. ! (defun mh-prompt-for-folder (prompt default can-create)
  934. !   ;; Prompt for a folder name with PROMPT.  Returns the folder's name as a
  935. !   ;; string.  DEFAULT is used if the folder exists and the user types return.
  936.     ;; If the CAN-CREATE flag is t, then a non-existent folder is made.
  937.     (let* ((prompt (format "%s folder%s" prompt
  938.                (if (equal "" default)
  939.  
  940. --- 2764,2772 -----
  941.   
  942.   ;;; User prompting commands.
  943.   
  944. ! (defun mh-prompt-for-folder (prompt-string default can-create)
  945. !   ;; Prompt for a folder name with PROMPT-STRING.  Returns the folder's name as
  946. !   ;; a string.  DEFAULT is used if the folder exists and the user types return.
  947.     ;; If the CAN-CREATE flag is t, then a non-existent folder is made.
  948.     (let (prompt name)
  949.       (if (null mh-folder-list)
  950. ***************
  951. *** 2607,2617
  952.     ;; Prompt for a folder name with PROMPT.  Returns the folder's name as a
  953.     ;; string.  DEFAULT is used if the folder exists and the user types return.
  954.     ;; If the CAN-CREATE flag is t, then a non-existent folder is made.
  955. !   (let* ((prompt (format "%s folder%s" prompt
  956. !              (if (equal "" default)
  957. !                  "? "
  958. !                  (format " [%s]? " default))))
  959. !      name)
  960.       (if (null mh-folder-list)
  961.       (mh-set-folder-list))
  962.       (while (and (setq name (completing-read prompt mh-folder-list
  963.  
  964. --- 2768,2774 -----
  965.     ;; Prompt for a folder name with PROMPT-STRING.  Returns the folder's name as
  966.     ;; a string.  DEFAULT is used if the folder exists and the user types return.
  967.     ;; If the CAN-CREATE flag is t, then a non-existent folder is made.
  968. !   (let (prompt name)
  969.       (if (null mh-folder-list)
  970.       (mh-set-folder-list))
  971.       (setq prompt (format "%s folder%s" prompt-string
  972. ***************
  973. *** 2614,2619
  974.        name)
  975.       (if (null mh-folder-list)
  976.       (mh-set-folder-list))
  977.       (while (and (setq name (completing-read prompt mh-folder-list
  978.                           nil nil "+"))
  979.           (equal name "")
  980.  
  981. --- 2771,2791 -----
  982.     (let (prompt name)
  983.       (if (null mh-folder-list)
  984.       (mh-set-folder-list))
  985. +     (setq prompt (format "%s folder%s" prompt-string
  986. +              (if (equal "" default)
  987. +                  (let (folder)
  988. +                    (setq folder
  989. +                      (if mh-auto-folder-alist
  990. +                      (mh-auto-select-folder
  991. +                       mh-auto-folder-alist
  992. +                       'other)))
  993. +                    (if (or (not folder) (string= folder ""))
  994. +                    "? "
  995. +                  (progn
  996. +                    (setq default folder)
  997. +                    (format " [%s]? " folder)
  998. +                    )))
  999. +                (format " [%s]? " default))))
  1000.       (while (and (setq name (completing-read prompt mh-folder-list
  1001.                           nil nil "+"))
  1002.           (equal name "")
  1003. ***************
  1004. *** 2625,2631
  1005.       (let ((new-file-p (not (file-exists-p (mh-expand-file-name name)))))
  1006.         (cond ((and new-file-p
  1007.             (y-or-n-p
  1008. !            (format "Folder %s does not exist. Create it? " name)))
  1009.            (message "Creating %s" name)
  1010.            (call-process "mkdir" nil nil nil (mh-expand-file-name name))
  1011.            (message "Creating %s...done" name)
  1012.  
  1013. --- 2797,2803 -----
  1014.       (let ((new-file-p (not (file-exists-p (mh-expand-file-name name)))))
  1015.         (cond ((and new-file-p
  1016.             (y-or-n-p
  1017. !            (format "Folder %s does not exist.  Create it? " name)))
  1018.            (message "Creating %s" name)
  1019.            (call-process "mkdir" nil nil nil (mh-expand-file-name name))
  1020.            (message "Creating %s...done" name)
  1021. ***************
  1022. *** 2672,2677
  1023.       (delq (assoc folder mh-folder-list) mh-folder-list)))
  1024.   
  1025.   
  1026.   (defun mh-read-msg-range (prompt)
  1027.     ;; Read a list of blank-separated items.
  1028.     (let* ((buf (read-string prompt))
  1029.  
  1030. --- 2844,2868 -----
  1031.       (delq (assoc folder mh-folder-list) mh-folder-list)))
  1032.   
  1033.   
  1034. + (defun mh-drop-spaces (str)
  1035. +   "Return a copy of STR, with leading and trailing spaces removed."
  1036. +   (let (loc)
  1037. +     (if (string-match "^[ \t]+" str)
  1038. +     (setq str (substring str (match-end 0)))
  1039. +       )
  1040. +     (if (string-match "[ \t]+$" str)
  1041. +     (progn
  1042. +       (setq loc (match-beginning 0))
  1043. +       (if (> loc 0)
  1044. +           (setq loc (1- loc))
  1045. +         )
  1046. +       (setq str (substring str 0 loc))
  1047. +       )
  1048. +       )
  1049. +     str
  1050. +     )
  1051. +   )
  1052.   (defun mh-read-msg-range (prompt)
  1053.     ;; Read a list of blank-separated items.
  1054.     (let* ((buf (read-string prompt))
  1055. ***************
  1056. *** 2677,2688
  1057.     (let* ((buf (read-string prompt))
  1058.        (buf-size (length buf))
  1059.        (start 0)
  1060. !      (input ()))
  1061. !     (while (< start buf-size)
  1062. !       (let ((next (read-from-string buf start buf-size)))
  1063. !     (mh-push (car next) input)
  1064. !     (setq start (cdr next))))
  1065. !     (nreverse input)))
  1066.   
  1067.   
  1068.   
  1069.  
  1070. --- 2868,2895 -----
  1071.     (let* ((buf (read-string prompt))
  1072.        (buf-size (length buf))
  1073.        (start 0)
  1074. !      (input ""))
  1075. !     (while (> (length buf) 0)
  1076. !       (if (string-match "\\([^, \t]*\\)\\([, \t]*\\)" buf)
  1077. !       (progn
  1078. !         (if (/= (match-beginning 1) (match-end 1))
  1079. !         (setq input (concat input " "
  1080. !                     (substring buf
  1081. !                            (match-beginning 1)
  1082. !                            (match-end 1))))
  1083. !           )
  1084. !         )
  1085. !     (error "Error in mh-read-msg-range")
  1086. !     )
  1087. !       (setq buf (substring buf (match-end 2)))
  1088. !       )
  1089. !     (setq input (mh-drop-spaces input))
  1090. !     (if (string= input "")
  1091. !     (setq input "all")
  1092. !       )
  1093. !     input
  1094. !     )
  1095. !   )
  1096.   
  1097.   
  1098.   
  1099. ***************
  1100. *** 2812,2817
  1101.     (if (re-search-forward "^$\\|^-+$" nil nil)
  1102.         (forward-line arg)))
  1103.   
  1104.   
  1105.   
  1106.   ;;; Build the folder-mode keymap:
  1107.  
  1108. --- 3019,3104 -----
  1109.     (if (re-search-forward "^$\\|^-+$" nil nil)
  1110.         (forward-line arg)))
  1111.   
  1112. + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1113. + ;;
  1114. + ;; Autoloads for MH enhancements:
  1115. + ;;
  1116. + (autoload 'mh-expand-alias "mh-alias"
  1117. +       "Expand the alias before point.
  1118. + In order for the alias to be expanded, point must be either in the minibuffer
  1119. + or in the To: or Cc: mail headers.  Otherwise, the keypress used to invoke
  1120. + this function is instead inserted into the buffer.
  1121. + If the alias is not unique, all matching possibilities are displayed in
  1122. + a pop-up buffer.  If there is no alias before point, all aliases are
  1123. + displayed."
  1124. +       t nil)
  1125. + (autoload 'mh-read-to-cc-subject "mh-alias"
  1126. +       "Read addresses for To: and Cc:, and read a subject line.
  1127. + The result is returned in a form suitable for passing to the `interactive'
  1128. + function."
  1129. +       nil nil)
  1130. + (autoload 'mh-read-to-address "mh-alias"
  1131. +       "Ask the user for a To: address, only if mh-ask-to-address is non-nil."
  1132. +       nil nil)
  1133. + (autoload 'mh-read-cc-address "mh-alias"
  1134. +       "Ask the user for a Cc: address, only if mh-ask-to-address is non-nil."
  1135. +       nil nil)
  1136. + (autoload 'mh-read-subject "mh-alias"
  1137. +       "Ask the user for a Subject:, only if mh-ask-to-address is non-nil."
  1138. +       nil nil)
  1139. + (autoload 'mh-auto-select-folder "mh-refile"
  1140. +       "Return the name of a folder to refile the current message in.
  1141. + The current buffer is scanned for this information."
  1142. +       nil nil)
  1143. + (autoload 'mh-get-default-refile-folder "mh-refile"
  1144. +       "Get a default name for refiling a message."
  1145. +       nil nil)
  1146. + (autoload 'mh-set-default-refile-folder "mh-refile"
  1147. +       "Set the default folder for the MH message under the cursor in the current
  1148. + folder buffer."
  1149. +       t nil)
  1150. + (autoload 'mh-unshar "mh-shar"
  1151. +       "Unshar the current message in the directory given by DIR."
  1152. +       t nil)
  1153. + (autoload 'mh-uudecode "mh-shar"
  1154. +       "Unshar the current message in the directory given by DIR."
  1155. +       t nil)
  1156. + (autoload 'mh-add-md4-header "mh-shar"
  1157. +       "Insert an \"X-Md4-Signature:\" line into the header."
  1158. +       nil nil)
  1159. + (autoload 'mh-check-md4-signature "mh-shar"
  1160. +       "If an MD4 signature is present in the header, check it and report the results."
  1161. +       t nil)
  1162. + (autoload 'mh-shar-and-insert "mh-shar"
  1163. +       "Shar the file FILE, passing OTHER-ARGS (if any) to the shar program.
  1164. + The shar contents in then inserted into the current buffer."
  1165. +       t nil)
  1166. + (autoload 'mh-uuencode-and-insert "mh-shar"
  1167. +       "Uuencode and insert the file FILE into the current buffer.
  1168. + Normally, the uuencoded filename does not contain a pathname.
  1169. + If ABSOLUTE is non-nil, or if a prefix argument is given, the uuencoded
  1170. + information will contain an absolute pathname."
  1171. +       t nil)
  1172.   
  1173.   
  1174.   ;;; Build the folder-mode keymap:
  1175. ***************
  1176. *** 2822,2827
  1177.   (define-key mh-folder-mode-map "?" 'mh-msg-is-in-seq)
  1178.   (define-key mh-folder-mode-map "%" 'mh-put-msg-in-seq)
  1179.   (define-key mh-folder-mode-map "|" 'mh-pipe-msg)
  1180.   (define-key mh-folder-mode-map "\ea" 'mh-edit-again)
  1181.   (define-key mh-folder-mode-map "\e%" 'mh-delete-msg-from-seq)
  1182.   (define-key mh-folder-mode-map "\C-xn" 'mh-narrow-to-seq)
  1183.  
  1184. --- 3109,3115 -----
  1185.   (define-key mh-folder-mode-map "?" 'mh-msg-is-in-seq)
  1186.   (define-key mh-folder-mode-map "%" 'mh-put-msg-in-seq)
  1187.   (define-key mh-folder-mode-map "|" 'mh-pipe-msg)
  1188. + (define-key mh-folder-mode-map "=" 'mh-set-default-refile-folder)
  1189.   (define-key mh-folder-mode-map "\ea" 'mh-edit-again)
  1190.   (define-key mh-folder-mode-map "\e%" 'mh-delete-msg-from-seq)
  1191.   (define-key mh-folder-mode-map "\C-xn" 'mh-narrow-to-seq)
  1192. ***************
  1193. *** 2827,2832
  1194.   (define-key mh-folder-mode-map "\C-xn" 'mh-narrow-to-seq)
  1195.   (define-key mh-folder-mode-map "\C-xw" 'mh-widen)
  1196.   (define-key mh-folder-mode-map "\eb" 'mh-burst-digest)
  1197.   (define-key mh-folder-mode-map "\eu" 'mh-undo-folder)
  1198.   (define-key mh-folder-mode-map "\e " 'mh-page-digest)
  1199.   (define-key mh-folder-mode-map "\e\177" 'mh-page-digest-backwards)
  1200.  
  1201. --- 3115,3124 -----
  1202.   (define-key mh-folder-mode-map "\C-xn" 'mh-narrow-to-seq)
  1203.   (define-key mh-folder-mode-map "\C-xw" 'mh-widen)
  1204.   (define-key mh-folder-mode-map "\eb" 'mh-burst-digest)
  1205. + (define-key mh-folder-mode-map "\ec" 'mh-uudecode)
  1206. + (define-key mh-folder-mode-map "\en" 'mh-unshar)
  1207. + (define-key mh-folder-mode-map "\eq" 'mh-list-sequences)
  1208. + (define-key mh-folder-mode-map "\eS" 'mh-sort-folder)
  1209.   (define-key mh-folder-mode-map "\eu" 'mh-undo-folder)
  1210.   (define-key mh-folder-mode-map "\e " 'mh-page-digest)
  1211.   (define-key mh-folder-mode-map "\e\177" 'mh-page-digest-backwards)
  1212. ***************
  1213. *** 2864,2869
  1214.   (define-key mh-folder-mode-map "p" 'mh-previous-undeleted-msg)
  1215.   (define-key mh-folder-mode-map "n" 'mh-next-undeleted-msg)
  1216.   (define-key mh-folder-mode-map "o" 'mh-refile-msg)
  1217.   
  1218.   
  1219.   ;;; Build the letter-mode keymap:
  1220.  
  1221. --- 3156,3166 -----
  1222.   (define-key mh-folder-mode-map "p" 'mh-previous-undeleted-msg)
  1223.   (define-key mh-folder-mode-map "n" 'mh-next-undeleted-msg)
  1224.   (define-key mh-folder-mode-map "o" 'mh-refile-msg)
  1225. + (define-key mh-folder-mode-map "v" 'mh-check-md4-signature)
  1226. + (define-key mh-letter-mode-map "\C-cs" 'mh-shar-and-insert)
  1227. + (define-key mh-letter-mode-map "\C-cu" 'mh-uuencode-and-insert)
  1228. + ;; Make TAB expand aliases
  1229. + (define-key mh-letter-mode-map "\t" 'mh-expand-