diff -c emacsbug.el emacsbug-patched-2012-12-11.el
*** emacsbug.el	Tue Dec 11 11:41:54 2012
--- emacsbug-patched-2012-12-11.el	Tue Dec 11 11:53:46 2012
***************
*** 58,63 ****
--- 58,81 ----
    :group 'emacsbug
    :type 'boolean)
  
+ (defcustom report-emacs-bug-included-fields '(version settings major-mode
+                                               minor-modes recent-input
+                                               recent-messages load-shadows
+                                               features)
+   "Fields to include by default for command `report-emacs-bug'.
+ The fields are included automatically in the buffer where you edit
+ your bug report."
+   :type '(set
+           (const :tag "Emacs version info" version)
+           (const :tag "Important settings" settings)
+           (const :tag "Major mode"         major-mode)
+           (const :tag "Minor modes"        minor-modes)
+           (const :tag "Recent input"       recent-input)
+           (const :tag "Recent messages"    recent-messages)
+           (const :tag "Load-path shadows"  load-shadows)
+           (const :tag "Features"           features))
+   :group 'convenience)
+ 
  ;; User options end here.
  
  (defvar report-emacs-bug-orig-text nil
***************
*** 229,323 ****
      (let ((txt (delete-and-extract-region (1+ user-point) (point))))
        (insert (propertize "\n" 'display txt)))
  
!     (insert "\n\nIn " (emacs-version) "\n")
!     (if (stringp emacs-bzr-version)
! 	(insert "Bzr revision: " emacs-bzr-version "\n"))
!     (if (fboundp 'x-server-vendor)
! 	(condition-case nil
!             ;; This is used not only for X11 but also W32 and others.
! 	    (insert "Windowing system distributor `" (x-server-vendor)
!                     "', version "
! 		    (mapconcat 'number-to-string (x-server-version) ".") "\n")
! 	  (error t)))
!     (let ((lsb (with-temp-buffer
! 		 (if (eq 0 (ignore-errors
! 			     (call-process "lsb_release" nil '(t nil)
! 					   nil "-d")))
! 		     (buffer-string)))))
!       (if (stringp lsb)
! 	  (insert "System " lsb "\n")))
!     (when (and system-configuration-options
! 	       (not (equal system-configuration-options "")))
!       (insert "Configured using:\n `configure "
! 	      system-configuration-options "'\n\n")
!       (fill-region (line-beginning-position -1) (point)))
!     (insert "Important settings:\n")
!     (mapc
!      (lambda (var)
!        (let ((val (getenv var)))
! 	 (if val (insert (format "  value of $%s: %s\n" var val)))))
!      '("EMACSDATA" "EMACSDOC" "EMACSLOADPATH" "EMACSPATH"
!        "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES"
!        "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LANG" "XMODIFIERS"))
!     (insert (format "  locale-coding-system: %s\n" locale-coding-system))
!     (insert (format "  default enable-multibyte-characters: %s\n"
! 		    (default-value 'enable-multibyte-characters)))
!     (insert "\n")
!     (insert (format "Major mode: %s\n"
! 		    (format-mode-line
!                      (buffer-local-value 'mode-name from-buffer)
!                      nil nil from-buffer)))
!     (insert "\n")
!     (insert "Minor modes in effect:\n")
!     (dolist (mode minor-mode-list)
!       (and (boundp mode) (buffer-local-value mode from-buffer)
! 	   (insert (format "  %s: %s\n" mode
! 			   (buffer-local-value mode from-buffer)))))
!     (insert "\n")
!     (insert "Recent input:\n")
!     (let ((before-keys (point)))
!       (insert (mapconcat (lambda (key)
! 			   (if (or (integerp key)
! 				   (symbolp key)
! 				   (listp key))
! 			       (single-key-description key)
! 			     (prin1-to-string key nil)))
! 			 (or recent-keys (recent-keys))
! 			 " "))
!       (save-restriction
! 	(narrow-to-region before-keys (point))
! 	(goto-char before-keys)
! 	(while (progn (move-to-column 50) (not (eobp)))
! 	  (search-forward " " nil t)
! 	  (insert "\n"))))
!     (let ((message-buf (get-buffer "*Messages*")))
!       (if message-buf
! 	  (let (beg-pos
! 		(end-pos message-end-point))
! 	    (with-current-buffer message-buf
! 	      (goto-char end-pos)
! 	      (forward-line -10)
! 	      (setq beg-pos (point)))
! 	    (insert "\n\nRecent messages:\n")
! 	    (insert-buffer-substring message-buf beg-pos end-pos))))
!     ;; After Recent messages, to avoid the messages produced by
!     ;; list-load-path-shadows.
!     (unless (looking-back "\n")
        (insert "\n"))
!     (insert "\n")
!     (insert "Load-path shadows:\n")
!     (let* ((msg "Checking for load-path shadows...")
! 	   (result "done")
! 	   (shadows (progn (message "%s" msg)
! 			   (condition-case nil (list-load-path-shadows t)
! 			     (error
! 			      (setq result "error")
! 			      "Error during checking")))))
!       (message "%s%s" msg result)
!       (insert (if (zerop (length shadows))
!                   "None found.\n"
!                 shadows)))
!     (insert (format "\nFeatures:\n%s\n" features))
      (fill-region (line-beginning-position 0) (point))
      ;; This is so the user has to type something in order to send easily.
      (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
--- 247,349 ----
      (let ((txt (delete-and-extract-region (1+ user-point) (point))))
        (insert (propertize "\n" 'display txt)))
  
!     (when (member 'version report-emacs-bug-included-fields)
!       (insert "\n\nIn " (emacs-version) "\n")
!       (if (stringp emacs-bzr-version)
!           (insert "Bzr revision: " emacs-bzr-version "\n"))
!       (if (fboundp 'x-server-vendor)
!           (condition-case nil
!               ;; This is used not only for X11 but also W32 and others.
!               (insert "Windowing system distributor `" (x-server-vendor)
!                       "', version "
!                       (mapconcat 'number-to-string (x-server-version) ".") "\n")
!             (error t)))
!       (let ((lsb (with-temp-buffer
!                    (if (eq 0 (ignore-errors
!                                (call-process "lsb_release" nil '(t nil)
!                                              nil "-d")))
!                        (buffer-string)))))
!         (if (stringp lsb)
!             (insert "System " lsb "\n")))
!       (when (and system-configuration-options
!                  (not (equal system-configuration-options "")))
!         (insert "Configured using:\n `configure "
!                 system-configuration-options "'\n\n")
!         (fill-region (line-beginning-position -1) (point))))
!     (when (member 'settings report-emacs-bug-included-fields)
!       (insert "Important settings:\n")
!       (mapc
!        (lambda (var)
!          (let ((val (getenv var)))
!            (if val (insert (format "  value of $%s: %s\n" var val)))))
!        '("EMACSDATA" "EMACSDOC" "EMACSLOADPATH" "EMACSPATH"
!          "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES"
!          "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LANG" "XMODIFIERS"))
!       (insert (format "  locale-coding-system: %s\n" locale-coding-system))
!       (insert (format "  default enable-multibyte-characters: %s\n"
!                       (default-value 'enable-multibyte-characters)))
!       (insert "\n"))
!     (when (member 'major-mode report-emacs-bug-included-fields)
!       (insert (format "Major mode: %s\n"
!                       (format-mode-line
!                        (buffer-local-value 'mode-name from-buffer)
!                        nil nil from-buffer)))
!       (insert "\n"))
!     (when (member 'minor-modes report-emacs-bug-included-fields)
!       (insert "Minor modes in effect:\n")
!       (dolist (mode minor-mode-list)
!         (and (boundp mode) (buffer-local-value mode from-buffer)
!              (insert (format "  %s: %s\n" mode
!                              (buffer-local-value mode from-buffer)))))
!       (insert "\n"))
!     (when (member 'recent-input report-emacs-bug-included-fields)
!       (insert "Recent input:\n")
!       (let ((before-keys (point)))
!         (insert (mapconcat (lambda (key)
!                              (if (or (integerp key)
!                                      (symbolp key)
!                                      (listp key))
!                                  (single-key-description key)
!                                (prin1-to-string key nil)))
!                            (or recent-keys (recent-keys))
!                            " "))
!         (save-restriction
!           (narrow-to-region before-keys (point))
!           (goto-char before-keys)
!           (while (progn (move-to-column 50) (not (eobp)))
!             (search-forward " " nil t)
!             (insert "\n")))))
!     (when (member 'recent-messages report-emacs-bug-included-fields)
!       (let ((message-buf (get-buffer "*Messages*")))
!         (if message-buf
!             (let (beg-pos
!                   (end-pos message-end-point))
!               (with-current-buffer message-buf
!                 (goto-char end-pos)
!                 (forward-line -10)
!                 (setq beg-pos (point)))
!               (insert "\n\nRecent messages:\n")
!               (insert-buffer-substring message-buf beg-pos end-pos))))
!       ;; After Recent messages, to avoid the messages produced by
!       ;; list-load-path-shadows.
!       (unless (looking-back "\n")
!         (insert "\n"))
        (insert "\n"))
!     (when (member 'load-shadows report-emacs-bug-included-fields)
!       (insert "Load-path shadows:\n")
!       (let* ((msg "Checking for load-path shadows...")
!              (result "done")
!              (shadows (progn (message "%s" msg)
!                              (condition-case nil (list-load-path-shadows t)
!                                (error
!                                 (setq result "error")
!                                 "Error during checking")))))
!         (message "%s%s" msg result)
!         (insert (if (zerop (length shadows))
!                     "None found.\n"
!                   shadows))))
!     (when (member 'features report-emacs-bug-included-fields)
!       (insert (format "\nFeatures:\n%s\n" features)))
      (fill-region (line-beginning-position 0) (point))
      ;; This is so the user has to type something in order to send easily.
      (use-local-map (nconc (make-sparse-keymap) (current-local-map)))

Diff finished.  Tue Dec 11 11:54:47 2012
