summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGnus developers <ding@gnus.org>2011-09-20 22:14:36 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2011-09-20 22:14:36 +0000
commit5c7f66a032b769051b4ec0dad5e095548889fa75 (patch)
treecf4339d25f09dce5a95063ea549f9a1c3304d648
parent3820edebb4037162ddc7b4f6ccf528806185aedc (diff)
downloademacs-5c7f66a032b769051b4ec0dad5e095548889fa75.tar.gz
Merge changes made in Gnus trunk.
message.el (message-indent-citation): Fix empty line removal at the end of the citation. auth-source.el (auth-source-netrc-create): Use default value for password if specified. Evaluate default. (auth-source-plstore-create): Ditto. (auth-source-plstore-create, auth-source-netrc-create): Fix default value evaluation. (auth-source-netrc-create): Typo fix. (auth-source-plstore-create): Ditto.
-rw-r--r--lisp/gnus/ChangeLog13
-rw-r--r--lisp/gnus/auth-source.el107
-rw-r--r--lisp/gnus/message.el7
3 files changed, 66 insertions, 61 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 4838044b7ac..9d22d52e579 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,18 @@
+2011-09-20 Ɓukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> (tiny change)
+
+ * message.el (message-indent-citation): Fix empty line removal at the
+ end of the citation.
+
2011-09-20 Julien Danjou <julien@danjou.info>
+ * auth-source.el (auth-source-netrc-create): Use default value for
+ password if specified. Evaluate default.
+ (auth-source-plstore-create): Ditto.
+ (auth-source-plstore-create, auth-source-netrc-create): Fix default
+ value evaluation.
+ (auth-source-netrc-create): Typo fix.
+ (auth-source-plstore-create): Ditto.
+
* auth-source.el (auth-source-format-cache-entry): New function.
2011-09-20 Katsumi Yamaoka <yamaoka@jpl.org>
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index dc9c23131f1..4269b79a6a7 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -1225,49 +1225,46 @@ See `auth-source-search' for details on SPEC."
(?p ,(aget printable-defaults 'port))))))
;; Store the data, prompting for the password if needed.
- (setq data
- (cond
- ((and (null data) (eq r 'secret))
- ;; Special case prompt for passwords.
- ;; TODO: make the default (setq auth-source-netrc-use-gpg-tokens `((,(if (boundp 'epa-file-auto-mode-alist-entry) (car (symbol-value 'epa-file-auto-mode-alist-entry)) "\\.gpg\\'") nil) (t gpg)))
- ;; TODO: or maybe leave as (setq auth-source-netrc-use-gpg-tokens 'never)
- (let* ((ep (format "Use GPG password tokens in %s?" file))
- (gpg-encrypt
- (cond
- ((eq auth-source-netrc-use-gpg-tokens 'never)
- 'never)
- ((listp auth-source-netrc-use-gpg-tokens)
- (let ((check (copy-sequence
- auth-source-netrc-use-gpg-tokens))
- item ret)
- (while check
- (setq item (pop check))
- (when (or (eq (car item) t)
- (string-match (car item) file))
- (setq ret (cdr item))
- (setq check nil)))))
- (t 'never)))
- (plain (read-passwd prompt)))
- ;; ask if we don't know what to do (in which case
- ;; auth-source-netrc-use-gpg-tokens must be a list)
- (unless gpg-encrypt
- (setq gpg-encrypt (if (y-or-n-p ep) 'gpg 'never))
- ;; TODO: save the defcustom now? or ask?
- (setq auth-source-netrc-use-gpg-tokens
- (cons `(,file ,gpg-encrypt)
- auth-source-netrc-use-gpg-tokens)))
- (if (eq gpg-encrypt 'gpg)
- (auth-source-epa-make-gpg-token plain file)
- plain)))
- ((null data)
- (when default
- (setq prompt
- (if (string-match ": *\\'" prompt)
- (concat (substring prompt 0 (match-beginning 0))
- " (default " default "): ")
- (concat prompt "(default " default ") "))))
- (read-string prompt nil nil default))
- (t (or data default))))
+ (setq data (or data
+ (if (eq r 'secret)
+ ;; Special case prompt for passwords.
+ ;; TODO: make the default (setq auth-source-netrc-use-gpg-tokens `((,(if (boundp 'epa-file-auto-mode-alist-entry) (car (symbol-value 'epa-file-auto-mode-alist-entry)) "\\.gpg\\'") nil) (t gpg)))
+ ;; TODO: or maybe leave as (setq auth-source-netrc-use-gpg-tokens 'never)
+ (let* ((ep (format "Use GPG password tokens in %s?" file))
+ (gpg-encrypt
+ (cond
+ ((eq auth-source-netrc-use-gpg-tokens 'never)
+ 'never)
+ ((listp auth-source-netrc-use-gpg-tokens)
+ (let ((check (copy-sequence
+ auth-source-netrc-use-gpg-tokens))
+ item ret)
+ (while check
+ (setq item (pop check))
+ (when (or (eq (car item) t)
+ (string-match (car item) file))
+ (setq ret (cdr item))
+ (setq check nil)))))
+ (t 'never)))
+ (plain (or (eval default) (read-passwd prompt))))
+ ;; ask if we don't know what to do (in which case
+ ;; auth-source-netrc-use-gpg-tokens must be a list)
+ (unless gpg-encrypt
+ (setq gpg-encrypt (if (y-or-n-p ep) 'gpg 'never))
+ ;; TODO: save the defcustom now? or ask?
+ (setq auth-source-netrc-use-gpg-tokens
+ (cons `(,file ,gpg-encrypt)
+ auth-source-netrc-use-gpg-tokens)))
+ (if (eq gpg-encrypt 'gpg)
+ (auth-source-epa-make-gpg-token plain file)
+ plain))
+ (if (stringp default)
+ (read-string (if (string-match ": *\\'" prompt)
+ (concat (substring prompt 0 (match-beginning 0))
+ " (default " default "): ")
+ (concat prompt "(default " default ") "))
+ nil nil default)
+ (eval default)))))
(when data
(setq artificial (plist-put artificial
@@ -1671,20 +1668,16 @@ authentication tokens:
(?p ,(aget printable-defaults 'port))))))
;; Store the data, prompting for the password if needed.
- (setq data
- (cond
- ((and (null data) (eq r 'secret))
- ;; Special case prompt for passwords.
- (read-passwd prompt))
- ((null data)
- (when default
- (setq prompt
- (if (string-match ": *\\'" prompt)
- (concat (substring prompt 0 (match-beginning 0))
- " (default " default "): ")
- (concat prompt "(default " default ") "))))
- (read-string prompt nil nil default))
- (t (or data default))))
+ (setq data (or data
+ (if (eq r 'secret)
+ (or (eval default) (read-passwd prompt))
+ (if (stringp default)
+ (read-string (if (string-match ": *\\'" prompt)
+ (concat (substring prompt 0 (match-beginning 0))
+ " (default " default "): ")
+ (concat prompt "(default " default ") "))
+ nil nil default)
+ (eval default)))))
(when data
(if (member r base-secret)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 8dac0fd7afe..da91fcb7fd8 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -3679,10 +3679,9 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line."
(message-delete-line))
;; Delete blank lines at the end of the buffer.
(goto-char (point-max))
- (unless (eolp)
- (insert "\n"))
- (while (and (zerop (forward-line -1))
- (looking-at "$"))
+ (beginning-of-line)
+ (while (and (looking-at "$")
+ (zerop (forward-line -1)))
(message-delete-line)))
;; Do the indentation.
(if (null message-yank-prefix)