home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!spool.mu.edu!hri.com!noc.near.net!news.centerline.com!franl
- From: franl@centerline.com (Fran Litterio)
- Newsgroups: gnu.emacs.gnus
- Subject: Re: Getting ">" when following up
- Message-ID: <FRANL.93Jan24151434@draco.centerline.com>
- Date: 24 Jan 93 20:14:34 GMT
- References: <Y-PISAN.93Jan24132529@SPD-13.ils.nwu.edu>
- Distribution: gnu
- Organization: CenterLine Software R&D
- Lines: 64
- NNTP-Posting-Host: 140.239.3.116
- In-reply-to: y-pisan@nwu.edu's message of 24 Jan 93 19:25:29 GMT
-
- y-pisan@nwu.edu (Yusuf Pisan) writes:
-
- > When I use gnus-Subejct-mail-reply-with-original the original article
- > gets indented without any characters being added to the beginning of
- > the line. I would like ">" to be added to the original message to
- > distinguish it from my reply.
-
- This elisp should do the trick. It includes two functions that may
- have general use elsewhere: my-shorten-reference-lines and
- my-indent-region-with-string. If you don't want your replies and
- followups to have shortened references, remove the calls to
- my-shorten-reference-lines.
-
- (setq gnus-Subject-mode-hook 'my-gnus-Subject-mode-hook)
-
- (defun my-gnus-Subject-mode-hook ()
- "Adjust gnus-Subject-mode keybindings to my liking."
- (define-key gnus-Subject-mode-map "f" 'my-gnus-Subject-post-reply-with-original)
- (define-key gnus-Subject-mode-map "r" 'my-gnus-Subject-mail-reply-with-original))
-
- (defun my-gnus-Subject-mail-reply-with-original ()
- "Send mail to news articles author with article included."
- (interactive)
- (gnus-Subject-mail-reply nil)
- (mail-yank-original 0)
- (my-shorten-reference-lines)
- (my-indent-region-with-string "> ")
- (goto-char (point-min))
- (forward-line 5))
-
- (defun my-gnus-Subject-post-reply-with-original ()
- "Post news followup with original article included."
- (interactive)
- (gnus-Subject-post-reply nil)
- (news-reply-yank-original 0)
- (my-shorten-reference-lines)
- (my-indent-region-with-string "> "))
-
- (defun my-shorten-reference-lines ()
- "Reduce the horizontal space occupied by article references within the region."
- (interactive)
- (save-excursion
- (goto-char (point-min))
- (replace-regexp "In article <[^>]*> " "" nil)))
-
- (defun my-indent-region-with-string (indent-string)
- "Prefixs every line in the region with a user-supplied string."
- (interactive "*sIndent region with string: ")
- (if (equal indent-string "")
- (setq indent-string "> "))
- (save-excursion
- (let ((reglines (count-lines (region-beginning) (region-end)))
- (line 1))
- (goto-char (region-beginning))
- (while (<= line reglines)
- (beginning-of-line)
- (insert indent-string)
- (setq line (+ line 1))
- (forward-line 1)))))
- --
- franl@centerline.com "So what we've decided to do is set you up in
- uunet!centerline!franl Cicely, situated in an area that we Alaskans
- 617-498-3255 (USA) refer to as The Alaskan Riviera."
- PGP 2.0 public key available.
-