Xref: utzoo gnu.emacs:1179 comp.emacs:6414 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ukma!tut.cis.ohio-state.edu!rpi!rpi.edu!tale From: tale@pawl.rpi.edu (David C Lawrence) Newsgroups: gnu.emacs,comp.emacs Subject: Re: superyank works under mh-e Message-ID: Date: 2 Jul 89 19:23:35 GMT References: Sender: usenet@rpi.edu Reply-To: tale@pawl.rpi.edu Lines: 66 In-reply-to: ange@hplb.hpl.hp.com's message of 30 Jun 89 20:08:25 GMT I had already mailed this off to superyank@cme.nist.gov last week; curiously, mail to one of the addresses (@hpl.hp.com) bounced, who I guess is ange. I had also mailed it concurrently to info-gnu-emacs@ai.mit.edu but that bounced with an unknown user as did the same address at prep. (Len? Bob? Temporary thing or did the list move or what?) Anyway, this function I put in mh-etc.el and require it from my mh-compose-letter-hook. The advantage I see with it over ange's code is that it behaves like the original mh-yank-cur-msg with the exception that it will quote like superyank. This is a big win for people like me who don't like to yank the whole 4k message when I just want to quote three lines of it -- I set the region in the mh-show-buffer and yank away. The disadvantage compared to ange's functions are that I didn't do anything with mh-insert-letter so it still uses the old style mh-ins-buf-prefix. I could write that if people really want it ... Dave ---cut--- (require 'mh-e) (provide 'mh-etc) (defun mh-yank-cur-msg (arg) "Insert the currently displayed message into the draft buffer. Prefix each line in the message by calling sy-insert-citation. If a region is set in the message's buffer, then only the region will be inserted. Otherwise, the entire message will be inserted if mh-yank-from-start-of-msg is non-nil. If this variable is nil, the portion of the message following the point will be yanked. If mh-delete-yanked-msg-window is non-nil, any window displaying the yanked message will be deleted. NOTE: this function has been modified to work with the superyank package." (interactive "P") (local-set-key "\C-cq" 'sy-fill-paragraph-manually) (local-set-key "\C-ci" 'sy-insert-persist-attribution) (local-set-key "\C-c\C-o" 'sy-open-line) (if (and (boundp 'mh-sent-from-folder) mh-sent-from-folder mh-sent-from-msg) (let* ((sy-confirm-always-p (if (consp arg) t sy-confirm-always-p)) (mh-show-buffer (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer)) (attribution (sy-scan-rmail-for-names mh-show-buffer)) (start (point))) (if mh-delete-yanked-msg-window (delete-windows-on mh-show-buffer)) (set-mark (point)) (insert-before-markers (save-excursion (set-buffer mh-show-buffer) (sy-yank-fields (point-min)) (cond ((mark) (buffer-substring (point) (mark))) ((eq 'body mh-yank-from-start-of-msg) (mh-goto-header-end 1) (buffer-substring (point) (point-max))) (mh-yank-from-start-of-msg (buffer-string)) (t (buffer-substring (point) (point-max)))))) (sy-rewrite-headers start) (mail-yank-clear-headers (point) (mark)) (setq sy-persist-attribution (concat attribution " ")) (sy-insert-citation (point) (mark) attribution)) (error "There is no current message."))) --cut-- -- (setq mail '("tale@pawl.rpi.edu" "tale@itsgw.rpi.edu" "tale@rpitsmts.bitnet")) "Drinking coffee for instant relaxation? That's like drinking alcohol for instant motor skills." -- Mike Price (?)