aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-08-29 21:37:52 +0000
committerRichard M. Stallman1996-08-29 21:37:52 +0000
commit31257c3f4ee9bdc00ab564a47cbcd856e060d5fd (patch)
tree2a7d4156c1fc57efa480eebf7c209df01c7ac357
parent73a9679c91b1f0d6bed4ddfd5bd8e1fd1d73f65c (diff)
downloademacs-31257c3f4ee9bdc00ab564a47cbcd856e060d5fd.tar.gz
emacs-31257c3f4ee9bdc00ab564a47cbcd856e060d5fd.zip
(reporter-compose-outgoing): Fix error syntax.
(reporter-bug-hook): Fix error message. (mail-user-agent): Variable moved to simple.el. (define-mail-user-agent): Function moved to simple.el. (sendmail-user-agent, mh-e-user-agent): Defs moved to simple.el. (reporter-mail): Function deleted.
-rw-r--r--lisp/mail/reporter.el84
1 files changed, 4 insertions, 80 deletions
diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el
index e459581e78d..76d7108d1a0 100644
--- a/lisp/mail/reporter.el
+++ b/lisp/mail/reporter.el
@@ -33,12 +33,6 @@
33;; Emacs mail package end users would like to use to compose outgoing 33;; Emacs mail package end users would like to use to compose outgoing
34;; mail. See that variable for details. 34;; mail. See that variable for details.
35 35
36;; Mail Package Interface
37;; ======================
38;; Mail package authors can configure reporter to support their
39;; package by calling the function `define-mail-user-agent' See that
40;; function for details.
41
42;; Lisp Package Authors 36;; Lisp Package Authors
43;; ==================== 37;; ====================
44;; Reporter was written primarily for Emacs Lisp package authors so 38;; Reporter was written primarily for Emacs Lisp package authors so
@@ -83,31 +77,9 @@
83;; pgp, eos, hm--html, efs. 77;; pgp, eos, hm--html, efs.
84;; 78;;
85;; If you know of others, please email me! 79;; If you know of others, please email me!
86
87;;; Code:
88
89 80
90;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 81;;; Code:
91;; End user interface
92
93;;;###autoload
94(defvar mail-user-agent 'sendmail-user-agent
95 "*Your preference for a mail composition package.
96Various Emacs Lisp packages (e.g. reporter) require you to compose an
97outgoing email message. As there are several such packages available
98for Emacs, you can indicate your preference by setting this variable.
99
100Valid values currently are:
101
102 'sendmail-user-agent -- use Emacs built-in Mail package
103 'vm-user-agent -- use Kyle Jones' VM package
104 'mh-e-user-agent -- use the Emacs interface to the MH mail system
105
106Additional valid symbols may be available; check with the author of
107your package for details.")
108
109 82
110
111;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 83;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
112;; Package author interface variables 84;; Package author interface variables
113 85
@@ -330,12 +302,6 @@ composed.")
330 (buffer-substring (match-beginning 0) (match-end 0)))) 302 (buffer-substring (match-beginning 0) (match-end 0))))
331 303
332 304
333;; Serves as an interface to `mail' (sendmail.el), but when the user
334;; answers "no" to discarding an unsent message, it gives an error.
335(defun reporter-mail (&rest args)
336 (or (apply 'mail args)
337 (error "Bug report aborted")))
338
339(defun reporter-compose-outgoing () 305(defun reporter-compose-outgoing ()
340 ;; compose the outgoing mail buffer, and return the selected 306 ;; compose the outgoing mail buffer, and return the selected
341 ;; paradigm, with the current-buffer tacked onto the beginning of 307 ;; paradigm, with the current-buffer tacked onto the beginning of
@@ -349,9 +315,9 @@ composed.")
349 (setq agent 'sendmail-user-agent 315 (setq agent 'sendmail-user-agent
350 compose (get agent 'composefunc)) 316 compose (get agent 'composefunc))
351 (if (not (and compose (fboundp compose))) 317 (if (not (and compose (fboundp compose)))
352 (error "Could not find a valid `mail-user-agent'.") 318 (error "Could not find a valid `mail-user-agent'")
353 (ding) 319 (ding)
354 (message "`%s' is an invalid `mail-user-agent'; using `sendmail-user-agent'." 320 (message "`%s' is an invalid `mail-user-agent'; using `sendmail-user-agent'"
355 mail-user-agent) 321 mail-user-agent)
356 ))) 322 )))
357 (funcall compose) 323 (funcall compose)
@@ -463,51 +429,9 @@ composed.")
463 (length reporter-initial-text)) 429 (length reporter-initial-text))
464 (string= (buffer-substring after-sep-pos (point)) 430 (string= (buffer-substring after-sep-pos (point))
465 reporter-initial-text)) 431 reporter-initial-text))
466 (error "Empty bug report cannot be sent.")) 432 (error "Bug report was empty--not sent"))
467 ))) 433 )))
468 434
469 435
470;; paradigm definitions
471(defun define-mail-user-agent (symbol composefunc sendfunc
472 &optional abortfunc hookvar)
473 "Define a symbol appropriate for `mail-user-agent'.
474
475SYMBOL can be any meaningful lisp symbol. It need not have a function
476or variable definition, as it is only used for its property list.
477The property names are equivalent to the formal argument described
478below (but in lower case). Additional properties can be placed on the
479symbol.
480
481COMPOSEFUNC is program callable function that composes an outgoing
482mail message buffer. This function should set up the basics of the
483buffer without requiring user interaction. It should populate the
484standard mail headers, leaving the `to:' and `subject:' headers blank.
485
486SENDFUNC is the command a user would type to send the message.
487
488Optional ABORTFUNC is the command a user would type to abort the
489message. For mail packages that don't have a separate abort function,
490this can be `kill-buffer' (the equivalent of omitting this argument).
491
492Optional HOOKVAR is a hook variable that gets run before the message
493is actually sent. Reporter will install `reporter-bug-hook' onto this
494hook so that empty bug reports can be suppressed by raising an error.
495If not supplied, `mail-send-hook' will be used."
496 (put symbol 'composefunc composefunc)
497 (put symbol 'sendfunc sendfunc)
498 (put symbol 'abortfunc (or abortfunc 'kill-buffer))
499 (put symbol 'hookvar (or hookvar 'mail-send-hook)))
500
501(define-mail-user-agent 'sendmail-user-agent
502 'reporter-mail 'mail-send-and-exit)
503
504(define-mail-user-agent 'vm-user-agent
505 'vm-mail 'vm-mail-send-and-exit)
506
507(define-mail-user-agent 'mh-e-user-agent
508 'mh-smail-batch 'mh-send-letter 'mh-fully-kill-draft
509 'mh-before-send-letter-hook)
510
511
512(provide 'reporter) 436(provide 'reporter)
513;;; reporter.el ends here 437;;; reporter.el ends here