# HG changeset patch # User Richard M. Stallman # Date 741095984 0 # Node ID a1a2b1ee2554217aab32f469509dcbe5b138f92e # Parent 717f2e24975e0f2a1d57ead5407738ae84baa564 entered into RCS diff -r 717f2e24975e -r a1a2b1ee2554 lisp/mail/reporter.el --- a/lisp/mail/reporter.el Sat Jun 26 04:20:42 1993 +0000 +++ b/lisp/mail/reporter.el Sat Jun 26 11:59:44 1993 +0000 @@ -1,14 +1,11 @@ ;;; reporter.el --- customizable bug reporting of lisp programs +;; Copyright (C) 1993 Free Software Foundation, Inc. ;; Author: 1993 Barry A. Warsaw, Century Computing Inc. ;; Maintainer: bwarsaw@cen.com ;; Created: 19-Apr-1993 -;; Version: 1.18 -;; Last Modified: 1993/05/22 00:29:49 ;; Keywords: bug reports lisp -;; Copyright (C) 1993 Free Software Foundation, Inc. - ;; This file is not yet part of GNU Emacs. ;; ;; This program is free software; you can redistribute it and/or modify @@ -81,10 +78,17 @@ ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ;; end of user defined variables +(defvar reporter-eval-buffer nil + "Buffer to retrieve variable's value from. +This is necessary to properly support the printing of buffer-local +variables. Current buffer will always be the mail buffer being +composed.") (defun reporter-dump-variable (varsym) "Pretty-print the value of the variable in symbol VARSYM." - (let ((val (eval varsym)) + (let ((val (save-excursion + (set-buffer reporter-eval-buffer) + (eval varsym))) (sym (symbol-name varsym)) (print-escape-newlines t)) (insert " " sym " " @@ -108,6 +112,13 @@ a function which will be `funcall'd with the symbol. Use this to write your own custom variable value printers for specific variables. +Note that the global variable `reporter-eval-buffer' will be bound to +the buffer in which `reporter-submit-bug-report' was invoked. If you +want to print the value of a buffer local variable, you should wrap +the `eval' call in your custom printer inside a `set-buffer' (and +probably a `save-excursion'). `reporter-dump-variable' handles this +properly. + PRE-HOOKS is run after the emacs-version and PKGNAME are inserted, but before the VARLIST is dumped. POST-HOOKS is run after the VARLIST is dumped." @@ -143,11 +154,11 @@ The mailer used is described in the variable `reporter-mailer'." - (let ((curbuf (current-buffer)) + (let ((reporter-eval-buffer (current-buffer)) (mailbuf (progn (call-interactively reporter-mailer) (current-buffer)))) (require 'sendmail) - (pop-to-buffer curbuf) + (pop-to-buffer reporter-eval-buffer) (pop-to-buffer mailbuf) (goto-char (point-min)) ;; different mailers use different separators, some may not even