From d5e9a4e9a76d5cd3aa03a7cc8a6c2ab405bb9ca5 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 14 Feb 2011 04:23:59 +0000 Subject: [PATCH] nnimap.el (nnimap-inhibit-logging): New variable. (nnimap-log-command): Don't log login commands. auth-source.el (auth-source-netrc-search): The asserts seem to want to have more parameters. nnimap.el (nnimap-send-command): Mark the command time for each command, so that we don't get NOOPs stepping on our toes. gnus-art.el (article-date-ut): Get the date from the Date header on `t'. --- lisp/gnus/ChangeLog | 14 ++++++++++++++ lisp/gnus/auth-source.el | 4 ++-- lisp/gnus/gnus-art.el | 4 ++++ lisp/gnus/nnimap.el | 14 ++++++++++---- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index f156198a8e0..9dd336a1f09 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,17 @@ +2011-02-14 Lars Ingebrigtsen + + * nnimap.el (nnimap-inhibit-logging): New variable. + (nnimap-log-command): Don't log login commands. + + * auth-source.el (auth-source-netrc-search): The asserts seem to want + to have more parameters. + + * nnimap.el (nnimap-send-command): Mark the command time for each + command, so that we don't get NOOPs stepping on our toes. + + * gnus-art.el (article-date-ut): Get the date from the Date header on + `t'. + 2011-02-14 Katsumi Yamaoka * auth-source.el (auth-source-search): Use copy-sequence instead of diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index de6926248ab..8f4a6ddc7b4 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -483,7 +483,7 @@ must call it to obtain the actual value." (assert (or (eq t create) (listp create)) t - "Invalid auth-source :create parameter (must be nil, t, or a list)") + "Invalid auth-source :create parameter (must be nil, t, or a list): %s %s") (setq filtered-backends (copy-sequence backends)) (dolist (backend backends) @@ -779,7 +779,7 @@ Note that the MAX parameter is used so we can exit the parse early." See `auth-source-search' for details on SPEC." ;; just in case, check that the type is correct (null or same as the backend) (assert (or (null type) (eq type (oref backend type))) - t "Invalid netrc search") + t "Invalid netrc search: %s %s") (let ((results (auth-source-netrc-normalize (auth-source-netrc-parse diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index d7c0d7a7250..3e1630804f7 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -3404,6 +3404,7 @@ possible values." (inhibit-read-only t) (inhibit-point-motion-hooks t) (first t) + (visible-date (mail-fetch-field "Date")) pos date bface eface) (save-excursion (save-restriction @@ -3427,6 +3428,9 @@ possible values." (delete-region (point-at-bol) (progn (gnus-article-forward-header) (point)))) + (when (and (not date) + visible-date) + (setq date visible-date)) (when date (article-transform-date date type bface eface))))))) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index be3f8125192..a5a001f7e11 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -142,6 +142,8 @@ textual parts.") (defvar nnimap-quirks '(("QRESYNC" "Zimbra" "QRESYNC "))) +(defvar nnimap-inhibit-logging nil) + (defun nnimap-buffer () (nnimap-find-process-buffer nntp-server-buffer)) @@ -389,8 +391,9 @@ textual parts.") nnimap-address) ports t)))) (setq nnimap-object nil) - (setq login-result - (nnimap-login (car credentials) (cadr credentials))) + (let ((nnimap-inhibit-logging t)) + (setq login-result + (nnimap-login (car credentials) (cadr credentials)))) (unless (car login-result) ;; If the login failed, then forget the credentials ;; that are now possibly cached. @@ -1565,6 +1568,7 @@ textual parts.") (defvar nnimap-sequence 0) (defun nnimap-send-command (&rest args) + (setf (nnimap-last-command-time nnimap-object) (current-time)) (process-send-string (get-buffer-process (current-buffer)) (nnimap-log-command @@ -1583,12 +1587,14 @@ textual parts.") (defun nnimap-log-command (command) (with-current-buffer (get-buffer-create "*imap log*") (goto-char (point-max)) - (insert (format-time-string "%H:%M:%S") " " command)) + (insert (format-time-string "%H:%M:%S") " " + (if nnimap-inhibit-logging + "(inhibited)" + command))) command) (defun nnimap-command (&rest args) (erase-buffer) - (setf (nnimap-last-command-time nnimap-object) (current-time)) (let* ((sequence (apply #'nnimap-send-command args)) (response (nnimap-get-response sequence))) (if (equal (caar response) "OK") -- 2.39.5