]> git.eshelyaron.com Git - emacs.git/commitdiff
(report-emacs-bug-text-prompt): Delete var.
authorThien-Thi Nguyen <ttn@gnuvola.org>
Tue, 10 Jan 2006 13:01:48 +0000 (13:01 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Tue, 10 Jan 2006 13:01:48 +0000 (13:01 +0000)
(report-emacs-bug): Don't record initial prompt text.
Instead, add text properties to prompting text.
(report-emacs-bug-hook): Delete prompting text.

lisp/ChangeLog
lisp/mail/emacsbug.el

index 9a5c8f672b8a5a5d6b381ac6dd43b66bc3086ed9..6a5a89ce61dc0c3035b98731338cc3e18537ad0c 100644 (file)
@@ -1,3 +1,10 @@
+2006-01-10  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       * mail/emacsbug.el (report-emacs-bug-text-prompt): Delete var.
+       (report-emacs-bug): Don't record initial prompt text.
+       Instead, add text properties to prompting text.
+       (report-emacs-bug-hook): Delete prompting text.
+
 2006-01-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/flymake.el (flymake-find-buildfile): Remove invariant arg
index fc3494dde5f1af9d20b2e7153e1185f7392df383..47b7f1c3a1be2881e55132e01ee0068f8a326076 100644 (file)
@@ -56,9 +56,6 @@
 (defvar report-emacs-bug-orig-text nil
   "The automatically-created initial text of bug report.")
 
-(defvar report-emacs-bug-text-prompt nil
-  "The automatically-created initial prompt of bug report.")
-
 (defcustom report-emacs-bug-no-confirmation nil
   "*If non-nil, suppress the confirmations asked for the sake of novice users."
   :group 'emacsbug
@@ -83,7 +80,11 @@ Prompts for bug subject.  Leaves you in a mail buffer."
        (reporting-address (if pretest-p
                               report-emacs-bug-pretest-address
                             report-emacs-bug-address))
-       user-point prompt-beg-point message-end-point)
+        ;; Put these properties on semantically-void text.
+        (prompt-properties '(field emacsbug-prompt
+                                   intangible but-helpful
+                                   rear-nonsticky t))
+       user-point message-end-point)
     (setq message-end-point
          (with-current-buffer (get-buffer-create "*Messages*")
            (point-max-marker)))
@@ -98,7 +99,6 @@ Prompts for bug subject.  Leaves you in a mail buffer."
       (delete-region (point) (point-max))
       (insert signature)
       (backward-char (length signature)))
-    (setq prompt-beg-point (point))
     (unless report-emacs-bug-no-explanations
       ;; Insert warnings for novice users.
       (when (string-match "@gnu\\.org^" reporting-address)
@@ -119,11 +119,10 @@ usually do not have translators to read other languages for them.\n\n")
        (insert ",\nand to the gnu.emacs.bug news group.\n\n")))
 
     (insert "Please describe exactly what actions triggered the bug\n"
-           "and the precise symptoms of the bug:")
-    (setq report-emacs-bug-text-prompt
-         (buffer-substring prompt-beg-point (point)))
+           "and the precise symptoms of the bug:\n\n")
+    (add-text-properties (point) (save-excursion (mail-text) (point))
+                         prompt-properties)
 
-    (insert "\n\n")
     (setq user-point (point))
     (insert "\n\n")
 
@@ -135,6 +134,7 @@ usually do not have translators to read other languages for them.\n\n")
       (if (file-readable-p debug-file)
        (insert "If you would like to further debug the crash, please read the file\n"
                debug-file " for instructions.\n")))
+    (add-text-properties (1+ user-point) (point) prompt-properties)
 
     (insert "\n\nIn " (emacs-version) "\n")
     (if (fboundp 'x-server-vendor)
@@ -274,8 +274,10 @@ and send the mail again using \\[mail-send-and-exit].")))
 
     ;; Unclutter
     (mail-text)
-    (if (looking-at report-emacs-bug-text-prompt)
-       (replace-match "Symptoms:"))))
+    (let ((pos (1- (point))))
+      (while (setq pos (text-property-any pos (point-max)
+                                          'field 'emacsbug-prompt))
+        (delete-region pos (field-end (1+ pos)))))))
 
 (provide 'emacsbug)