home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / emacs / 2713 < prev    next >
Encoding:
Text File  |  1992-07-27  |  2.0 KB  |  60 lines

  1. Newsgroups: comp.emacs,cs.emacs
  2. Path: sparky!uunet!mcsun!news.funet.fi!funic!nntp.hut.fi!nntp!raivio
  3. From: raivio@niksula.hut.fi (Perttu Raivio)
  4. Subject: Re: Is there a way to get RMAIL to behave like this:
  5. In-Reply-To: ericg@bronze.ucs.indiana.edu's message of Fri, 24 Jul 92 14:22:45 GMT
  6. Message-ID: <RAIVIO.92Jul27112202@hydroman.hut.FI>
  7. Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
  8. Nntp-Posting-Host: hydroman.cs.hut.fi
  9. Organization: BREWTeX - Wine, women and song
  10. References: <1992Jul24.142245.9472@bronze.ucs.indiana.edu>
  11. Date: 27 Jul 92 11:22:02
  12. Lines: 46
  13.  
  14. In article <1992Jul24.142245.9472@bronze.ucs.indiana.edu> ericg@bronze.ucs.indiana.edu (E. Chris Garrison) writes:
  15. >
  16. > Easy enough.  Not so in RMAIL, replying does not include
  17. > text, and I can't get regexp-replace to do the above replace.
  18.  
  19.     The inclusion, as others havo pointed out, is done with C-c
  20. C-y. To change the indentation you can use the following piece of
  21. elisp code which will do the job automatically:
  22.  
  23.     --- cut --- cut --- cut --- cut --- cut --- cut ---
  24.  
  25. ;; Mail yank indention with "> "
  26.  
  27. (setq mail-setup-hook
  28.       (setq news-reply-mode-hook 
  29.         '(lambda ()
  30.            (defvar mail-yank-indent-string "> ")
  31.            
  32.            (defun mail-yank-original (arg)
  33.          (interactive "P")
  34.          (if mail-reply-buffer
  35.              (let ((start (point)))
  36.                (delete-windows-on mail-reply-buffer)
  37.                (insert-buffer mail-reply-buffer)
  38.                (mail-yank-clear-headers start (mark))
  39.                (mail-yank-indent start)
  40.                (exchange-point-and-mark)
  41.                (if (not (eolp)) (insert ?\n)))))
  42.            
  43.            (defun mail-yank-indent (start)
  44.          (save-excursion
  45.            (goto-char start)
  46.            (while (re-search-forward "^" (point-max) t)
  47.              (replace-match mail-yank-indent-string)) 
  48.            (goto-char start)
  49.            (while (re-search-forward 
  50.                (concat "^" mail-yank-indent-string "[ \t]*$") 
  51.                (point-max) t)
  52.              (replace-match "")))) )))
  53.  
  54.     --- cut --- cut --- cut --- cut --- cut --- cut ---
  55.  
  56. --
  57.  
  58.     K.P.Raivio - Helsinki U of T - raivio@niksula.hut.fi
  59.     Ei fl|ittej{, ei niin dzoukin p{tk{{k{{n...
  60.