Xref: utzoo gnu.emacs:1177 comp.emacs:6412 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!otter!hplb!anorman!ange From: ange@hplb.hpl.hp.com (Andy Norman) Newsgroups: gnu.emacs,comp.emacs Subject: superyank works under mh-e Message-ID: Date: 30 Jun 89 20:08:25 GMT Sender: news@hplb.hpl.hp.com Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 64 I enclose some code which allows mh-e users to take advantage of the recently posted superyank package. Enjoy... -- ange -- -------------------------------------------------------------------------------- (require 'mh-e) (defun mh-yank-msg (confirm buf) "Insert the message in the given buffer into the current buffer citing as per user preferences." (local-set-key "\C-cq" 'sy-fill-paragraph-manually) (local-set-key "\C-c\i" 'sy-insert-persist-attribution) (local-set-key "\C-c\C-o" 'sy-open-line) (let ((mail-reply-buffer buf)) (save-window-excursion (save-restriction (narrow-to-region (point-max) (point-max)) (sy-yank-original confirm))))) (defun mh-yank-cur-msg (confirm) "Insert the currently displayed message into the draft buffer citing as per user preferences. Numeric argument forces confirmation." (interactive "P") (if (and (boundp 'mh-sent-from-folder) mh-sent-from-folder mh-sent-from-msg) (let ((buf (save-excursion (set-buffer mh-sent-from-folder) (if mh-delete-yanked-msg-window (delete-windows-on mh-show-buffer)) mh-show-buffer))) (mh-yank-msg confirm buf)) (error "There is no current message."))) (defun mh-insert-letter (confirm folder msg) "Insert a message from any folder into the draft buffer citing as per user preferences. Numeric arguement forces confirmation." (interactive (list current-prefix-arg (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) (read-input (format "Message number%s: " (if mh-sent-from-msg (format " [%d]" mh-sent-from-msg) ""))))) (if (equal msg "") (setq msg (format "%d" mh-sent-from-msg))) (let* ((file (mh-expand-file-name msg (mh-expand-file-name folder))) (buf (create-file-buffer file))) (save-excursion (set-buffer buf) (insert-file-contents file) (set-buffer-modified-p nil)) (mh-yank-msg confirm buf) (kill-buffer buf))) -- -- ange -- ange@hplb.hpl.hp.com