aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-06-17 15:54:29 +0200
committerStefan Kangas2022-06-17 16:30:51 +0200
commitaf8ec14cd73888af462c8a67b5c1b0f613513a25 (patch)
tree69d3c9c8e3e119a2455709bf0215339d7588c0fa
parent488a4cd61be621ad489bd91c221b0df2d0114203 (diff)
downloademacs-af8ec14cd73888af462c8a67b5c1b0f613513a25.tar.gz
emacs-af8ec14cd73888af462c8a67b5c1b0f613513a25.zip
Fix command substitution in emacsbug.el
* lisp/mail/emacsbug.el: Minor doc fix. (submit-emacs-patch, report-emacs-bug): Fix command substitution. Prefer keymap-set to define-key.
-rw-r--r--lisp/mail/emacsbug.el49
1 files changed, 28 insertions, 21 deletions
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index df2b7a7453b..9d2e20ae04b 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -1,7 +1,6 @@
1;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list -*- lexical-binding: t; -*- 1;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 1985, 1994, 1997-1998, 2000-2022 Free Software 3;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
4;; Foundation, Inc.
5 4
6;; Author: K. Shane Hartman 5;; Author: K. Shane Hartman
7;; Maintainer: emacs-devel@gnu.org 6;; Maintainer: emacs-devel@gnu.org
@@ -30,6 +29,9 @@
30;; to complete the process. Alternatively, compose the bug report in 29;; to complete the process. Alternatively, compose the bug report in
31;; Emacs then paste it into your normal mail client. 30;; Emacs then paste it into your normal mail client.
32 31
32;; `M-x submit-emacs-patch' can be used to send a patch to the Emacs
33;; maintainers.
34
33;;; Code: 35;;; Code:
34 36
35(require 'sendmail) 37(require 'sendmail)
@@ -348,10 +350,10 @@ usually do not have translators for other languages.\n\n")))
348 350
349 ;; This is so the user has to type something in order to send easily. 351 ;; This is so the user has to type something in order to send easily.
350 (use-local-map (nconc (make-sparse-keymap) (current-local-map))) 352 (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
351 (define-key (current-local-map) "\C-c\C-i" #'info-emacs-bug) 353 (keymap-set (current-local-map) "C-c C-i" #'info-emacs-bug)
352 (if can-insert-mail 354 (if can-insert-mail
353 (define-key (current-local-map) "\C-c\M-i" 355 (keymap-set (current-local-map) "C-c M-i"
354 #'report-emacs-bug-insert-to-mailer)) 356 #'report-emacs-bug-insert-to-mailer))
355 (setq report-emacs-bug-send-command (get mail-user-agent 'sendfunc) 357 (setq report-emacs-bug-send-command (get mail-user-agent 'sendfunc)
356 report-emacs-bug-send-hook (get mail-user-agent 'hookvar)) 358 report-emacs-bug-send-hook (get mail-user-agent 'hookvar))
357 (if report-emacs-bug-send-command 359 (if report-emacs-bug-send-command
@@ -360,20 +362,23 @@ usually do not have translators for other languages.\n\n")))
360 (unless report-emacs-bug-no-explanations 362 (unless report-emacs-bug-no-explanations
361 (with-output-to-temp-buffer "*Bug Help*" 363 (with-output-to-temp-buffer "*Bug Help*"
362 (princ "While in the mail buffer:\n\n") 364 (princ "While in the mail buffer:\n\n")
363 (if report-emacs-bug-send-command 365 (let ((help
364 (princ (substitute-command-keys 366 (substitute-command-keys
365 (format " Type \\[%s] to send the bug report.\n" 367 (format "%s%s%s%s"
366 report-emacs-bug-send-command)))) 368 (if report-emacs-bug-send-command
367 (princ (substitute-command-keys 369 (format " Type \\[%s] to send the bug report.\n"
368 " Type \\[kill-buffer] RET to cancel (don't send it).\n")) 370 report-emacs-bug-send-command)
369 (if can-insert-mail 371 "")
370 (princ (substitute-command-keys 372 " Type \\[kill-buffer] \\`RET' to cancel (don't send it).\n"
371 " Type \\[report-emacs-bug-insert-to-mailer] to copy text to your preferred mail program.\n"))) 373 (if can-insert-mail
372 (terpri) 374 " Type \\[report-emacs-bug-insert-to-mailer] to \
373 (princ (substitute-command-keys 375copy text to your preferred mail program.\n"
374 " Type \\[info-emacs-bug] to visit in Info the Emacs Manual section 376 "")
377 " Type \\[info-emacs-bug] to visit in Info the Emacs Manual section
375 about when and how to write a bug report, and what 378 about when and how to write a bug report, and what
376 information you should include to help fix the bug."))) 379 information you should include to help fix the bug."))))
380 (with-current-buffer "*Bug Help*"
381 (insert help))))
377 (shrink-window-if-larger-than-buffer (get-buffer-window "*Bug Help*"))) 382 (shrink-window-if-larger-than-buffer (get-buffer-window "*Bug Help*")))
378 ;; Make it less likely people will send empty messages. 383 ;; Make it less likely people will send empty messages.
379 (if report-emacs-bug-send-hook 384 (if report-emacs-bug-send-hook
@@ -501,9 +506,10 @@ Message buffer where you can explain more about the patch."
501 (erase-buffer) 506 (erase-buffer)
502 (insert "Thank you for considering submitting a patch to the Emacs project.\n\n" 507 (insert "Thank you for considering submitting a patch to the Emacs project.\n\n"
503 "Please describe what the patch fixes (or, if it's a new feature, what it\n" 508 "Please describe what the patch fixes (or, if it's a new feature, what it\n"
504 "implements) in the mail buffer below. When done, use the `C-c C-c' command\n" 509 "implements) in the mail buffer below. When done, use the "
510 (substitute-command-keys "\\<message-mode-map>\\[message-send-and-exit] command\n")
505 "to send the patch as an email to the Emacs issue tracker.\n\n" 511 "to send the patch as an email to the Emacs issue tracker.\n\n"
506 "If this is the first time you've submitted an Emacs patch, please\n" 512 "If this is the first time you're submitting an Emacs patch, please\n"
507 "read the ") 513 "read the ")
508 (insert-text-button 514 (insert-text-button
509 "CONTRIBUTE" 515 "CONTRIBUTE"
@@ -521,7 +527,8 @@ Message buffer where you can explain more about the patch."
521 (emacs-bug--system-description) 527 (emacs-bug--system-description)
522 (mml-attach-file file "text/patch" nil "attachment") 528 (mml-attach-file file "text/patch" nil "attachment")
523 (message-goto-body) 529 (message-goto-body)
524 (message "Write a description of the patch and use `C-c C-c' to send it") 530 (message "Write a description of the patch and use %s to send it"
531 (substitute-command-keys "\\[message-send-and-exit]"))
525 (add-hook 'message-send-hook 532 (add-hook 'message-send-hook
526 (lambda () 533 (lambda ()
527 (message-goto-body) 534 (message-goto-body)