diff options
| author | Richard M. Stallman | 1998-03-20 06:37:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-20 06:37:09 +0000 |
| commit | 72fe4615112a50c4a4d45386e9475d2727fcda0b (patch) | |
| tree | ba20f10a1b2367f062547b571f8e149b6eb64f93 | |
| parent | 8861c59398b6497a2a49b166467a5a56cae16c80 (diff) | |
| download | emacs-72fe4615112a50c4a4d45386e9475d2727fcda0b.tar.gz emacs-72fe4615112a50c4a4d45386e9475d2727fcda0b.zip | |
(reporter-mail): New function.
(reporter-compose-outgoing): Use fboundp, not functionp.
(reporter-bug-hook): Fix error message.
(reporter-beautify-list): Break infloop when reaching the end of the
buffer without crossing an unbalanced paren. Use scan-sexps instead
of forward-sexp for the loop break test.
(reporter-submit-bug-report): Only call
display-buffer if pop-up-windows is non-nil.
| -rw-r--r-- | lisp/mail/reporter.el | 78 |
1 files changed, 43 insertions, 35 deletions
diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el index c041ed620b9..59cea3ae4c6 100644 --- a/lisp/mail/reporter.el +++ b/lisp/mail/reporter.el | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | ;;; reporter.el --- customizable bug reporting of lisp programs | 1 | ;;; reporter.el --- customizable bug reporting of lisp programs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993 1994 1995 1996 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1993,1994,1995,1996,1997,1998 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: 1993-1996 Barry A. Warsaw | 5 | ;; Author: 1993-1998 Barry A. Warsaw |
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: tools-help@python.org |
| 7 | ;; Created: 19-Apr-1993 | 7 | ;; Created: 19-Apr-1993 |
| 8 | ;; Version: 3.3 | 8 | ;; Version: 3.34 |
| 9 | ;; Last Modified: 1996/07/02 00:39:09 | 9 | ;; Last Modified: 1998/03/19 17:21:16 |
| 10 | ;; Keywords: maint mail tools | 10 | ;; Keywords: maint mail tools |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| @@ -32,18 +32,19 @@ | |||
| 32 | ;; ================== | 32 | ;; ================== |
| 33 | ;; The variable `mail-user-agent' contains a symbol indicating which | 33 | ;; The variable `mail-user-agent' contains a symbol indicating which |
| 34 | ;; Emacs mail package end users would like to use to compose outgoing | 34 | ;; Emacs mail package end users would like to use to compose outgoing |
| 35 | ;; mail. See that variable for details. | 35 | ;; mail. See that variable for details (it is no longer defined in |
| 36 | ;; this file). | ||
| 36 | 37 | ||
| 37 | ;; Lisp Package Authors | 38 | ;; Lisp Package Authors |
| 38 | ;; ==================== | 39 | ;; ==================== |
| 39 | ;; Reporter was written primarily for Emacs Lisp package authors so | 40 | ;; reporter.el was written primarily for Emacs Lisp package authors so |
| 40 | ;; that their users can easily report bugs. When invoked, | 41 | ;; that their users can more easily report bugs. When invoked, |
| 41 | ;; reporter-submit-bug-report will set up an outgoing mail buffer with | 42 | ;; `reporter-submit-bug-report' will set up an outgoing mail buffer |
| 42 | ;; the appropriate bug report address, including a lisp expression the | 43 | ;; with the appropriate bug report address, including a lisp |
| 43 | ;; maintainer of the package can eval to completely reproduce the | 44 | ;; expression the maintainer of the package can evaluate to completely |
| 44 | ;; environment in which the bug was observed (e.g. by using | 45 | ;; reproduce the environment in which the bug was observed (e.g. by |
| 45 | ;; eval-last-sexp). This package proved especially useful during my | 46 | ;; using `eval-last-sexp'). This package proved especially useful |
| 46 | ;; development of cc-mode, which is highly dependent on its | 47 | ;; during my development of CC Mode, which is highly dependent on its |
| 47 | ;; configuration variables. | 48 | ;; configuration variables. |
| 48 | ;; | 49 | ;; |
| 49 | ;; Do a "C-h f reporter-submit-bug-report" for more information. | 50 | ;; Do a "C-h f reporter-submit-bug-report" for more information. |
| @@ -54,6 +55,7 @@ | |||
| 54 | ;;(defun mypkg-submit-bug-report () | 55 | ;;(defun mypkg-submit-bug-report () |
| 55 | ;; "Submit via mail a bug report on mypkg" | 56 | ;; "Submit via mail a bug report on mypkg" |
| 56 | ;; (interactive) | 57 | ;; (interactive) |
| 58 | ;; (require 'reporter) | ||
| 57 | ;; (reporter-submit-bug-report | 59 | ;; (reporter-submit-bug-report |
| 58 | ;; mypkg-maintainer-address | 60 | ;; mypkg-maintainer-address |
| 59 | ;; (concat "mypkg.el " mypkg-version) | 61 | ;; (concat "mypkg.el " mypkg-version) |
| @@ -62,25 +64,18 @@ | |||
| 62 | ;; ;; ... | 64 | ;; ;; ... |
| 63 | ;; 'mypkg-variable-last))) | 65 | ;; 'mypkg-variable-last))) |
| 64 | 66 | ||
| 65 | ;; Mailing List | 67 | ;; Reporter Users |
| 66 | ;; ============ | 68 | ;; ============== |
| 67 | ;; I've set up a Majordomo mailing list to report bugs or suggest | 69 | ;; Packages that currently use reporter are: CC Mode, supercite, elp, |
| 68 | ;; enhancements, etc. This list's intended audience is elisp package | ||
| 69 | ;; authors who are using reporter and want to stay current with | ||
| 70 | ;; releases. Here are the relevant addresses: | ||
| 71 | ;; | ||
| 72 | ;; Administrivia: reporter-request@python.org | ||
| 73 | ;; Submissions: reporter@python.org | ||
| 74 | |||
| 75 | ;; Packages that currently use reporter are: cc-mode, supercite, elp, | ||
| 76 | ;; tcl, ediff, crypt++ (crypt), dired-x, rmailgen, mode-line, vm, | 70 | ;; tcl, ediff, crypt++ (crypt), dired-x, rmailgen, mode-line, vm, |
| 77 | ;; mh-e, edebug, archie, viper, w3-mode, framepop, hl319, hilit19, | 71 | ;; mh-e, edebug, archie, viper, w3-mode, framepop, hl319, hilit19, |
| 78 | ;; pgp, eos, hm--html, efs. | 72 | ;; pgp, eos, hm--html, efs, webster19. |
| 79 | ;; | 73 | ;; |
| 80 | ;; If you know of others, please email me! | 74 | ;; If you know of others, please email me! |
| 81 | 75 | ||
| 82 | ;;; Code: | 76 | ;;; Code: |
| 83 | 77 | ||
| 78 | |||
| 84 | ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv | 79 | ;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv |
| 85 | ;; Package author interface variables | 80 | ;; Package author interface variables |
| 86 | 81 | ||
| @@ -119,7 +114,7 @@ This is necessary to properly support the printing of buffer-local | |||
| 119 | variables. Current buffer will always be the mail buffer being | 114 | variables. Current buffer will always be the mail buffer being |
| 120 | composed.") | 115 | composed.") |
| 121 | 116 | ||
| 122 | (defconst reporter-version "3.3" | 117 | (defconst reporter-version "3.34" |
| 123 | "Reporter version number.") | 118 | "Reporter version number.") |
| 124 | 119 | ||
| 125 | (defvar reporter-initial-text nil | 120 | (defvar reporter-initial-text nil |
| @@ -145,14 +140,21 @@ composed.") | |||
| 145 | (defun reporter-beautify-list (maxwidth compact-p) | 140 | (defun reporter-beautify-list (maxwidth compact-p) |
| 146 | ;; pretty print a list | 141 | ;; pretty print a list |
| 147 | (reporter-update-status) | 142 | (reporter-update-status) |
| 148 | (let (linebreak indent-enclosing-p indent-p here) | 143 | (let ((move t) |
| 144 | linebreak indent-enclosing-p indent-p here) | ||
| 149 | (condition-case nil ;loop exit | 145 | (condition-case nil ;loop exit |
| 150 | (progn | 146 | (progn |
| 151 | (down-list 1) | 147 | (down-list 1) |
| 152 | (setq indent-enclosing-p t) | 148 | (setq indent-enclosing-p t) |
| 153 | (while t | 149 | (while move |
| 154 | (setq here (point)) | 150 | (setq here (point)) |
| 155 | (forward-sexp 1) | 151 | ;; The following line is how we break out of the while |
| 152 | ;; loop, in one of two ways. Either we've hit the end of | ||
| 153 | ;; the buffer, in which case scan-sexps returns nil, or | ||
| 154 | ;; we've crossed unbalanced parens and it will raise an | ||
| 155 | ;; error we're expecting to catch. | ||
| 156 | (setq move (scan-sexps (point) 1)) | ||
| 157 | (goto-char move) | ||
| 156 | (if (<= maxwidth (current-column)) | 158 | (if (<= maxwidth (current-column)) |
| 157 | (if linebreak | 159 | (if linebreak |
| 158 | (progn | 160 | (progn |
| @@ -303,6 +305,12 @@ composed.") | |||
| 303 | (buffer-substring (match-beginning 0) (match-end 0)))) | 305 | (buffer-substring (match-beginning 0) (match-end 0)))) |
| 304 | 306 | ||
| 305 | 307 | ||
| 308 | ;; Serves as an interface to `mail' (sendmail.el), but when the user | ||
| 309 | ;; answers "no" to discarding an unsent message, it gives an error. | ||
| 310 | (defun reporter-mail (&rest args) | ||
| 311 | (or (apply 'mail args) | ||
| 312 | (error "Bug report aborted"))) | ||
| 313 | |||
| 306 | (defun reporter-compose-outgoing () | 314 | (defun reporter-compose-outgoing () |
| 307 | ;; compose the outgoing mail buffer, and return the selected | 315 | ;; compose the outgoing mail buffer, and return the selected |
| 308 | ;; paradigm, with the current-buffer tacked onto the beginning of | 316 | ;; paradigm, with the current-buffer tacked onto the beginning of |
| @@ -311,11 +319,11 @@ composed.") | |||
| 311 | (compose (get mail-user-agent 'composefunc))) | 319 | (compose (get mail-user-agent 'composefunc))) |
| 312 | ;; Sanity check. If this fails then we'll try to use the SENDMAIL | 320 | ;; Sanity check. If this fails then we'll try to use the SENDMAIL |
| 313 | ;; protocol, otherwise we must signal an error. | 321 | ;; protocol, otherwise we must signal an error. |
| 314 | (if (not (and compose (functionp compose))) | 322 | (if (not (and compose (fboundp compose))) |
| 315 | (progn | 323 | (progn |
| 316 | (setq agent 'sendmail-user-agent | 324 | (setq agent 'sendmail-user-agent |
| 317 | compose (get agent 'composefunc)) | 325 | compose (get agent 'composefunc)) |
| 318 | (if (not (and compose (functionp compose))) | 326 | (if (not (and compose (fboundp compose))) |
| 319 | (error "Could not find a valid `mail-user-agent'") | 327 | (error "Could not find a valid `mail-user-agent'") |
| 320 | (ding) | 328 | (ding) |
| 321 | (message "`%s' is an invalid `mail-user-agent'; using `sendmail-user-agent'" | 329 | (message "`%s' is an invalid `mail-user-agent'; using `sendmail-user-agent'" |
| @@ -360,7 +368,7 @@ composed.") | |||
| 360 | (pop-to-buffer mailbuf) | 368 | (pop-to-buffer mailbuf) |
| 361 | ;; Just in case the original buffer is not visible now, bring it | 369 | ;; Just in case the original buffer is not visible now, bring it |
| 362 | ;; back somewhere | 370 | ;; back somewhere |
| 363 | (display-buffer reporter-eval-buffer)) | 371 | (and pop-up-windows (display-buffer reporter-eval-buffer))) |
| 364 | (goto-char (point-min)) | 372 | (goto-char (point-min)) |
| 365 | ;; different mailers use different separators, some may not even | 373 | ;; different mailers use different separators, some may not even |
| 366 | ;; use mail-header-separator, but sendmail.el stuff must have this | 374 | ;; use mail-header-separator, but sendmail.el stuff must have this |
| @@ -430,7 +438,7 @@ composed.") | |||
| 430 | (length reporter-initial-text)) | 438 | (length reporter-initial-text)) |
| 431 | (string= (buffer-substring after-sep-pos (point)) | 439 | (string= (buffer-substring after-sep-pos (point)) |
| 432 | reporter-initial-text)) | 440 | reporter-initial-text)) |
| 433 | (error "Bug report was empty--not sent")) | 441 | (error "Empty bug report cannot be sent")) |
| 434 | ))) | 442 | ))) |
| 435 | 443 | ||
| 436 | 444 | ||