Gnus development mailing list
 help / color / mirror / Atom feed
* standard replies made easy
@ 1998-12-16 17:23 Stefan Waldherr
  1998-12-17  0:15 ` François Pinard
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Waldherr @ 1998-12-16 17:23 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 233 bytes --]


Hi,

I wrote a quick and dirty thing that helps people insert a predefined text
into a reply. It is intended for people who are sick of giving the same answer
to a number of people. The file should be self-explanatory.

cu
Stefan.


[-- Attachment #2: gnus-autoreply.el --]
[-- Type: application/octet-stream, Size: 2608 bytes --]

;; --------------------------------------------------------------------------------
;;
;; $Id: gnus-autoreply.el,v 1.2 1998/12/15 11:17:06 swa Exp $
;;
;; Stefan Waldherr <swa@cs.cmu.edu>
;;
;; --------------------------------------------------------------------------------
;;
;; Based on stuff from dsg@mitre.org (David S. Goldberg) and 
;; SL Baur <steve@xemacs.org>
;;
;; --------------------------------------------------------------------------------
;;
;; Installation:
;; -------------
;;  Put this file somewhere and load it from your .gnus file with, e.g.
;;  (load-file (expand-file-name "~/bin/emacs/gnus-autoreply.el"))
;; 
;;  Create a bunch of standard replies and put them (with suggestive names)
;;  into, say, ~/Mail/.autoreply. Change gnus-autoreply-dir accordingly.
;;
;; Usage:
;; ------
;;
;;  Reply to a mail. In the *Article* buffer, hit `C-c r'. Choose the file
;;  which you want to insert. Then change it and/or hit `C-c C-c' to send
;;  the mail. Voila.
;;
;; --------------------------------------------------------------------------------
;; 
;; $Log: gnus-autoreply.el,v $
;; Revision 1.2  1998/12/15 11:17:06  swa
;; Used steve's stuff.
;;
;; Revision 1.1  1998/12/15 11:05:16  swa
;; First version.
;;
;; --------------------------------------------------------------------------------

;; where the replies can be found
(setq gnus-autoreply-dir "/home/swa/Mail/.autoreply")

;; prefix it with `reply-' or something. If you want.
(setq gnus-autoreply-file-prefix "")

;; the function that takes care of choosing the file and inserting it
(defun gnus-summary-autoreply ()
  "Automatic reply."
  (interactive)
  ;(message-remove-header "from")
  ;(message-add-header "From: Patch Acknowledgement <steve@xemacs.org>"
  ;"X-Emacs-Patch-Ack: yes")
  (message-goto-body)
  (let ((gnus-autoreply-file 
	 (completing-read "Reply File: "
			  (mapcar 'list
				  (directory-files
				   gnus-autoreply-dir nil
				   (regexp-quote gnus-autoreply-file-prefix)))
			  nil t gnus-autoreply-file-prefix))
	(gnus-autoreplyed-user (save-excursion
			      (set-buffer gnus-article-buffer)
			      (or (message-fetch-field "Reply-To")
				  (message-fetch-field "From")))))
    (if (= (length gnus-autoreply-file) 0)
	(setq gnus-autoreply-file auto-default-reply-file))
    (if (not gnus-autoreplyed-user)
	(error "Error in message structure: no Reply-To or From lines."))
    (insert-file-contents (concat gnus-autoreply-dir "/" gnus-autoreply-file))
    ))

;; define the key
(add-hook 'message-load-hook
          (define-key message-mode-map [(control ?c) ?r] 'gnus-summary-autoreply))

[-- Attachment #3: Type: text/plain, Size: 181 bytes --]


-- 
Stefan Waldherr                   fax +49 431 8058 136
                               e-Mail stefan@waldherr.org
                                  www http://www.waldherr.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-12-17  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-16 17:23 standard replies made easy Stefan Waldherr
1998-12-17  0:15 ` François Pinard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).