diff options
| author | Richard M. Stallman | 1993-06-26 11:59:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-26 11:59:44 +0000 |
| commit | 9ee9b53e02ec127bbe626b0950baff0669271afc (patch) | |
| tree | f2ee937ef42ab3c29f9608941667019311883c0f | |
| parent | 06ae9cf2a40cfc938f03dd21edd3348322fb6f4e (diff) | |
| download | emacs-9ee9b53e02ec127bbe626b0950baff0669271afc.tar.gz emacs-9ee9b53e02ec127bbe626b0950baff0669271afc.zip | |
entered into RCS
| -rw-r--r-- | lisp/mail/reporter.el | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el index aabae37e220..7b1959bed0f 100644 --- a/lisp/mail/reporter.el +++ b/lisp/mail/reporter.el | |||
| @@ -1,14 +1,11 @@ | |||
| 1 | ;;; reporter.el --- customizable bug reporting of lisp programs | 1 | ;;; reporter.el --- customizable bug reporting of lisp programs |
| 2 | ;; Copyright (C) 1993 Free Software Foundation, Inc. | ||
| 2 | 3 | ||
| 3 | ;; Author: 1993 Barry A. Warsaw, Century Computing Inc. <bwarsaw@cen.com> | 4 | ;; Author: 1993 Barry A. Warsaw, Century Computing Inc. <bwarsaw@cen.com> |
| 4 | ;; Maintainer: bwarsaw@cen.com | 5 | ;; Maintainer: bwarsaw@cen.com |
| 5 | ;; Created: 19-Apr-1993 | 6 | ;; Created: 19-Apr-1993 |
| 6 | ;; Version: 1.18 | ||
| 7 | ;; Last Modified: 1993/05/22 00:29:49 | ||
| 8 | ;; Keywords: bug reports lisp | 7 | ;; Keywords: bug reports lisp |
| 9 | 8 | ||
| 10 | ;; Copyright (C) 1993 Free Software Foundation, Inc. | ||
| 11 | |||
| 12 | ;; This file is not yet part of GNU Emacs. | 9 | ;; This file is not yet part of GNU Emacs. |
| 13 | ;; | 10 | ;; |
| 14 | ;; This program is free software; you can redistribute it and/or modify | 11 | ;; This program is free software; you can redistribute it and/or modify |
| @@ -81,10 +78,17 @@ | |||
| 81 | ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 78 | ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 82 | ;; end of user defined variables | 79 | ;; end of user defined variables |
| 83 | 80 | ||
| 81 | (defvar reporter-eval-buffer nil | ||
| 82 | "Buffer to retrieve variable's value from. | ||
| 83 | This is necessary to properly support the printing of buffer-local | ||
| 84 | variables. Current buffer will always be the mail buffer being | ||
| 85 | composed.") | ||
| 84 | 86 | ||
| 85 | (defun reporter-dump-variable (varsym) | 87 | (defun reporter-dump-variable (varsym) |
| 86 | "Pretty-print the value of the variable in symbol VARSYM." | 88 | "Pretty-print the value of the variable in symbol VARSYM." |
| 87 | (let ((val (eval varsym)) | 89 | (let ((val (save-excursion |
| 90 | (set-buffer reporter-eval-buffer) | ||
| 91 | (eval varsym))) | ||
| 88 | (sym (symbol-name varsym)) | 92 | (sym (symbol-name varsym)) |
| 89 | (print-escape-newlines t)) | 93 | (print-escape-newlines t)) |
| 90 | (insert " " sym " " | 94 | (insert " " sym " " |
| @@ -108,6 +112,13 @@ If a cons cell, the car must be a variable symbol and the cdr must be | |||
| 108 | a function which will be `funcall'd with the symbol. Use this to write | 112 | a function which will be `funcall'd with the symbol. Use this to write |
| 109 | your own custom variable value printers for specific variables. | 113 | your own custom variable value printers for specific variables. |
| 110 | 114 | ||
| 115 | Note that the global variable `reporter-eval-buffer' will be bound to | ||
| 116 | the buffer in which `reporter-submit-bug-report' was invoked. If you | ||
| 117 | want to print the value of a buffer local variable, you should wrap | ||
| 118 | the `eval' call in your custom printer inside a `set-buffer' (and | ||
| 119 | probably a `save-excursion'). `reporter-dump-variable' handles this | ||
| 120 | properly. | ||
| 121 | |||
| 111 | PRE-HOOKS is run after the emacs-version and PKGNAME are inserted, but | 122 | PRE-HOOKS is run after the emacs-version and PKGNAME are inserted, but |
| 112 | before the VARLIST is dumped. POST-HOOKS is run after the VARLIST is | 123 | before the VARLIST is dumped. POST-HOOKS is run after the VARLIST is |
| 113 | dumped." | 124 | dumped." |
| @@ -143,11 +154,11 @@ mail buffer, and point is left after the salutation. | |||
| 143 | 154 | ||
| 144 | The mailer used is described in the variable `reporter-mailer'." | 155 | The mailer used is described in the variable `reporter-mailer'." |
| 145 | 156 | ||
| 146 | (let ((curbuf (current-buffer)) | 157 | (let ((reporter-eval-buffer (current-buffer)) |
| 147 | (mailbuf (progn (call-interactively reporter-mailer) | 158 | (mailbuf (progn (call-interactively reporter-mailer) |
| 148 | (current-buffer)))) | 159 | (current-buffer)))) |
| 149 | (require 'sendmail) | 160 | (require 'sendmail) |
| 150 | (pop-to-buffer curbuf) | 161 | (pop-to-buffer reporter-eval-buffer) |
| 151 | (pop-to-buffer mailbuf) | 162 | (pop-to-buffer mailbuf) |
| 152 | (goto-char (point-min)) | 163 | (goto-char (point-min)) |
| 153 | ;; different mailers use different separators, some may not even | 164 | ;; different mailers use different separators, some may not even |