Commits

Anonymous committed ac7a1cd

packages: Make eshell-report-bug work and useful under XEmacs

-------------------- ChangeLog entries follow: --------------------

xemacs-packages/eshell/ChangeLog addition:

2004-06-28 Adrian Aichner <adrian@xemacs.org>

* eshell.el (eshell-report-bug): Only `set-buffer-multibyte', when
it's available (XEmacs does not have it). Report XEmacs
eshell-version. Correctly call `use-local-map' under XEmacs.

Comments (0)

Files changed (2)

+2004-06-28  Adrian Aichner  <adrian@xemacs.org>
+
+	* eshell.el (eshell-report-bug): Only `set-buffer-multibyte', when
+	it's available (XEmacs does not have it).  Report XEmacs
+	eshell-version.  Correctly call `use-local-map' under XEmacs.
+
 2003-10-31  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.06 released.
 ;;;###autoload
 (defun eshell-report-bug (topic)
   "Report a bug in Eshell.
-Prompts for the TOPIC.  Leaves you in a mail buffer.
+Prompts for the TOPIC.	Leaves you in a mail buffer.
 Please include any configuration details that might be involved."
   (interactive "sBug Subject: ")
   (compose-mail eshell-report-bug-address topic)
   (forward-line 1)
   (let ((signature (buffer-substring (point) (point-max))))
     ;; Discourage users from writing non-English text.
-    (set-buffer-multibyte nil)
+    ;; XEmacs change: We don't have `set-buffer-multibyte'.
+    (when (fboundp 'set-buffer-multibyte)
+      (set-buffer-multibyte nil))
     (delete-region (point) (point-max))
     (insert signature)
     (backward-char (length signature)))
   (insert "emacs-version: " (emacs-version))
+  ;; XEmacs change: We keep track of upstream author version.
+  ;; Pull in 'package-get, if it is available.
+  (condition-case nil
+      (require 'package-get)
+    (error nil))
+  (when (featurep 'package-get)
+    (insert "\neshell-version: "
+	    (package-get-info 'eshell 'author-version)))
   (insert "\n\nThere appears to be a bug in Eshell.\n\n"
 	  "Please describe exactly what actions "
 	  "triggered the bug and the precise\n"
 	  "symptoms of the bug:\n\n")
   ;; This is so the user has to type something in order to send
   ;; the report easily.
-  (use-local-map (nconc (make-sparse-keymap) (current-local-map))))
+  (if (featurep 'xemacs)
+      (use-local-map (let ((map (make-sparse-keymap)))
+		       (set-keymap-parents map (current-local-map))
+		       map))
+    (use-local-map (nconc (make-sparse-keymap) (current-local-map)))))
 
 ;;; Code: