Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Improved histories and default values of TLS read functions

* tls/rudel-tls.el (rudel-tls-ask-connect-info-host-history): new
  variable; history of hosts read
  (rudel-tls-ask-connect-info-port-last): new variable; last prompt
  (rudel-ask-connect-info): use
  `rudel-tls-ask-connect-info-host-history' and
  `rudel-tls-ask-connect-info-port-last' to provide default inputs and
  histories for host and port reading
  • Loading branch information...
commit 9196ffb974979d7e945af21990cdd8ff069495fb 1 parent 7059b87
@scymtym authored
Showing with 19 additions and 2 deletions.
  1. +19 −2 tls/rudel-tls.el
21 tls/rudel-tls.el
@@ -261,14 +261,31 @@ support STARTTLS behavior.")
(unless rudel-tls-client-program
(error "Required program 'gnutls-cli' not available")))
+(defvar rudel-tls-ask-connect-info-host-history nil
+ "History of hosts read by TLS backend's `rudel-ask-connect-info'.")
+(defvar rudel-tls-ask-connect-info-port-last nil
+ "Last port read by TLS backend's `rudel-ask-connect-info'.")
(defmethod rudel-ask-connect-info ((this rudel-start-tls-backend)
&optional info)
"Augment INFO by read a hostname and a port number."
;; Read server host and port.
(let ((host (or (plist-get info :host)
- (read-string "Server: ")))
+ (read-string
+ (if (car rudel-tls-ask-connect-info-host-history)
+ (format
+ "Server (default %s): "
+ (car rudel-tls-ask-connect-info-host-history))
+ "Server: ")
+ nil
+ 'rudel-tls-ask-connect-info-host-history)))
(port (or (plist-get info :port)
- (read-number "Port: "))))
+ (setq
+ rudel-tls-ask-connect-info-port-last
+ (read-number
+ "Port: "
+ rudel-tls-ask-connect-info-port-last)))))
(append (list :host host
:port port)

0 comments on commit 9196ffb

Please sign in to comment.
Something went wrong with that request. Please try again.