diff options
author | Paul Eggert <[email protected]> | 2011-07-20 09:32:42 -0700 |
---|---|---|
committer | Paul Eggert <[email protected]> | 2011-07-20 09:32:42 -0700 |
commit | 49b602e24ecb3fe085d45ac385e1bfda82252090 (patch) | |
tree | a8b33aacdb64b4394ff213f15a77d90d84d3d8fd | |
parent | 0d8de0fd0a5a63cc9558b5c99f9c7f1ddcaf338a (diff) | |
parent | 59f1b8949499f35fbdf3761acc8dd651fa69d335 (diff) |
Merge from trunk.
-rw-r--r-- | lisp/ChangeLog | 15 | ||||
-rw-r--r-- | lisp/gnus/ChangeLog | 48 | ||||
-rw-r--r-- | lisp/gnus/gnus-art.el | 15 | ||||
-rw-r--r-- | lisp/gnus/gnus-group.el | 13 | ||||
-rw-r--r-- | lisp/gnus/gnus-html.el | 1 | ||||
-rw-r--r-- | lisp/gnus/gnus-sum.el | 74 | ||||
-rw-r--r-- | lisp/gnus/gnus.el | 1 | ||||
-rw-r--r-- | lisp/gnus/message.el | 8 | ||||
-rw-r--r-- | lisp/gnus/nnimap.el | 42 | ||||
-rw-r--r-- | lisp/gnus/nnir.el | 24 | ||||
-rw-r--r-- | lisp/proced.el | 4 |
11 files changed, 179 insertions, 66 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0699a93ac9..b138d78a07 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2011-07-20 Lars Magne Ingebrigtsen <[email protected]> + + * proced.el (proced-update): Revert yesterday's bug#1779 patch, + which apparently didn't work. + +2011-07-19 Roland Winkler <[email protected]> + + * proced.el (proced-send-signal): For *Marked Processes* buffer + put point at beginning of buffer. + +2011-07-19 Stephen Berman <[email protected]> + + * proced.el (proced-format): Make header lines align with the text + (bug#1779). + 2011-07-19 Lars Magne Ingebrigtsen <[email protected]> * view.el (view-buffer): Allow running in `special' modes if we're diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 32f5b702c6..a1cb003a8f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,51 @@ +2011-07-20 Andrew Cohen <[email protected]> + + * nnir.el (gnus-group-make-nnir-group): Allow optional search query + argument. + (gnus-group-make-nnir-group, nnir-request-group, nnir-run-query): Use + `nnir-address' to handle server info rather than passing an arg. + + * nnimap.el (nnimap-make-thread-query): New utility function to format + an imap thread search query. + (nnimap-request-thread): Use it. + + * gnus-sum.el (gnus-handle-ephemeral-exit): Ensure we are setting the + right select-method if we are not going back to the group buffer. + +2011-07-19 Lars Magne Ingebrigtsen <[email protected]> + + * 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). + +2011-07-07 Kan-Ru Chen <[email protected]> + + * nnir.el (nnir-read-server-parm): Use default value from global + variable. Without this the default search engine parameters aren't + used at all. + +2011-07-19 Lars Magne Ingebrigtsen <[email protected]> + + * message.el (message-unique-id): Don't use the undocumented return + value from (random t) (bug#9118). + 2011-07-16 Lars Magne Ingebrigtsen <[email protected]> * 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 7255be416e..c29000f469 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2267,6 +2267,8 @@ unfolded." (dolist (elem gnus-article-image-alist) (gnus-delete-images (car elem)))))) +(autoload 'w3m-toggle-inline-images "w3m") + (defun gnus-article-show-images () "Show any images that are in the HTML-rendered article buffer. This only works if the article in question is HTML." @@ -2274,11 +2276,14 @@ This only works if the article in question is HTML." (gnus-with-article-buffer (save-restriction (widen) - (dolist (region (gnus-find-text-property-region (point-min) (point-max) - 'image-displayer)) - (destructuring-bind (start end function) region - (funcall function (get-text-property start 'image-url) - start end)))))) + (if (eq mm-text-html-renderer 'w3m) + (let ((mm-inline-text-html-with-images nil)) + (w3m-toggle-inline-images)) + (dolist (region (gnus-find-text-property-region (point-min) (point-max) + 'image-displayer)) + (destructuring-bind (start end function) region + (funcall function (get-text-property start 'image-url) + start end))))))) (defun gnus-article-treat-fold-newsgroups () "Unfold folded message headers. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index b4dca3e1fc..2a31ccd34f 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 '((gnus-group-post-news "mail/compose") ;; Some useful agent icons? I don't use the agent so agent users should ;; suggest useful commands: - (gnus-agent-toggle-plugged "disconnect" t + (gnus-agent-toggle-plugged "unplugged" t :help "Gnus is currently unplugged. Click to work online." :visible (and gnus-agent (not gnus-plugged))) - (gnus-agent-toggle-plugged "connect" t + (gnus-agent-toggle-plugged "plugged" t :help "Gnus is currently plugged. Click to work offline." :visible (and gnus-agent gnus-plugged)) ;; 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." `(-1 nil (,group ,gnus-level-default-subscribed nil nil ,method ,(cons - (if quit-config - (cons 'quit-config quit-config) + (cond + (quit-config + (cons 'quit-config quit-config)) + ((assq gnus-current-window-configuration + gnus-buffer-configuration) (cons 'quit-config (cons gnus-summary-buffer - gnus-current-window-configuration))) + gnus-current-window-configuration)))) parameters))) gnus-newsrc-hashtb) (push method gnus-ephemeral-servers) diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 6ca3c8b794..d3da6aab1b 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -38,6 +38,7 @@ (require 'url-cache) (require 'xml) (require 'browse-url) +(require 'mm-util) (eval-and-compile (unless (featurep 'xemacs) (require 'help-fns))) (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 5a817e1210..6e8fc63d79 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'." (defun gnus-summary-insert-subject (id &optional old-header use-old-header) "Find article ID and insert the summary line for that article. OLD-HEADER can either be a header or a line number to insert -the subject line on." +the subject line on. +If USE-OLD-HEADER is non-nil, then OLD-HEADER should be a header, +and OLD-HEADER will be used when the summary line is inserted, +too, instead of trying to fetch new headers." (let* ((line (and (numberp old-header) old-header)) (old-header (and (vectorp old-header) old-header)) (header (cond ((and old-header use-old-header) @@ -7336,6 +7339,9 @@ The state which existed when entering the ephemeral is reset." (if (not (buffer-name (car quit-config))) (gnus-configure-windows 'group 'force) (set-buffer (car quit-config)) + (unless (eq (cdr quit-config) 'group) + (setq gnus-current-select-method + (gnus-find-method-for-group gnus-newsgroup-name))) (cond ((eq major-mode 'gnus-summary-mode) (gnus-set-global-variables)) ((eq major-mode 'gnus-article-mode) @@ -8950,6 +8956,21 @@ Return the number of articles fetched." (gnus-summary-position-point) n))) +(defun gnus-delete-duplicate-headers (headers) + ;; First remove leading duplicates. + (while (and (> (length headers) 1) + (= (mail-header-number (car headers)) + (mail-header-number (cadr headers)))) + (pop headers)) + ;; Then the rest. + (let ((result headers)) + (while (> (length headers) 1) + (if (= (mail-header-number (car headers)) + (mail-header-number (cadr headers))) + (setcdr headers (cddr headers)) + (pop headers))) + result)) + (defun gnus-summary-refer-thread (&optional limit) "Fetch all articles in the current thread. If no backend-specific 'request-thread function is available @@ -8964,29 +8985,36 @@ variable." (gnus-summary-ignore-duplicates t) (gnus-read-all-available-headers t) (limit (if limit (prefix-numeric-value limit) - gnus-refer-thread-limit))) + gnus-refer-thread-limit)) + (new-headers + (if (gnus-check-backend-function + 'request-thread gnus-newsgroup-name) + (gnus-request-thread header gnus-newsgroup-name) + (let* ((last (if (numberp limit) + (min (+ (mail-header-number header) + limit) + gnus-newsgroup-highest) + gnus-newsgroup-highest)) + (subject (gnus-simplify-subject + (mail-header-subject header))) + (refs (split-string (or (mail-header-references header) + ""))) + (gnus-parse-headers-hook + (lambda () (goto-char (point-min)) + (keep-lines + (regexp-opt (append refs (list id subject))))))) + (gnus-fetch-headers (list last) (if (numberp limit) + (* 2 limit) limit) t))))) + (dolist (header new-headers) + (when (member (mail-header-number header) gnus-newsgroup-unselected) + (push (mail-header-number header) gnus-newsgroup-unreads) + (setq gnus-newsgroup-unselected + (delete (mail-header-number header) gnus-newsgroup-unselected)))) (setq gnus-newsgroup-headers - (gnus-merge - 'list gnus-newsgroup-headers - (if (gnus-check-backend-function - 'request-thread gnus-newsgroup-name) - (gnus-request-thread header gnus-newsgroup-name) - (let* ((last (if (numberp limit) - (min (+ (mail-header-number header) - limit) - gnus-newsgroup-highest) - gnus-newsgroup-highest)) - (subject (gnus-simplify-subject - (mail-header-subject header))) - (refs (split-string (or (mail-header-references header) - ""))) - (gnus-parse-headers-hook - (lambda () (goto-char (point-min)) - (keep-lines - (regexp-opt (append refs (list id subject))))))) - (gnus-fetch-headers (list last) (if (numberp limit) - (* 2 limit) limit) t))) - 'gnus-article-sort-by-number)) + (gnus-delete-duplicate-headers + (gnus-merge + 'list gnus-newsgroup-headers new-headers + 'gnus-article-sort-by-number))) (gnus-summary-limit-include-thread id))) (defun gnus-summary-refer-article (message-id) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index b66d5f2247..7ff90f583c 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." (const current) (const :tag "Google" (nnweb "refer" (nnweb-type google))) gnus-select-method + sexp (repeat :menu-tag "Try multiple" :tag "Multiple" :value (current (nnweb "refer" (nnweb-type google))) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index ff013e5b29..47c4de0aed 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." (require 'sha1) (let (sha1-maximum-internal-length) (sha1 (concat (message-unique-id) - (format "%x%x%x" (random) (random t) (random)) + (format "%x%x%x" (random) + (progn (random t) (random)) + (random)) (prin1-to-string (recent-keys)) (prin1-to-string (garbage-collect)))))) @@ -5488,10 +5490,12 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." ;; You might for example insert a "." somewhere (not next to another dot ;; or string boundary), or modify the "fsf" string. (defun message-unique-id () + (random t) ;; Don't use microseconds from (current-time), they may be unsupported. ;; Instead we use this randomly inited counter. (setq message-unique-id-char - (% (1+ (or message-unique-id-char (logand (random t) (1- (lsh 1 20))))) + (% (1+ (or message-unique-id-char + (logand (random most-positive-fixnum) (1- (lsh 1 20))))) ;; (current-time) returns 16-bit ints, ;; and 2^16*25 just fits into 4 digits i base 36. (* 25 25))) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index ef5bee7162..385522759b 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1567,25 +1567,14 @@ textual parts.") (deffoo nnimap-request-thread (header &optional group server) (when (nnimap-possibly-change-group group server) - (let* ((id (mail-header-id header)) - (refs (split-string - (or (mail-header-references header) - ""))) - (cmd (let ((value - (format - "(OR HEADER REFERENCES %s HEADER Message-Id %s)" - id id))) - (dolist (refid refs value) - (setq value (format - "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)" - refid refid value))))) - (result (with-current-buffer (nnimap-buffer) - (nnimap-command "UID SEARCH %s" cmd)))) - (when result - (gnus-fetch-headers - (and (car result) (delete 0 (mapcar #'string-to-number - (cdr (assoc "SEARCH" (cdr result)))))) - nil t))))) + (let* ((cmd (nnimap-make-thread-query header)) + (result (with-current-buffer (nnimap-buffer) + (nnimap-command "UID SEARCH %s" cmd)))) + (when result + (gnus-fetch-headers + (and (car result) (delete 0 (mapcar #'string-to-number + (cdr (assoc "SEARCH" (cdr result)))))) + nil t))))) (defun nnimap-possibly-change-group (group server) (let ((open-result t)) @@ -1951,6 +1940,21 @@ textual parts.") group-art)) nnimap-incoming-split-list))) +(defun nnimap-make-thread-query (header) + (let* ((id (mail-header-id header)) + (refs (split-string + (or (mail-header-references header) + ""))) + (value + (format + "(OR HEADER REFERENCES %s HEADER Message-Id %s)" + id id))) + (dolist (refid refs value) + (setq value (format + "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)" + refid refid value))))) + + (provide 'nnimap) ;;; nnimap.el ends here diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 8099cc2a7c..9840dddcb6 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -296,6 +296,9 @@ is `(valuefunc member)'." (nnoo-declare nnir) (nnoo-define-basics nnir) +(defvoo nnir-address nil + "The address of the nnir server.") + (gnus-declare-backend "nnir" 'mail) @@ -582,18 +585,17 @@ Add an entry here when adding a new search engine.") ;; Gnus glue. -(defun gnus-group-make-nnir-group (nnir-extra-parms) +(defun gnus-group-make-nnir-group (nnir-extra-parms &optional parms) "Create an nnir group. Asks for query." (interactive "P") (setq nnir-current-query nil nnir-current-server nil nnir-current-group-marked nil nnir-artlist nil) - (let* ((query (read-string "Query: " nil 'nnir-search-history)) - (parms (list (cons 'query query))) - (srv (if (gnus-server-server-name) - "all" ""))) - (add-to-list 'parms (cons 'unique-id (message-unique-id)) t) + (let* ((query (unless parms (read-string "Query: " nil 'nnir-search-history))) + (parms (or parms (list (cons 'query query)))) + (srv (or (cdr (assq 'server parms)) (gnus-server-server-name) "nnir"))) + (add-to-list 'parms (cons 'unique-id (message-unique-id)) t) (gnus-group-read-ephemeral-group (concat "nnir:" (prin1-to-string parms)) (list 'nnir srv) t (cons (current-buffer) gnus-current-window-configuration) @@ -617,7 +619,7 @@ Add an entry here when adding a new search engine.") (equal server nnir-current-server))) nnir-artlist ;; Cache miss. - (setq nnir-artlist (nnir-run-query group server))) + (setq nnir-artlist (nnir-run-query group))) (with-current-buffer nntp-server-buffer (setq nnir-current-query group) (when server (setq nnir-current-server server)) @@ -1594,14 +1596,13 @@ actually)." (autoload 'gnus-group-topic-name "gnus-topic") -(defun nnir-run-query (query nserver) +(defun nnir-run-query (query) "Invoke appropriate search engine function (see `nnir-engines'). If some groups were process-marked, run the query for each of the groups and concat the results." (let ((q (car (read-from-string query))) - (groups (if (string= "all-ephemeral" nserver) - (with-current-buffer gnus-server-buffer - (list (list (gnus-server-server-name)))) + (groups (if (not (string= "nnir" nnir-address)) + (list (list nnir-address)) (nnir-categorize (or gnus-group-marked (if (gnus-group-group-name) @@ -1640,6 +1641,7 @@ server is of form 'backend:name'." (let ((method (gnus-server-to-method server))) (cond ((and method (assq key (cddr method))) (nth 1 (assq key (cddr method)))) + ((boundp key) (symbol-value key)) (t nil)))) (defun nnir-possibly-change-server (server) diff --git a/lisp/proced.el b/lisp/proced.el index 11598d7350..94ea579ebd 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -1724,7 +1724,9 @@ After sending the signal, this command runs the normal hook (buffer-disable-undo) (setq buffer-read-only t) (dolist (process process-alist) - (insert " " (cdr process) "\n"))) + (insert " " (cdr process) "\n")) + (delete-char -1) + (goto-char (point-min))) (save-window-excursion ;; Analogous to `dired-pop-to-buffer' ;; Don't split window horizontally. (Bug#1806) |