unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Incomplete Gnus<->Emacs sync
@ 2009-02-04 18:52 Reiner Steib
  0 siblings, 0 replies; only message in thread
From: Reiner Steib @ 2009-02-04 18:52 UTC (permalink / raw)
  To: Miles Bader; +Cc: ding, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

Hi Miles,

I saw that the recent imap.el changes didn't make it into 23.0.90.
Could you please sync?

There are also other diffs, see attachment.  If something is unclear,
please ask.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-vs-Emacs-2009-02-04-a.diff --]
[-- Type: text/x-diff, Size: 13515 bytes --]

--- gnus/plain/trunk/gnus/lisp/auth-source.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/gnus/auth-source.el	2009-02-04 09:49:58.000000000 +0100
@@ -163,20 +163,12 @@
   (interactive "slogin/password: \nsHost: \nsProtocol: \n") ;for testing
   (remhash (format "%s %s:%s" mode host protocol) auth-source-cache))
 
-(defun auth-source-forget-all-cached ()
-  "Forget all cached auth-source authentication tokens."
-  (interactive)
-  (setq auth-source-cache (make-hash-table :test 'equal)))
-
 (defun auth-source-user-or-password (mode host protocol)
-  "Find MODE (string or list of strings) matching HOST and PROTOCOL.
-MODE can be \"login\" or \"password\" for example."
+  "Find user or password (from the string MODE) matching HOST and PROTOCOL."
   (gnus-message 9
 		"auth-source-user-or-password: get %s for %s (%s)"
 		mode host protocol)
-  (let* ((listy (listp mode))
-	 (mode (if listy mode (list mode)))
-	 (cname (format "%s %s:%s" mode host protocol))
+  (let* ((cname (format "%s %s:%s" mode host protocol))
 	 (found (gethash cname auth-source-cache)))
     (if found
 	(progn
@@ -184,7 +176,7 @@
 			"auth-source-user-or-password: cached %s=%s for %s (%s)"
 			mode
 			;; don't show the password
-			(if (member "password" mode) "SECRET" found)
+			(if (equal mode "password") "SECRET" found)
 			host protocol)
 	  found)
       (dolist (choice (auth-source-pick host protocol))
@@ -199,9 +191,8 @@
 			"auth-source-user-or-password: found %s=%s for %s (%s)"
 			mode
 			;; don't show the password
-			(if (member "password" mode) "SECRET" found)
+			(if (equal mode "password") "SECRET" found)
 			host protocol)
-	  (setq found (if listy found (car-safe found)))
 	  (when auth-source-do-cache
 	    (puthash cname found auth-source-cache)))
 	(return found)))))
--- gnus/plain/trunk/gnus/lisp/netrc.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/net/netrc.el	2009-01-09 09:53:06.000000000 +0100
@@ -158,22 +158,11 @@
 	(ports (or ports '(nil)))
 	(defaults (or defaults '(nil)))
 	info)
-    (if (listp mode)
-	(setq info 
-	      (mapcar 
-	       (lambda (mode-element) 
-		 (netrc-machine-user-or-password
-		  mode-element
-		  authinfo-list
-		  machines
-		  ports
-		  defaults))
-	       mode))
-      (dolist (machine machines)
-	(dolist (default defaults)
-	  (dolist (port ports)
-	    (let ((alist (netrc-machine authinfo-list machine port default)))
-	      (setq info (or (netrc-get alist mode) info)))))))
+    (dolist (machine machines)
+      (dolist (default defaults)
+	(dolist (port ports)
+	  (let ((alist (netrc-machine authinfo-list machine port default)))
+	    (setq info (or (netrc-get alist mode) info))))))
     info))
 
 (defun netrc-get (alist type)
--- gnus/plain/trunk/gnus/lisp/nnimap.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/gnus/nnimap.el	2009-01-09 09:53:04.000000000 +0100
@@ -616,9 +616,9 @@
 	(setq uid imap-current-message
 	      mbx imap-current-mailbox
 	      headers (if (imap-capability 'IMAP4rev1)
-			   ;; xxx don't just use car? alist doesn't contain
-			   ;; anything else now, but it might...
-			   (nth 2 (car (imap-message-get uid 'BODYDETAIL)))
+                          ;; xxx don't just use car? alist doesn't contain
+                          ;; anything else now, but it might...
+                          (nth 2 (car (imap-message-get uid 'BODYDETAIL)))
                         (imap-message-get uid 'RFC822.HEADER))
 	      lines (imap-body-lines (imap-message-body imap-current-message))
 	      chars (imap-message-get imap-current-message 'RFC822.SIZE)))
@@ -805,12 +805,8 @@
  	   (port (if nnimap-server-port
  		     (int-to-string nnimap-server-port)
  		   "imap"))
-	   (auth-info 
-	    (auth-source-user-or-password '("login" "password") server port))
-	   (auth-user (nth 0 auth-info))
-	   (auth-passwd (nth 1 auth-info))
 	   (user (or
-		  auth-user ; this is preferred to netrc-*
+		  (auth-source-user-or-password "login" server port) ; this is preferred to netrc-*
 		  (netrc-machine-user-or-password
 		   "login"
 		   list
@@ -820,7 +816,7 @@
 		   (list port)
 		   (list "imap" "imaps" "143" "993"))))
 	   (passwd (or
-		    auth-passwd ; this is preferred to netrc-*
+		    (auth-source-user-or-password "password" server port) ; this is preferred to netrc-*
 		    (netrc-machine-user-or-password
 		     "password"
 		     list
Not in Emacs: dgnushack.el
--- gnus/plain/trunk/gnus/lisp/imap.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/net/imap.el	2009-01-09 09:53:06.000000000 +0100
@@ -1798,38 +1798,25 @@
 of the UIDS specification, and the cdr is the one which works with
 Exchange 2007 or, potentially, other buggy servers.
 See `imap-enable-exchange-bug-workaround'."
-  ;; The first time we get here for a given, we'll try the canonical
-  ;; form.  If we get the known error from the buggy server, set the
-  ;; flag buffer-locally (to account for connections to multiple
-  ;; servers), then re-try with the alternative UIDS spec.  We don't
-  ;; unconditionally use the alternative form, since the
-  ;; currently-used alternatives are seriously inefficient with some
-  ;; servers (although they are valid).
-  ;;
-  ;; FIXME:  Maybe it would be cleaner to have a flag to not signal
-  ;; the error (which otherwise gives a message), and test
-  ;; `imap-failed-tags'.  Also, Other IMAP clients use other forms of
-  ;; request which work with Exchange, e.g. Claws does "UID FETCH 1:*
-  ;; (UID)" rather than "FETCH UID 1,*".  Is there a good reason not
-  ;; to do the same?
+  ;; We don't unconditionally use the alternative (valid) form, since
+  ;; this is said to be significantly inefficient.  The first time we
+  ;; get here for a given, we'll try the canonical form.  If we get
+  ;; the known error from the buggy server, set the flag
+  ;; buffer-locally (to account for connections to multiple servers),
+  ;; then re-try with the alternative UIDS spec.
   (condition-case data
-      ;; Binding `debug-on-error' allows us to get the error from
-      ;; `imap-parse-response' -- it's normally caught by Emacs around
-      ;; execution of a process filter.
-      (let ((debug-on-error t))
-	(imap-fetch (if imap-enable-exchange-bug-workaround
-			(cdr uids)
-		      (car uids))
-		    props receive nouidfetch buffer))
+      (imap-fetch (if imap-enable-exchange-bug-workaround
+		      (cdr uids)
+		    (car uids))
+		  props receive nouidfetch buffer)
     (error
      (if (and (not imap-enable-exchange-bug-workaround)
-	      ;; This is the Exchange 2007 response.  It may be more
-	      ;; robust just to check for a BAD response to the
-	      ;; attempted fetch.
-	      (string-match "The specified message set is invalid"
-			    (cadr data)))
+	      (string-match
+	       "The specified message set is invalid"
+	       (cadr data)))
 	 (with-current-buffer (or buffer (current-buffer))
-	   (set (make-local-variable 'imap-enable-exchange-bug-workaround)
+	   (set (make-local-variable
+		 'imap-enable-exchange-bug-workaround)
 		t)
 	   (imap-fetch (cdr uids) props receive nouidfetch))
        (signal (car data) (cdr data))))))
@@ -3040,7 +3027,6 @@
 	  imap-list-to-message-set
 	  imap-fetch-asynch
 	  imap-fetch
-	  imap-fetch-safe
 	  imap-message-put
 	  imap-message-get
 	  imap-message-map
Not in Emacs: nnheaderxm.el
Not in Emacs: messagexmas.el
Not in Emacs: smime-ldap.el
--- gnus/plain/trunk/gnus/lisp/gnus-sum.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/gnus/gnus-sum.el	2009-02-04 09:49:58.000000000 +0100
@@ -7625,7 +7625,9 @@
    (t
     (unless (gnus-ephemeral-group-p gnus-newsgroup-name)
       (gnus-summary-jump-to-group gnus-newsgroup-name))
-    (let ((cmd last-command-char)
+    (let ((cmd (if (featurep 'xemacs)
+		   last-command-char
+		 last-command-event))
 	  (point
 	   (with-current-buffer gnus-group-buffer
 	     (point)))
Not in Emacs: assistant.el
Not in Emacs: lpath.el
--- gnus/plain/trunk/gnus/lisp/time-date.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/calendar/time-date.el	2009-01-09 09:53:00.000000000 +0100
@@ -236,7 +236,7 @@
 	 (month (nth 4 tim))
 	 (day (nth 3 tim))
 	 (year (nth 5 tim)))
-    (+ (time-to-day-in-year time)	;	Days this year
+    (+ (time-to-day-in-year time)	; 	Days this year
        (* 365 (1- year))		;	+ Days in prior years
        (/ (1- year) 4)			;	+ Julian leap years
        (- (/ (1- year) 100))		;	- century years
Not in Emacs: encrypt.el
--- gnus/plain/trunk/gnus/lisp/mail-source.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/gnus/mail-source.el	2009-01-09 09:53:02.000000000 +0100
@@ -453,11 +453,10 @@
 (put 'mail-source-bind 'lisp-indent-function 1)
 (put 'mail-source-bind 'edebug-form-spec '(sexp body))
 
-;; TODO: use the list format for auth-source-user-or-password modes
 (defun mail-source-set-1 (source)
   (let* ((type (pop source))
 	 (defaults (cdr (assq type mail-source-keyword-map)))
-	 default value keyword auth-info user-auth pass-auth)
+	 default value keyword user-auth pass-auth)
     (while (setq default (pop defaults))
       ;; for each default :SYMBOL, set SYMBOL to the plist value for :SYMBOL
       ;; using `mail-source-value' to evaluate the plist value
@@ -470,21 +469,20 @@
 	    ((and
 	     (eq keyword :user)
 	     (setq user-auth 
-		   (nth 0 (auth-source-user-or-password
-			   '("login" "password")
-			   ;; this is "host" in auth-sources
-			   (if (boundp 'server) (symbol-value 'server) "")
-			   type))))
+		   (auth-source-user-or-password
+		    "login"
+		    ;; this is "host" in auth-sources
+		    (if (boundp 'server) (symbol-value 'server) "")
+		    type)))
 	     user-auth)
 	    ((and
-	      (eq keyword :password)
-	      (setq pass-auth
-		    (nth 1
-			 (auth-source-user-or-password
-			  '("login" "password")
-			  ;; this is "host" in auth-sources
-			  (if (boundp 'server) (symbol-value 'server) "")
-			  type))))
+	     (eq keyword :password)
+	     (setq pass-auth 
+		   (auth-source-user-or-password
+		    "password"
+		    ;; this is "host" in auth-sources
+		    (if (boundp 'server) (symbol-value 'server) "")
+		    type)))
 	     pass-auth)
 	    (t (if (setq value (plist-get source keyword))
 		 (mail-source-value value)
--- gnus/plain/trunk/gnus/lisp/nntp.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/gnus/nntp.el	2009-01-09 09:53:04.000000000 +0100
@@ -1179,18 +1179,14 @@
   (let* ((list (netrc-parse nntp-authinfo-file))
 	 (alist (netrc-machine list nntp-address "nntp"))
 	 (force (or (netrc-get alist "force") nntp-authinfo-force))
-	 (auth-info 
-	  (auth-source-user-or-password '("login" "password") nntp-address "nntp"))
-	 (auth-user (nth 0 auth-info))
-	 (auth-passwd (nth 1 auth-info))
 	 (user (or
 		;; this is preferred to netrc-*
-		auth-user
+		(auth-source-user-or-password "login" nntp-address "nntp")
 		(netrc-get alist "login")
 		nntp-authinfo-user))
 	 (passwd (or
 		  ;; this is preferred to netrc-*
-		  auth-passwd
+		  (auth-source-user-or-password "password" nntp-address "nntp")
 		  (netrc-get alist "password"))))
     (when (or (not send-if-force)
 	      force)
--- gnus/plain/trunk/gnus/lisp/dns-mode.el	2009-02-04 19:19:18.000000000 +0100
+++ emacs/trunk/emacs/lisp/textmodes/dns-mode.el	2009-01-09 09:53:08.000000000 +0100
@@ -49,7 +49,7 @@
 
 (defgroup dns-mode nil
   "DNS master file mode configuration."
-  :group 'comm)
+  :group 'data)
 
 (defconst dns-mode-classes '("IN" "CS" "CH" "HS")
   "List of strings with known DNS classes.")
@@ -89,6 +89,18 @@
   :type 'sexp
   :group 'dns-mode)
 
+(defcustom dns-mode-soa-auto-increment-serial t
+  "Whether to increment the SOA serial number automatically.
+
+If this variable is t, the serial number is incremented upon each save of
+the file.  If it is `ask', Emacs asks for confirmation whether it should
+increment the serial upon saving.  If nil, serials must be incremented
+manually with \\[dns-mode-soa-increment-serial]."
+  :type '(choice (const :tag "Always" t)
+		 (const :tag "Ask" ask)
+		 (const :tag "Never" nil))
+  :group 'dns-mode)
+
 ;; Syntax table.
 
 (defvar dns-mode-syntax-table
@@ -134,8 +146,12 @@
   (unless (featurep 'xemacs)
     (set (make-local-variable 'font-lock-defaults)
 	 '(dns-mode-font-lock-keywords nil nil ((?_ . "w")))))
+  (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial
+	    nil t)
   (easy-menu-add dns-mode-menu dns-mode-map))
 
+;;;###autoload (defalias 'zone-mode 'dns-mode)
+
 ;; Tools.
 
 ;;;###autoload
@@ -191,6 +207,21 @@
 	      (message "Replaced old serial %s with %s" serial new))
 	  (error "Cannot locate serial number in SOA record"))))))
 
+(defun dns-mode-soa-maybe-increment-serial ()
+  "Increment SOA serial if needed.
+
+This function is run from `before-save-hook'."
+  (when (and (buffer-modified-p)
+	     dns-mode-soa-auto-increment-serial
+	     (or (eq dns-mode-soa-auto-increment-serial t)
+		 (y-or-n-p "Increment SOA serial? ")))
+    ;; If `dns-mode-soa-increment-serial' signals an error saving will
+    ;; fail but that probably means that the serial should be fixed to
+    ;; comply with the RFC anyway! -rfr
+    (progn (dns-mode-soa-increment-serial)
+	   ;; We return nil in case this is used in write-contents-functions.
+	   nil)))
+
 ;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode))
 
 (provide 'dns-mode)
Not in Emacs: gnus-xmas.el

Local variables:
default-directory: "~/src/Emacsen/"
End:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-04 18:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-04 18:52 Incomplete Gnus<->Emacs sync Reiner Steib

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).