aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGnus developers2011-07-19 22:19:06 +0000
committerKatsumi Yamaoka2011-07-19 22:19:06 +0000
commitae97e6451dc1d2b7454e39953f202a63ed54a2ae (patch)
tree7d117800fce9a27095953e8a4ead1e734f796230
parent92e15d10a641b7877b91436ab215acb9d9c16f22 (diff)
downloademacs-ae97e6451dc1d2b7454e39953f202a63ed54a2ae.tar.gz
emacs-ae97e6451dc1d2b7454e39953f202a63ed54a2ae.zip
Merge changes made in Gnus trunk.
gnus-group.el (gnus-group-read-ephemeral-group): Make sure we don't enter invalid buffer configurations into the quit form (bug#9107). (gnus-group-tool-bar-gnome): Replace connect/disconnect with unplugged/plugged. gnus-sum.el (gnus-summary-refer-thread): When inserting new headers, keep track of which ones are unread (bug#9061). gnus.el (gnus-refer-article-method): Allow entering any sexp (bug#9055). gnus-art.el (gnus-article-show-images): Allow working if using w3m (bug#9041). gnus-html.el (mm-util): Require (bug#9073). gnus-sum.el (gnus-delete-duplicate-headers): New function. (gnus-summary-refer-thread): Use it to remove duplicates in the un-threaded view (bug#9053). (gnus-summary-insert-subject): Document USE-OLD-HEADER (bug#9070). nnir.el (nnir-read-server-parm): Use default value from global variable. Without this the default search engine parameters aren't used at all. message.el (message-unique-id): Don't use the undocumented return value from (random t) (bug#9118).
-rw-r--r--lisp/gnus/ChangeLog34
-rw-r--r--lisp/gnus/gnus-art.el15
-rw-r--r--lisp/gnus/gnus-group.el13
-rw-r--r--lisp/gnus/gnus-html.el1
-rw-r--r--lisp/gnus/gnus-sum.el71
-rw-r--r--lisp/gnus/gnus.el1
-rw-r--r--lisp/gnus/message.el8
-rw-r--r--lisp/gnus/nnir.el1
8 files changed, 109 insertions, 35 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 32f5b702c6f..d18be47fb9d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,37 @@
12011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-group.el (gnus-group-read-ephemeral-group): Make sure we don't
4 enter invalid buffer configurations into the quit form (bug#9107).
5 (gnus-group-tool-bar-gnome): Replace connect/disconnect with
6 unplugged/plugged.
7
8 * gnus-sum.el (gnus-summary-refer-thread): When inserting new headers,
9 keep track of which ones are unread (bug#9061).
10
11 * gnus.el (gnus-refer-article-method): Allow entering any sexp
12 (bug#9055).
13
14 * gnus-art.el (gnus-article-show-images): Allow working if using w3m
15 (bug#9041).
16
17 * gnus-html.el (mm-util): Require (bug#9073).
18
19 * gnus-sum.el (gnus-delete-duplicate-headers): New function.
20 (gnus-summary-refer-thread): Use it to remove duplicates in the
21 un-threaded view (bug#9053).
22 (gnus-summary-insert-subject): Document USE-OLD-HEADER (bug#9070).
23
242011-07-07 Kan-Ru Chen <kanru@kanru.info>
25
26 * nnir.el (nnir-read-server-parm): Use default value from global
27 variable. Without this the default search engine parameters aren't
28 used at all.
29
302011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
31
32 * message.el (message-unique-id): Don't use the undocumented return
33 value from (random t) (bug#9118).
34
12011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org> 352011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 36
3 * message.el (message-auto-save-directory): If the ~/Mail directory 37 * message.el (message-auto-save-directory): If the ~/Mail directory
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 7255be416eb..c29000f4691 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -2267,6 +2267,8 @@ unfolded."
2267 (dolist (elem gnus-article-image-alist) 2267 (dolist (elem gnus-article-image-alist)
2268 (gnus-delete-images (car elem)))))) 2268 (gnus-delete-images (car elem))))))
2269 2269
2270(autoload 'w3m-toggle-inline-images "w3m")
2271
2270(defun gnus-article-show-images () 2272(defun gnus-article-show-images ()
2271 "Show any images that are in the HTML-rendered article buffer. 2273 "Show any images that are in the HTML-rendered article buffer.
2272This only works if the article in question is HTML." 2274This only works if the article in question is HTML."
@@ -2274,11 +2276,14 @@ This only works if the article in question is HTML."
2274 (gnus-with-article-buffer 2276 (gnus-with-article-buffer
2275 (save-restriction 2277 (save-restriction
2276 (widen) 2278 (widen)
2277 (dolist (region (gnus-find-text-property-region (point-min) (point-max) 2279 (if (eq mm-text-html-renderer 'w3m)
2278 'image-displayer)) 2280 (let ((mm-inline-text-html-with-images nil))
2279 (destructuring-bind (start end function) region 2281 (w3m-toggle-inline-images))
2280 (funcall function (get-text-property start 'image-url) 2282 (dolist (region (gnus-find-text-property-region (point-min) (point-max)
2281 start end)))))) 2283 'image-displayer))
2284 (destructuring-bind (start end function) region
2285 (funcall function (get-text-property start 'image-url)
2286 start end)))))))
2282 2287
2283(defun gnus-article-treat-fold-newsgroups () 2288(defun gnus-article-treat-fold-newsgroups ()
2284 "Unfold folded message headers. 2289 "Unfold folded message headers.
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index b4dca3e1fc4..2a31ccd34f0 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1008,10 +1008,10 @@ Pre-defined symbols include `gnus-group-tool-bar-gnome' and
1008 '((gnus-group-post-news "mail/compose") 1008 '((gnus-group-post-news "mail/compose")
1009 ;; Some useful agent icons? I don't use the agent so agent users should 1009 ;; Some useful agent icons? I don't use the agent so agent users should
1010 ;; suggest useful commands: 1010 ;; suggest useful commands:
1011 (gnus-agent-toggle-plugged "disconnect" t 1011 (gnus-agent-toggle-plugged "unplugged" t
1012 :help "Gnus is currently unplugged. Click to work online." 1012 :help "Gnus is currently unplugged. Click to work online."
1013 :visible (and gnus-agent (not gnus-plugged))) 1013 :visible (and gnus-agent (not gnus-plugged)))
1014 (gnus-agent-toggle-plugged "connect" t 1014 (gnus-agent-toggle-plugged "plugged" t
1015 :help "Gnus is currently plugged. Click to work offline." 1015 :help "Gnus is currently plugged. Click to work offline."
1016 :visible (and gnus-agent gnus-plugged)) 1016 :visible (and gnus-agent gnus-plugged))
1017 ;; FIXME: gnus-agent-toggle-plugged (in gnus-agent-group-make-menu-bar) 1017 ;; FIXME: gnus-agent-toggle-plugged (in gnus-agent-group-make-menu-bar)
@@ -2298,11 +2298,14 @@ Return the name of the group if selection was successful."
2298 `(-1 nil (,group 2298 `(-1 nil (,group
2299 ,gnus-level-default-subscribed nil nil ,method 2299 ,gnus-level-default-subscribed nil nil ,method
2300 ,(cons 2300 ,(cons
2301 (if quit-config 2301 (cond
2302 (cons 'quit-config quit-config) 2302 (quit-config
2303 (cons 'quit-config quit-config))
2304 ((assq gnus-current-window-configuration
2305 gnus-buffer-configuration)
2303 (cons 'quit-config 2306 (cons 'quit-config
2304 (cons gnus-summary-buffer 2307 (cons gnus-summary-buffer
2305 gnus-current-window-configuration))) 2308 gnus-current-window-configuration))))
2306 parameters))) 2309 parameters)))
2307 gnus-newsrc-hashtb) 2310 gnus-newsrc-hashtb)
2308 (push method gnus-ephemeral-servers) 2311 (push method gnus-ephemeral-servers)
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index 6ca3c8b7945..d3da6aab1b7 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -38,6 +38,7 @@
38(require 'url-cache) 38(require 'url-cache)
39(require 'xml) 39(require 'xml)
40(require 'browse-url) 40(require 'browse-url)
41(require 'mm-util)
41(eval-and-compile (unless (featurep 'xemacs) (require 'help-fns))) 42(eval-and-compile (unless (featurep 'xemacs) (require 'help-fns)))
42 43
43(defcustom gnus-html-image-cache-ttl (days-to-time 7) 44(defcustom gnus-html-image-cache-ttl (days-to-time 7)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 5a817e12104..86ff0180f55 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6562,7 +6562,10 @@ This is meant to be called in `gnus-article-internal-prepare-hook'."
6562(defun gnus-summary-insert-subject (id &optional old-header use-old-header) 6562(defun gnus-summary-insert-subject (id &optional old-header use-old-header)
6563 "Find article ID and insert the summary line for that article. 6563 "Find article ID and insert the summary line for that article.
6564OLD-HEADER can either be a header or a line number to insert 6564OLD-HEADER can either be a header or a line number to insert
6565the subject line on." 6565the subject line on.
6566If USE-OLD-HEADER is non-nil, then OLD-HEADER should be a header,
6567and OLD-HEADER will be used when the summary line is inserted,
6568too, instead of trying to fetch new headers."
6566 (let* ((line (and (numberp old-header) old-header)) 6569 (let* ((line (and (numberp old-header) old-header))
6567 (old-header (and (vectorp old-header) old-header)) 6570 (old-header (and (vectorp old-header) old-header))
6568 (header (cond ((and old-header use-old-header) 6571 (header (cond ((and old-header use-old-header)
@@ -8950,6 +8953,21 @@ Return the number of articles fetched."
8950 (gnus-summary-position-point) 8953 (gnus-summary-position-point)
8951 n))) 8954 n)))
8952 8955
8956(defun gnus-delete-duplicate-headers (headers)
8957 ;; First remove leading duplicates.
8958 (while (and (> (length headers) 1)
8959 (= (mail-header-number (car headers))
8960 (mail-header-number (cadr headers))))
8961 (pop headers))
8962 ;; Then the rest.
8963 (let ((result headers))
8964 (while (> (length headers) 1)
8965 (if (= (mail-header-number (car headers))
8966 (mail-header-number (cadr headers)))
8967 (setcdr headers (cddr headers))
8968 (pop headers)))
8969 result))
8970
8953(defun gnus-summary-refer-thread (&optional limit) 8971(defun gnus-summary-refer-thread (&optional limit)
8954 "Fetch all articles in the current thread. 8972 "Fetch all articles in the current thread.
8955If no backend-specific 'request-thread function is available 8973If no backend-specific 'request-thread function is available
@@ -8964,29 +8982,36 @@ variable."
8964 (gnus-summary-ignore-duplicates t) 8982 (gnus-summary-ignore-duplicates t)
8965 (gnus-read-all-available-headers t) 8983 (gnus-read-all-available-headers t)
8966 (limit (if limit (prefix-numeric-value limit) 8984 (limit (if limit (prefix-numeric-value limit)
8967 gnus-refer-thread-limit))) 8985 gnus-refer-thread-limit))
8986 (new-headers
8987 (if (gnus-check-backend-function
8988 'request-thread gnus-newsgroup-name)
8989 (gnus-request-thread header gnus-newsgroup-name)
8990 (let* ((last (if (numberp limit)
8991 (min (+ (mail-header-number header)
8992 limit)
8993 gnus-newsgroup-highest)
8994 gnus-newsgroup-highest))
8995 (subject (gnus-simplify-subject
8996 (mail-header-subject header)))
8997 (refs (split-string (or (mail-header-references header)
8998 "")))
8999 (gnus-parse-headers-hook
9000 (lambda () (goto-char (point-min))
9001 (keep-lines
9002 (regexp-opt (append refs (list id subject)))))))
9003 (gnus-fetch-headers (list last) (if (numberp limit)
9004 (* 2 limit) limit) t)))))
9005 (dolist (header new-headers)
9006 (when (member (mail-header-number header) gnus-newsgroup-unselected)
9007 (push (mail-header-number header) gnus-newsgroup-unreads)
9008 (setq gnus-newsgroup-unselected
9009 (delete (mail-header-number header) gnus-newsgroup-unselected))))
8968 (setq gnus-newsgroup-headers 9010 (setq gnus-newsgroup-headers
8969 (gnus-merge 9011 (gnus-delete-duplicate-headers
8970 'list gnus-newsgroup-headers 9012 (gnus-merge
8971 (if (gnus-check-backend-function 9013 'list gnus-newsgroup-headers new-headers
8972 'request-thread gnus-newsgroup-name) 9014 'gnus-article-sort-by-number)))
8973 (gnus-request-thread header gnus-newsgroup-name)
8974 (let* ((last (if (numberp limit)
8975 (min (+ (mail-header-number header)
8976 limit)
8977 gnus-newsgroup-highest)
8978 gnus-newsgroup-highest))
8979 (subject (gnus-simplify-subject
8980 (mail-header-subject header)))
8981 (refs (split-string (or (mail-header-references header)
8982 "")))
8983 (gnus-parse-headers-hook
8984 (lambda () (goto-char (point-min))
8985 (keep-lines
8986 (regexp-opt (append refs (list id subject)))))))
8987 (gnus-fetch-headers (list last) (if (numberp limit)
8988 (* 2 limit) limit) t)))
8989 'gnus-article-sort-by-number))
8990 (gnus-summary-limit-include-thread id))) 9015 (gnus-summary-limit-include-thread id)))
8991 9016
8992(defun gnus-summary-refer-article (message-id) 9017(defun gnus-summary-refer-article (message-id)
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index b66d5f22474..7ff90f583cf 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1435,6 +1435,7 @@ list, Gnus will try all the methods in the list until it finds a match."
1435 (const current) 1435 (const current)
1436 (const :tag "Google" (nnweb "refer" (nnweb-type google))) 1436 (const :tag "Google" (nnweb "refer" (nnweb-type google)))
1437 gnus-select-method 1437 gnus-select-method
1438 sexp
1438 (repeat :menu-tag "Try multiple" 1439 (repeat :menu-tag "Try multiple"
1439 :tag "Multiple" 1440 :tag "Multiple"
1440 :value (current (nnweb "refer" (nnweb-type google))) 1441 :value (current (nnweb "refer" (nnweb-type google)))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index ff013e5b291..47c4de0aedc 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -4785,7 +4785,9 @@ Do not use this for anything important, it is cryptographically weak."
4785 (require 'sha1) 4785 (require 'sha1)
4786 (let (sha1-maximum-internal-length) 4786 (let (sha1-maximum-internal-length)
4787 (sha1 (concat (message-unique-id) 4787 (sha1 (concat (message-unique-id)
4788 (format "%x%x%x" (random) (random t) (random)) 4788 (format "%x%x%x" (random)
4789 (progn (random t) (random))
4790 (random))
4789 (prin1-to-string (recent-keys)) 4791 (prin1-to-string (recent-keys))
4790 (prin1-to-string (garbage-collect)))))) 4792 (prin1-to-string (garbage-collect))))))
4791 4793
@@ -5488,10 +5490,12 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'."
5488;; You might for example insert a "." somewhere (not next to another dot 5490;; You might for example insert a "." somewhere (not next to another dot
5489;; or string boundary), or modify the "fsf" string. 5491;; or string boundary), or modify the "fsf" string.
5490(defun message-unique-id () 5492(defun message-unique-id ()
5493 (random t)
5491 ;; Don't use microseconds from (current-time), they may be unsupported. 5494 ;; Don't use microseconds from (current-time), they may be unsupported.
5492 ;; Instead we use this randomly inited counter. 5495 ;; Instead we use this randomly inited counter.
5493 (setq message-unique-id-char 5496 (setq message-unique-id-char
5494 (% (1+ (or message-unique-id-char (logand (random t) (1- (lsh 1 20))))) 5497 (% (1+ (or message-unique-id-char
5498 (logand (random most-positive-fixnum) (1- (lsh 1 20)))))
5495 ;; (current-time) returns 16-bit ints, 5499 ;; (current-time) returns 16-bit ints,
5496 ;; and 2^16*25 just fits into 4 digits i base 36. 5500 ;; and 2^16*25 just fits into 4 digits i base 36.
5497 (* 25 25))) 5501 (* 25 25)))
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 8099cc2a7cc..3f140ef59d9 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -1640,6 +1640,7 @@ server is of form 'backend:name'."
1640 (let ((method (gnus-server-to-method server))) 1640 (let ((method (gnus-server-to-method server)))
1641 (cond ((and method (assq key (cddr method))) 1641 (cond ((and method (assq key (cddr method)))
1642 (nth 1 (assq key (cddr method)))) 1642 (nth 1 (assq key (cddr method))))
1643 ((boundp key) (symbol-value key))
1643 (t nil)))) 1644 (t nil))))
1644 1645
1645(defun nnir-possibly-change-server (server) 1646(defun nnir-possibly-change-server (server)