GNU bug report logs - #25874
24.4; sendmail-query-user-about-smtp allows nil function

Previous Next

Package: emacs;

Reported by: hackerb9 <at> member.fsf.org

Date: Sat, 25 Feb 2017 18:50:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 24.4

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #10 received at control <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: hackerb9 <at> member.fsf.org
Cc: 25874 <at> debbugs.gnu.org
Subject: Re: bug#25874: 24.4;
 sendmail-query-user-about-smtp allows nil function
Date: Sun, 26 Feb 2017 22:26:11 -0500
[Message part 1 (text/plain, inline)]
tags 25874 patch
quit

hackerb9 <at> member.fsf.org writes:

> 3. Emacs will prompt "Send mail via: "
>
>    (This is sendmail.el:sendmail-query-user-about-smtp asking how you
>    would like to send mail. Valid responses are: "mail client",
>    "transport", or "smtp")
>
> 4. Hit the Enter key, assuming Emacs will pick a reasonable default
>
> 5. Be surprised when you get a mysterious error message:

How about making Emacs give a reasonable default then:

[v1-0001-Set-default-when-asking-for-send-mail-function-Bu.patch (text/x-diff, inline)]
From 449169796a4a14abc4ff34aa78c5308b53ee20a3 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Sun, 26 Feb 2017 22:17:28 -0500
Subject: [PATCH v1] Set default when asking for send-mail-function
 (Bug#25874).

* lisp/mail/sendmail.el (sendmail-query-user-about-smtp): Pass first
option as default for `completing-read'.
---
 lisp/mail/sendmail.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 70c8ea1f93..42b688fbab 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -555,8 +555,9 @@ sendmail-query-user-about-smtp
 	    (goto-char (point-min))
 	    (display-buffer (current-buffer))
 	    (let ((completion-ignore-case t))
-	      (completing-read "Send mail via: "
-			       options nil 'require-match)))))
+              (completing-read
+               (format "Send mail via (default %s): " (caar options))
+               options nil 'require-match nil nil (car options))))))
     (customize-save-variable 'send-mail-function
 			     (cdr (assoc-string choice options t)))))
 
-- 
2.11.1


This bug report was last modified 8 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.