[gnus git] branch master updated: m0-5-45-gd01dfd7 =2= Set window-point-insertion-type to t in imap log. ; Add recent argument to nnimap-find-article-by-message-id
Julien Danjou <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via d01dfd74710db457f544c20ad21143ce5087e22b (commit)
via ac8ce21091b89a7a05ad821854f4d3e7ff35a394 (commit)
from 655e6d1e5aa9d0f518fc5067b9aa7dc6c46916fb (commit)
- Log -----------------------------------------------------------------
commit d01dfd74710db457f544c20ad21143ce5087e22b
Author: Michael Welsh Duggan <[email protected]>
Date: Sun Jun 17 19:12:31 2012 -0400
Set window-point-insertion-type to t in imap log.
Please consider this tiny patch to nnimap.el. Its purpose is to have
the point in IMAP log windows scroll if the point is at EOB. It
accomplishes this my setting a buffer-local version of
window-point-insertion-type to t when the IMAP log buffer is created.
Signed-off-by: Julien Danjou <[email protected]>
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 52bb846..d97969c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-19 Michael Welsh Duggan <[email protected]> (tiny change)
+
+ * nnimap.el (nnimap-log-buffer): Add this, setting
+ `window-point-insertion-type' in the buffer to t.
+ (nnimap-log-command): Use nnimap-log-buffer.
+
2012-06-19 Julien Danjou <[email protected]>
* nnimap.el (nnimap-find-article-by-message-id): Add an optional limit
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 8227bf6..e68570e 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1751,9 +1751,17 @@ if READ-ONLY is set, send EXAMINE rather than SELECT to the server."
(defvar nnimap-record-commands nil
"If non-nil, log commands to the \"*imap log*\" buffer.")
+(defun nnimap-log-buffer ()
+ (let ((name "*imap log*"))
+ (or (get-buffer name)
+ (with-current-buffer (get-buffer-create name)
+ (make-local-variable 'window-point-insertion-type)
+ (setq window-point-insertion-type t)
+ (current-buffer)))))
+
(defun nnimap-log-command (command)
(when nnimap-record-commands
- (with-current-buffer (get-buffer-create "*imap log*")
+ (with-current-buffer (nnimap-log-buffer)
(goto-char (point-max))
(insert (format-time-string "%H:%M:%S")
" [" nnimap-address "] "
commit ac8ce21091b89a7a05ad821854f4d3e7ff35a394
Author: Julien Danjou <[email protected]>
Date: Thu Jun 14 10:09:04 2012 +0200
Add recent argument to nnimap-find-article-by-message-id
Signed-off-by: Julien Danjou <[email protected]>
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1df328c..52bb846 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
+2012-06-19 Julien Danjou <[email protected]>
+
+ * nnimap.el (nnimap-find-article-by-message-id): Add an optional limit
+ argument to be able to limit the search.
+ (nnimap-request-move-article): Use `nnimap-request-move-articles-find-limit'.
+ (nnimap-request-move-articles-find-limit): Add this to limit the search
+ by Message-Id after a message move.
+ (nnimap): Add defgroup.
+
2012-06-18 Nelson Ferreira <[email protected]> (tiny change)
* gnus-win.el (gnus-configure-frame): Pass an arg to window-dedicated-p.
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 1fa0bea..8227bf6 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -123,6 +123,16 @@ will fetch all parts that have types that match that string. A
likely value would be \"text/\" to automatically fetch all
textual parts.")
+(defgroup nnimap nil
+ "IMAP for Gnus."
+ :group 'gnus)
+
+(defcustom nnimap-request-move-articles-find-limit nil
+ "Limit the number of articles to look for after moving an article."
+ :type 'integer
+ :version "24.2"
+ :group 'nnimap)
+
(defvar nnimap-process nil)
(defvar nnimap-status-string "")
@@ -867,7 +877,8 @@ textual parts.")
(cons internal-move-group
(or (nnimap-find-uid-response "COPYUID" (cadr result))
(nnimap-find-article-by-message-id
- internal-move-group server message-id)))))
+ internal-move-group server message-id
+ nnimap-request-move-articles-find-limit)))))
;; Move the article to a different method.
(let ((result (eval accept-form)))
(when result
@@ -969,21 +980,31 @@ textual parts.")
(cdr (assoc "SEARCH" (cdr result))))))))))
-(defun nnimap-find-article-by-message-id (group server message-id)
- "Search for message with MESSAGE-ID in GROUP from SERVER."
+(defun nnimap-find-article-by-message-id (group server message-id &optional limit)
+ "Search for message with MESSAGE-ID in GROUP from SERVER.
+If LIMIT, first try to limit the search to the N last articles."
(with-current-buffer (nnimap-buffer)
(erase-buffer)
- (nnimap-change-group group server nil t)
- (let ((sequence
- (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id))
- article result)
- (setq result (nnimap-wait-for-response sequence))
- (when (and result
- (car (setq result (nnimap-parse-response))))
- ;; Select the last instance of the message in the group.
- (and (setq article
- (car (last (cdr (assoc "SEARCH" (cdr result))))))
- (string-to-number article))))))
+ (let* ((number-of-article
+ (catch 'found
+ (dolist (result (cdr (nnimap-change-group group server nil t)))
+ (when (equal "EXISTS" (cadr result))
+ (throw 'found (car result))))))
+ (sequence
+ (nnimap-send-command "UID SEARCH%s HEADER Message-Id %S"
+ (if (and limit number-of-article)
+ ;; The -1 is because IMAP message
+ ;; numbers are one-based rather than
+ ;; zero-based.
+ (format " %s:*" (- (string-to-number number-of-article) limit -1))
+ "")
+ message-id)))
+ (when (nnimap-wait-for-response sequence)
+ (let ((article (car (last (cdr (assoc "SEARCH" (nnimap-parse-response)))))))
+ (if article
+ (string-to-number article)
+ (when (and limit number-of-article)
+ (nnimap-find-article-by-message-id group server message-id))))))))
(defun nnimap-delete-article (articles)
(with-current-buffer (nnimap-buffer)
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 15 ++++++++++++
lisp/nnimap.el | 67 ++++++++++++++++++++++++++++++++++++++++----------------
2 files changed, 63 insertions(+), 19 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project