From: Lars Ingebrigtsen Date: Mon, 21 Feb 2011 23:58:25 +0000 (-0800) Subject: (auth-source-netrc-parse): Accept a number as the port spec, too. X-Git-Url: https://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=d7925de009d5e3047e07e52657d7312d9f97979c (auth-source-netrc-parse): Accept a number as the port spec, too. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b890befc..ef81f60fd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-02-21 Lars Ingebrigtsen + * auth-source.el (auth-source-netrc-parse): Accept a number as the port + spec, too. + (auth-source-ensure-strings): New function. + * gnus-art.el (gnus-article-update-date-headers): Doc fix. (gnus-article-setup-buffer): Always restart the date timer so that user changes to the frequency is respected. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 3fe31b588..d53ffe657 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -690,6 +690,15 @@ while \(:host t) would find all host entries." ;;; Backend specific parsing: netrc/authinfo backend +(defun auth-source-ensure-strings (values) + (unless (listp values) + (setq values (list values))) + (mapcar (lambda (value) + (if (numberp value) + (format "%s" value) + port)) + values)) + (defvar auth-source-netrc-cache nil) ;;; (auth-source-netrc-parse "~/.authinfo.gpg") @@ -703,6 +712,7 @@ Note that the MAX parameter is used so we can exit the parse early." ;; We got already parsed contents; just return it. file (when (file-exists-p file) + (setq port (auth-source-ensure-strings port)) (with-temp-buffer (let ((tokens '("machine" "host" "default" "login" "user" "password" "account" "macdef" "force"