diff options
| author | Glenn Morris | 2010-12-09 19:39:18 -0800 |
|---|---|---|
| committer | Glenn Morris | 2010-12-09 19:39:18 -0800 |
| commit | e554b3f832056ebc65e98c1c2ae44e06bd660068 (patch) | |
| tree | d45e6f9eaa1fcdf33fb76e879114f6af496c6f4c | |
| parent | ab540f5976d1eb02751c766946ee64e5bbccadd9 (diff) | |
| download | emacs-e554b3f832056ebc65e98c1c2ae44e06bd660068.tar.gz emacs-e554b3f832056ebc65e98c1c2ae44e06bd660068.zip | |
Small emacsbug.el stuff.
* lisp/mail/emacsbug.el (report-emacs-bug): Use mail-user-agent properties.
(report-emacs-bug-create-existing-bugs-buffer): Avoid free variables.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/mail/emacsbug.el | 36 |
2 files changed, 17 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f41e96d371a..32060096aa7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2010-12-10 Glenn Morris <rgm@gnu.org> | 1 | 2010-12-10 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * mail/emacsbug.el (report-emacs-bug): Use mail-user-agent properties. | ||
| 4 | (report-emacs-bug-create-existing-bugs-buffer): Avoid free variables. | ||
| 5 | |||
| 3 | * comint.el (comint-input-ring-file-name): Doc fix. | 6 | * comint.el (comint-input-ring-file-name): Doc fix. |
| 4 | 7 | ||
| 5 | 2010-12-09 Eli Zaretskii <eliz@gnu.org> | 8 | 2010-12-09 Eli Zaretskii <eliz@gnu.org> |
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 40a5c081cfd..e6da4746041 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el | |||
| @@ -279,22 +279,11 @@ usually do not have translators to read other languages for them.\n\n") | |||
| 279 | (if can-xdg-email | 279 | (if can-xdg-email |
| 280 | (define-key (current-local-map) "\C-cm" | 280 | (define-key (current-local-map) "\C-cm" |
| 281 | 'report-emacs-bug-insert-to-mailer)) | 281 | 'report-emacs-bug-insert-to-mailer)) |
| 282 | ;; Could test major-mode instead. | 282 | (setq report-emacs-bug-send-command (get mail-user-agent 'sendfunc) |
| 283 | (cond ((memq mail-user-agent '(message-user-agent gnus-user-agent)) | 283 | report-emacs-bug-send-hook (get mail-user-agent 'hookvar)) |
| 284 | (setq report-emacs-bug-send-command "message-send-and-exit" | 284 | (if report-emacs-bug-send-command |
| 285 | report-emacs-bug-send-hook 'message-send-hook)) | 285 | (setq report-emacs-bug-send-command |
| 286 | ((eq mail-user-agent 'sendmail-user-agent) | 286 | (symbol-name report-emacs-bug-send-command))) |
| 287 | (setq report-emacs-bug-send-command "mail-send-and-exit" | ||
| 288 | report-emacs-bug-send-hook 'mail-send-hook)) | ||
| 289 | ((eq mail-user-agent 'mh-e-user-agent) | ||
| 290 | (setq report-emacs-bug-send-command "mh-send-letter" | ||
| 291 | report-emacs-bug-send-hook 'mh-before-send-letter-hook)) | ||
| 292 | ((eq mail-user-agent 'vm-user-agent) | ||
| 293 | (setq report-emacs-bug-send-command "vm-mail-send-and-exit" | ||
| 294 | report-emacs-bug-send-hook 'vm-mail-send-hook)) | ||
| 295 | ((eq mail-user-agent 'wl-user-agent) | ||
| 296 | (setq report-emacs-bug-send-command "wl-draft-send-and-exit" | ||
| 297 | report-emacs-bug-send-hook 'wl-draft-send-hook))) | ||
| 298 | (unless report-emacs-bug-no-explanations | 287 | (unless report-emacs-bug-no-explanations |
| 299 | (with-output-to-temp-buffer "*Bug Help*" | 288 | (with-output-to-temp-buffer "*Bug Help*" |
| 300 | (princ "While in the mail buffer:\n\n") | 289 | (princ "While in the mail buffer:\n\n") |
| @@ -386,19 +375,22 @@ and send the mail again%s." | |||
| 386 | 375 | ||
| 387 | ;; Querying the bug database | 376 | ;; Querying the bug database |
| 388 | 377 | ||
| 378 | (defvar report-emacs-bug-bug-alist nil) | ||
| 379 | (make-variable-buffer-local 'report-emacs-bug-bug-alist) | ||
| 380 | (defvar report-emacs-bug-choice-widget nil) | ||
| 381 | (make-variable-buffer-local 'report-emacs-bug-choice-widget) | ||
| 382 | |||
| 389 | (defun report-emacs-bug-create-existing-bugs-buffer (bugs keywords) | 383 | (defun report-emacs-bug-create-existing-bugs-buffer (bugs keywords) |
| 390 | (switch-to-buffer (get-buffer-create "*Existing Emacs Bugs*")) | 384 | (switch-to-buffer (get-buffer-create "*Existing Emacs Bugs*")) |
| 391 | (setq buffer-read-only t) | 385 | (setq buffer-read-only t) |
| 392 | (let ((inhibit-read-only t)) | 386 | (let ((inhibit-read-only t)) |
| 393 | (erase-buffer) | 387 | (erase-buffer) |
| 394 | (make-local-variable 'bug-alist) | 388 | (setq report-emacs-bug-bug-alist bugs) |
| 395 | (setq bug-alist bugs) | ||
| 396 | (make-local-variable 'bug-choice-widget) | ||
| 397 | (widget-insert (propertize (concat "Already known bugs (" | 389 | (widget-insert (propertize (concat "Already known bugs (" |
| 398 | keywords "):\n\n") | 390 | keywords "):\n\n") |
| 399 | 'face 'bold)) | 391 | 'face 'bold)) |
| 400 | (if bugs | 392 | (if bugs |
| 401 | (setq bug-choice-widget | 393 | (setq report-emacs-bug-choice-widget |
| 402 | (apply 'widget-create 'radio-button-choice | 394 | (apply 'widget-create 'radio-button-choice |
| 403 | :value (caar bugs) | 395 | :value (caar bugs) |
| 404 | (let (items) | 396 | (let (items) |
| @@ -423,10 +415,10 @@ and send the mail again%s." | |||
| 423 | (widget-insert " ") | 415 | (widget-insert " ") |
| 424 | (widget-create 'push-button | 416 | (widget-create 'push-button |
| 425 | :notify (lambda (&rest ignore) | 417 | :notify (lambda (&rest ignore) |
| 426 | (let ((val (widget-value bug-choice-widget))) | 418 | (let ((val (widget-value report-emacs-bug-choice-widget))) |
| 427 | ;; TODO: Do something! | 419 | ;; TODO: Do something! |
| 428 | (message "Appending to bug %s!" | 420 | (message "Appending to bug %s!" |
| 429 | (nth 2 (assoc val bug-alist))))) | 421 | (nth 2 (assoc val report-emacs-bug-bug-alist))))) |
| 430 | "Append to chosen bug")) | 422 | "Append to chosen bug")) |
| 431 | (widget-insert " ") | 423 | (widget-insert " ") |
| 432 | (widget-create 'push-button | 424 | (widget-create 'push-button |