diff options
| author | Richard M. Stallman | 1996-08-29 21:37:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-08-29 21:37:52 +0000 |
| commit | 31257c3f4ee9bdc00ab564a47cbcd856e060d5fd (patch) | |
| tree | 2a7d4156c1fc57efa480eebf7c209df01c7ac357 | |
| parent | 73a9679c91b1f0d6bed4ddfd5bd8e1fd1d73f65c (diff) | |
| download | emacs-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.el | 84 |
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. | ||
| 96 | Various Emacs Lisp packages (e.g. reporter) require you to compose an | ||
| 97 | outgoing email message. As there are several such packages available | ||
| 98 | for Emacs, you can indicate your preference by setting this variable. | ||
| 99 | |||
| 100 | Valid 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 | |||
| 106 | Additional valid symbols may be available; check with the author of | ||
| 107 | your 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 | |||
| 475 | SYMBOL can be any meaningful lisp symbol. It need not have a function | ||
| 476 | or variable definition, as it is only used for its property list. | ||
| 477 | The property names are equivalent to the formal argument described | ||
| 478 | below (but in lower case). Additional properties can be placed on the | ||
| 479 | symbol. | ||
| 480 | |||
| 481 | COMPOSEFUNC is program callable function that composes an outgoing | ||
| 482 | mail message buffer. This function should set up the basics of the | ||
| 483 | buffer without requiring user interaction. It should populate the | ||
| 484 | standard mail headers, leaving the `to:' and `subject:' headers blank. | ||
| 485 | |||
| 486 | SENDFUNC is the command a user would type to send the message. | ||
| 487 | |||
| 488 | Optional ABORTFUNC is the command a user would type to abort the | ||
| 489 | message. For mail packages that don't have a separate abort function, | ||
| 490 | this can be `kill-buffer' (the equivalent of omitting this argument). | ||
| 491 | |||
| 492 | Optional HOOKVAR is a hook variable that gets run before the message | ||
| 493 | is actually sent. Reporter will install `reporter-bug-hook' onto this | ||
| 494 | hook so that empty bug reports can be suppressed by raising an error. | ||
| 495 | If 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 |