emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101627: auth-source.el (auth-source-


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101627: auth-source.el (auth-source-create): Query the user for whether to store the credentials.
Date: Sun, 26 Sep 2010 13:25:35 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101627
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Sun 2010-09-26 13:25:35 +0000
message:
  auth-source.el (auth-source-create): Query the user for whether to store the 
credentials.
  auth-source.el: Require netrc.
  nnml.el (nnml-open-nov): Don't return dead buffers.
  gnus-picon.el (gnus-picon-xbm): Removed obsolete face.
  gnus-picon.el (gnus-picon-insert-glyph): Make the background white.
  gnus-art.el (gnus-treatment-function-alist): Insert picons after doing the 
header highlightling.
modified:
  lisp/ChangeLog
  lisp/gnus/ChangeLog
  lisp/gnus/auth-source.el
  lisp/gnus/gnus-art.el
  lisp/gnus/gnus-picon.el
  lisp/gnus/nnml.el
  lisp/net/netrc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-09-26 06:06:28 +0000
+++ b/lisp/ChangeLog    2010-09-26 13:25:35 +0000
@@ -1,3 +1,7 @@
+2010-09-26  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * net/netrc.el (netrc-store-data): New function.
+
 2010-09-26  Teodor Zlatanov  <address@hidden>
 
        * net/gnutls.el: GnuTLS glue code to set up a connection.

=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2010-09-25 15:07:55 +0000
+++ b/lisp/gnus/ChangeLog       2010-09-26 13:25:35 +0000
@@ -1,4 +1,150 @@
-2010-09-25  Lars Magne Ingebrigtsen  <address@hidden>
+2010-09-26  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * gnus-art.el (gnus-treatment-function-alist): Insert picons after
+       doing the header highlightling, so that the background colour of the
+       picon is correct.
+
+       * gnus-picon.el (gnus-picon-xbm): Removed obsolete face.
+       (gnus-picon): Ditto.
+       (gnus-picon): Reinstate.  The background colour for picons is white.
+       (gnus-picon-insert-glyph): Make the background white.
+
+       * nnml.el (nnml-open-nov): Don't return dead buffers.
+
+       * auth-source.el (auth-source-create): Query the user for whether to
+       store the credentials.
+
+       * auth-source.el (auth-source-user-or-password): Use the existing auth
+       sources, if any, for creation.
+
+       * gnus.el (gnus-group-fast-parameter): Return the last matching
+       parameter instead of the first matching parameter.
+
+2010-09-26  Julien Danjou  <address@hidden>
+
+       * gnus-sum.el (gnus-auto-center-group): Transform into a defcustom.
+
+2010-09-26  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * mml2015.el (mml2015-use): Remove gpg support.
+
+       * mml1991.el (mml1991-function-alist): Remove gpg function.
+       (mml1991-gpg-sign): Removed.
+
+2010-09-26  Andreas Seltenreich  <address@hidden>
+
+       * gnus-srvr.el (gnus-browse-subscribe-newsgroup-method): New variable.
+       (gnus-browse-unsubscribe-current-group): Document it.
+       (gnus-browse-unsubscribe-group): Use it.
+
+2010-09-26  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * gnus-group.el (gnus-read-ephemeral-bug-group): Add the bug email
+       address to the To list for easier response.
+
+       * gnus.el (gnus-play-startup-jingle): Removed.
+       (gnus-splash): Don't play jingle.
+       (gnus): Silence gnus-load message.
+
+       * gnus-art.el (gnus-treat-play-sounds): Removed.
+
+       * gnus.el (gnus-play-jingle): Remove audio support.
+
+       * gnus-cus.el (gnus-score-customize): Remove audio reference.
+
+       * earcon.el: Removed -- no users.
+
+       * gnus-audio.el: Removed -- no users of this package.
+
+       * gnus-sum.el (gnus-summary-limit-children): Remove nocem support.
+
+       * gnus-start.el (gnus-setup-news): Remove nocem support.
+
+       * gnus-group.el (gnus-group-get-new-news): Removed nocem call.
+
+       * gnus.el (gnus-use-nocem): Removed.
+
+       * gnus-demon.el (gnus-demon-add-nocem, gnus-demon-scan-nocem):
+       Removed.
+
+       * gnus-nocem.el (gnus-nocem-issuers): Removed file.  Apparently nobody
+       uses NoCeM any more.
+
+       * gnus-art.el (gnus-ctan-url): Seems not very useful -- removed.
+       (gnus-button-ctan-handler): Ditto.
+       (gnus-button-handle-ctan-bogus-regexp): Ditto.
+       (gnus-button-ctan-directory-regexp): Ditto.
+       (gnus-button-handle-ctan): Ditto.
+       (gnus-button-tex-level): Ditto.
+       (gnus-button-alist): Removed CTAN stuff.
+
+2010-09-25  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * nnimap.el (nnimap-wait-for-response): Reversed logic in the
+       nnimap-streaming test.
+
+       * gnus-start.el (gnus-get-unread-articles): Don't try to open failed
+       servers twice.
+
+       * nnimap.el (nnimap-open-connection): Add more error reporting when
+       nnimap fails early.
+
+       * nnheader.el (nnheader-get-report-string): New function.
+       (nnheader-get-report): Use it.
+
+       * gnus-int.el (gnus-check-server): Say what the error was when opening
+       failed.
+
+       * nnimap.el (nnimap-wait-for-response): Search further when we're not
+       using streaming.
+
+2010-09-25  Julien Danjou  <address@hidden>
+
+       * gnus-html.el (gnus-html-rescale-image): Use our defalias
+       gnus-window-inside-pixel-edges.
+
+2010-09-25  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * gnus-srvr.el (gnus-server-copy-server): Add documentation.
+
+       * mm-decode.el (mm-save-part): Allow saving to other directories the
+       normal Emacs way.
+
+       * nndoc.el (nndoc-type-alist): Move mime-parts after mbox.  Suggested
+       by Jay Berkenbilt.
+
+       * gnus-art.el (gnus-mime-delete-part): Fix plural for "byte" when
+       there isn't a single byte.
+
+       * gnus-int.el (gnus-open-server): Don't query whether to go offline --
+       just do it.  It doesn't really seem to matter what the user responds
+       here, I think, so it's just a confusing question.
+
+       * nnimap.el (nnimap-retrieve-group-data-early): Fix typo in the
+       non-streaming case.
+
+       * gnus-art.el (gnus-flush-original-article-buffer): Separated out.
+       (gnus-article-encrypt-body): Use it.
+
+       * gnus-sum.el (gnus-summary-show-complete-article): New command and
+       keystroke.
+
+       * nnimap.el (nnimap-find-wanted-parts-1): Use
+       gnus-fetch-partial-articles.
+
+       * gnus-art.el (gnus-fetch-partial-articles): New variable.
+
+       * nnimap.el (nnimap-insert-partial-structure): New function.
+       (nnimap-get-partial-article): New function.
+       (nnimap-request-article): Use it.
+       (nnimap-wait-for-response): Return whether the wait was successful.
+       (nnimap-finish-retrieve-group-infos): Don't do anything if the
+       retrieval wasn't successful.
+       (nnimap-retrieve-group-data-early): Allow throttling servers.
+       (nnimap-streaming): New variable.
+       (nnimap-fetch-partial-articles): Removed.
+
+       * mm-decode.el (mm-with-part): Protect against killed buffers.
 
        * nndraft.el (nndraft-retrieve-headers): Insert Lines and Chars headers
        for prettier summary display.
@@ -209,7 +355,6 @@
 
 2010-09-23  Teodor Zlatanov  <address@hidden>
 
-       * netrc.el (netrc-parse): Remove encrypt.el mentions.
        * encrypt.el: Removed.
 
 2010-09-23  Lars Magne Ingebrigtsen  <address@hidden>

=== modified file 'lisp/gnus/auth-source.el'
--- a/lisp/gnus/auth-source.el  2010-09-26 12:47:09 +0000
+++ b/lisp/gnus/auth-source.el  2010-09-26 13:25:35 +0000
@@ -32,9 +32,9 @@
 ;;; Code:
 
 (require 'gnus-util)
+(require 'netrc)
 
 (eval-when-compile (require 'cl))
-(autoload 'netrc-machine-user-or-password "netrc")
 (autoload 'secrets-create-item "secrets")
 (autoload 'secrets-delete-item "secrets")
 (autoload 'secrets-get-alias "secrets")
@@ -312,25 +312,41 @@
     (setq result
          (mapcar
           (lambda (m)
-            (cond
-             ((equal "password" m)
-              (let ((passwd (read-passwd
-                             (format "Password for %s on %s: " prot host))))
-                (cond
-                 ;; Secret Service API.
-                 ((consp source)
-                  (apply
-                   'secrets-create-item
-                   (auth-get-source entry) name passwd spec))
-                 (t)) ;; netrc not implemented yes.
-                passwd))
-             ((equal "login" m)
-              (or user
-                  (read-string (format "User name for %s on %s: " prot host))))
-             (t
-              "unknownuser")))
+            (cons
+             m
+             (cond
+              ((equal "password" m)
+               (let ((passwd (read-passwd
+                              (format "Password for %s on %s: " prot host))))
+                 (cond
+                  ;; Secret Service API.
+                  ((consp source)
+                   (apply
+                    'secrets-create-item
+                    (auth-get-source entry) name passwd spec))
+                  (t)) ;; netrc not implemented yes.
+                 passwd))
+              ((equal "login" m)
+               (or user
+                   (read-string (format "User name for %s on %s: " prot 
host))))
+              (t
+               "unknownuser"))))
           (if (consp mode) mode (list mode))))
-    (if (consp mode) result (car result))))
+    ;; Allow the source to save the data.
+    (cond
+     ((consp source)
+      ;; Secret Service API -- not implemented.
+      )
+     (t
+      ;; netrc interface.
+      (when (y-or-n-p (format "Do you want to save this password in %s? "
+                             source))
+       (netrc-store-data source host prot
+                         (or user (cdr (assoc "login" result)))
+                         (cdr (assoc "password" result))))))
+    (if (consp mode)
+       (mapcar #'cdr result)
+      (cdar result))))
 
 (defun auth-source-delete (entry &rest spec)
   "Delete credentials according to SPEC in ENTRY."

=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el     2010-09-26 04:03:19 +0000
+++ b/lisp/gnus/gnus-art.el     2010-09-26 13:25:35 +0000
@@ -1692,13 +1692,13 @@
     (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers)
     (gnus-treat-leading-whitespace gnus-article-remove-leading-whitespace)
     (gnus-treat-strip-pem gnus-article-hide-pem)
+    (gnus-treat-from-gravatar gnus-treat-from-gravatar)
+    (gnus-treat-mail-gravatar gnus-treat-mail-gravatar)
+    (gnus-treat-highlight-headers gnus-article-highlight-headers)
+    (gnus-treat-highlight-signature gnus-article-highlight-signature)
     (gnus-treat-from-picon gnus-treat-from-picon)
     (gnus-treat-mail-picon gnus-treat-mail-picon)
     (gnus-treat-newsgroups-picon gnus-treat-newsgroups-picon)
-    (gnus-treat-from-gravatar gnus-treat-from-gravatar)
-    (gnus-treat-mail-gravatar gnus-treat-mail-gravatar)
-    (gnus-treat-highlight-headers gnus-article-highlight-headers)
-    (gnus-treat-highlight-signature gnus-article-highlight-signature)
     (gnus-treat-strip-trailing-blank-lines
      gnus-article-remove-trailing-blank-lines)
     (gnus-treat-strip-leading-blank-lines

=== modified file 'lisp/gnus/gnus-picon.el'
--- a/lisp/gnus/gnus-picon.el   2010-09-25 13:28:07 +0000
+++ b/lisp/gnus/gnus-picon.el   2010-09-26 13:25:35 +0000
@@ -85,19 +85,9 @@
                 (const right))
   :group 'gnus-picon)
 
-(defface gnus-picon-xbm '((t (:foreground "black" :background "white")))
-  "Face to show xbm picon in."
-  :group 'gnus-picon)
-;; backward-compatibility alias
-(put 'gnus-picon-xbm-face 'face-alias 'gnus-picon-xbm)
-(put 'gnus-picon-xbm-face 'obsolete-face "22.1")
-
 (defface gnus-picon '((t (:foreground "black" :background "white")))
   "Face to show picon in."
   :group 'gnus-picon)
-;; backward-compatibility alias
-(put 'gnus-picon-face 'face-alias 'gnus-picon)
-(put 'gnus-picon-face 'obsolete-face "22.1")
 
 ;;; Internal variables:
 
@@ -161,7 +151,9 @@
       (insert glyph)
     (gnus-add-wash-type category)
     (gnus-add-image category (car glyph))
-    (gnus-put-image (car glyph) (unless nostring (cdr glyph)) category)))
+    (let ((start (point)))
+      (gnus-put-image (car glyph) (unless nostring (cdr glyph)) category)
+      (put-text-property start (point) 'face 'gnus-picon))))
 
 (defun gnus-picon-create-glyph (file)
   (or (cdr (assoc file gnus-picon-glyph-alist))

=== modified file 'lisp/gnus/nnml.el'
--- a/lisp/gnus/nnml.el 2010-09-23 23:14:02 +0000
+++ b/lisp/gnus/nnml.el 2010-09-26 13:25:35 +0000
@@ -846,7 +846,9 @@
     buffer))
 
 (defun nnml-open-nov (group)
-  (or (cdr (assoc group nnml-nov-buffer-alist))
+  (or (let ((buffer (cdr (assoc group nnml-nov-buffer-alist))))
+       (and (buffer-name buffer)
+            buffer))
       (let ((buffer (nnml-get-nov-buffer group)))
        (push (cons group buffer) nnml-nov-buffer-alist)
        buffer)))

=== modified file 'lisp/net/netrc.el'
--- a/lisp/net/netrc.el 2010-09-23 03:57:10 +0000
+++ b/lisp/net/netrc.el 2010-09-26 13:25:35 +0000
@@ -220,6 +220,17 @@
                          (eq type (car (cddr service)))))))
     (cadr service)))
 
+(defun netrc-store-data (file host port user password)
+  (with-temp-buffer
+    (when (file-exists-p file)
+      (insert-file-contents file))
+    (goto-char (point-max))
+    (unless (bolp)
+      (insert "\n"))
+    (insert (format "machine %s login %s password %s port %s\n"
+                   host user password port))
+    (write-region (point-min) (point-max) file nil 'silent)))
+
 ;;;###autoload
 (defun netrc-credentials (machine &rest ports)
   "Return a user name/password pair.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]