[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master af8ec14cd7 1/4: Fix command substitution in emacsbug.el
From: |
Stefan Kangas |
Subject: |
master af8ec14cd7 1/4: Fix command substitution in emacsbug.el |
Date: |
Fri, 17 Jun 2022 10:42:09 -0400 (EDT) |
branch: master
commit af8ec14cd73888af462c8a67b5c1b0f613513a25
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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.
---
lisp/mail/emacsbug.el | 49 ++++++++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 21 deletions(-)
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index df2b7a7453..9d2e20ae04 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -1,7 +1,6 @@
;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list
-*- lexical-binding: t; -*-
-;; Copyright (C) 1985, 1994, 1997-1998, 2000-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
;; Author: K. Shane Hartman
;; Maintainer: emacs-devel@gnu.org
@@ -30,6 +29,9 @@
;; to complete the process. Alternatively, compose the bug report in
;; Emacs then paste it into your normal mail client.
+;; `M-x submit-emacs-patch' can be used to send a patch to the Emacs
+;; maintainers.
+
;;; Code:
(require 'sendmail)
@@ -348,10 +350,10 @@ usually do not have translators for other
languages.\n\n")))
;; This is so the user has to type something in order to send easily.
(use-local-map (nconc (make-sparse-keymap) (current-local-map)))
- (define-key (current-local-map) "\C-c\C-i" #'info-emacs-bug)
+ (keymap-set (current-local-map) "C-c C-i" #'info-emacs-bug)
(if can-insert-mail
- (define-key (current-local-map) "\C-c\M-i"
- #'report-emacs-bug-insert-to-mailer))
+ (keymap-set (current-local-map) "C-c M-i"
+ #'report-emacs-bug-insert-to-mailer))
(setq report-emacs-bug-send-command (get mail-user-agent 'sendfunc)
report-emacs-bug-send-hook (get mail-user-agent 'hookvar))
(if report-emacs-bug-send-command
@@ -360,20 +362,23 @@ usually do not have translators for other
languages.\n\n")))
(unless report-emacs-bug-no-explanations
(with-output-to-temp-buffer "*Bug Help*"
(princ "While in the mail buffer:\n\n")
- (if report-emacs-bug-send-command
- (princ (substitute-command-keys
- (format " Type \\[%s] to send the bug report.\n"
- report-emacs-bug-send-command))))
- (princ (substitute-command-keys
- " Type \\[kill-buffer] RET to cancel (don't send it).\n"))
- (if can-insert-mail
- (princ (substitute-command-keys
- " Type \\[report-emacs-bug-insert-to-mailer] to copy text
to your preferred mail program.\n")))
- (terpri)
- (princ (substitute-command-keys
- " Type \\[info-emacs-bug] to visit in Info the Emacs Manual
section
+ (let ((help
+ (substitute-command-keys
+ (format "%s%s%s%s"
+ (if report-emacs-bug-send-command
+ (format " Type \\[%s] to send the bug report.\n"
+ report-emacs-bug-send-command)
+ "")
+ " Type \\[kill-buffer] \\`RET' to cancel (don't send
it).\n"
+ (if can-insert-mail
+ " Type \\[report-emacs-bug-insert-to-mailer] to \
+copy text to your preferred mail program.\n"
+ "")
+ " Type \\[info-emacs-bug] to visit in Info the Emacs
Manual section
about when and how to write a bug report, and what
- information you should include to help fix the bug.")))
+ information you should include to help fix the bug."))))
+ (with-current-buffer "*Bug Help*"
+ (insert help))))
(shrink-window-if-larger-than-buffer (get-buffer-window "*Bug Help*")))
;; Make it less likely people will send empty messages.
(if report-emacs-bug-send-hook
@@ -501,9 +506,10 @@ Message buffer where you can explain more about the patch."
(erase-buffer)
(insert "Thank you for considering submitting a patch to the Emacs
project.\n\n"
"Please describe what the patch fixes (or, if it's a new feature,
what it\n"
- "implements) in the mail buffer below. When done, use the `C-c
C-c' command\n"
+ "implements) in the mail buffer below. When done, use the "
+ (substitute-command-keys
"\\<message-mode-map>\\[message-send-and-exit] command\n")
"to send the patch as an email to the Emacs issue tracker.\n\n"
- "If this is the first time you've submitted an Emacs patch,
please\n"
+ "If this is the first time you're submitting an Emacs patch,
please\n"
"read the ")
(insert-text-button
"CONTRIBUTE"
@@ -521,7 +527,8 @@ Message buffer where you can explain more about the patch."
(emacs-bug--system-description)
(mml-attach-file file "text/patch" nil "attachment")
(message-goto-body)
- (message "Write a description of the patch and use `C-c C-c' to send it")
+ (message "Write a description of the patch and use %s to send it"
+ (substitute-command-keys "\\[message-send-and-exit]"))
(add-hook 'message-send-hook
(lambda ()
(message-goto-body)