summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGnus developers <ding@gnus.org>2010-10-30 05:59:34 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-10-30 05:59:34 +0000
commit99e65b2d2e79edf3ed0c4f00916098d4ea3767f4 (patch)
tree700dfa334160dd15bd301528982a1f53a734ffc9 /lisp
parent88f43c67491e301d5e0fe4476d1a7203c64a3762 (diff)
downloademacs-99e65b2d2e79edf3ed0c4f00916098d4ea3767f4.tar.gz
emacs-99e65b2d2e79edf3ed0c4f00916098d4ea3767f4.tar.bz2
emacs-99e65b2d2e79edf3ed0c4f00916098d4ea3767f4.zip
Merge changes made in Gnus trunk.
gnus.el: Remove `gnus-nntp-service' variable. gnus.el: Make gnus-nntp-server and gnus-secondary-servers obsolete. gnus-sum.el (gnus-summary-delete-marked-as-read, gnus-summary-delete-marked-with): Remove obsolete defalias. gnus.el (gnus-use-long-file-name): Fix docstring. nnimap.el (nnimap-open-connection): Use AUTHENTICATE PLAIN on servers that say they support that. gnus-msg.el (gnus-inews-do-gcc): Don't have the backends do the slow *-request-group, which seems unnecessary. gnus-group.el (gnus-group-get-new-news-this-group): Don't have point move to the previous line on `M-g'. nnimap.el (nnimap-split-incoming-mail): Note that the INBOX has been selected. nnimap.el: Allow the user to say whether to split old messages or not in nnimap. shr.el (shr-tag-table-1): Only insert the images after the top-level table. shr.el (shr-tag-span): Drop colorisation of regions since we don't control the background color. shr.el (shr-tag-img): Ignore very small web bug type images. shr.el (shr-put-image): Add help-echo alt texts to the images. shr.el (shr-tag-video): Show the video poster image.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog45
-rw-r--r--lisp/gnus/gnus-group.el2
-rw-r--r--lisp/gnus/gnus-int.el2
-rw-r--r--lisp/gnus/gnus-msg.el2
-rw-r--r--lisp/gnus/gnus-sum.el8
-rw-r--r--lisp/gnus/gnus-util.el8
-rw-r--r--lisp/gnus/gnus.el40
-rw-r--r--lisp/gnus/nnimap.el34
-rw-r--r--lisp/gnus/shr.el65
9 files changed, 133 insertions, 73 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a56fe89b818..00451f7e6bd 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,50 @@
+2010-10-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * shr.el (shr-tag-span): Drop colorisation of regions since we don't
+ control the background color.
+ (shr-tag-img): Ignore very small web bug type images.
+ (shr-put-image): Add help-echo alt texts to the images.
+ (shr-tag-video): Show the video poster image.
+
+2010-10-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * shr.el (shr-table-depth): New variable.
+ (shr-tag-table-1): Only insert the images after the top-level table.
+
+ * nnimap.el (nnimap-split-incoming-mail): Fix typo.
+
+ * gnus-util.el (gnus-list-memq-of-list): New function.
+
+ * nnimap.el (nnimap-split-incoming-mail): Note that the INBOX has been
+ selected.
+ (nnimap-unsplittable-articles): New slot.
+ (nnimap-new-articles): Use it.
+
+2010-10-29 Stephen Berman <stephen.berman@gmx.net> (tiny change)
+
+ * gnus-group.el (gnus-group-get-new-news-this-group): Don't have point
+ move to the previous line on `M-g'.
+
+2010-10-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-msg.el (gnus-inews-do-gcc): Don't have the backends do the slow
+ *-request-group, which seems unnecessary.
+
+ * nnimap.el (nnimap-quote-specials): Function copied over from
+ imap.el.
+ (nnimap-open-connection): Use AUTHENTICATE PLAIN on servers that say
+ they support that. Suggested by Tom Regner.
+
2010-10-29 Julien Danjou <julien@danjou.info>
+ * gnus-sum.el (gnus-summary-delete-marked-as-read): Remove obsolete
+ defalias.
+ (gnus-summary-delete-marked-with): Remove obsolete defalias.
+
+ * gnus.el: Remove `gnus-nntp-service' variable.
+ (gnus-secondary-servers): Make obsolete.
+ (gnus-nntp-server): Make obsolete.
+
* gnus-start.el (gnus-1): Remove x-splash calls.
* gnus-ems.el (gnus-x-splash): Remove.
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index a777beb7485..83951834424 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -3988,7 +3988,7 @@ If DONT-SCAN is non-nil, scan non-activated groups as well."
(let* ((groups (gnus-group-process-prefix n))
(ret (if (numberp n) (- n (length groups)) 0))
(beg (unless n
- (point)))
+ (point-marker)))
group method
(gnus-inhibit-demon t)
;; Binding this variable will inhibit multiple fetchings
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index 318cdfebda2..b344a5ef15c 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -100,8 +100,6 @@ If CONFIRM is non-nil, the user will be asked for an NNTP server."
;; Stream is already opened.
nil
;; Open NNTP server.
- (unless gnus-nntp-service
- (setq gnus-nntp-server nil))
(when confirm
;; Read server name with completion.
(setq gnus-nntp-server
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index a3c5112ee41..a7d67113b31 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1628,7 +1628,7 @@ this is a reply."
(unless (gnus-check-server method)
(error "Can't open server %s" (if (stringp method) method
(car method))))
- (unless (gnus-request-group group nil method)
+ (unless (gnus-request-group group t method)
(gnus-request-create-group group method))
(setq mml-externalize-attachments
(if (stringp gnus-gcc-externalize-attachments)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 60e3cc83d7f..85fe9f2538f 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -8303,10 +8303,6 @@ articles that are younger than AGE days."
(gnus-summary-limit articles))
(gnus-summary-position-point))
-(defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
-(make-obsolete
- 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread "Emacs 20.4")
-
(defun gnus-summary-limit-to-unread (&optional all)
"Limit the summary buffer to articles that are not marked as read.
If ALL is non-nil, limit strictly to unread articles."
@@ -8397,10 +8393,6 @@ If UNREPLIED (the prefix), limit to unreplied articles."
(gnus-summary-limit gnus-newsgroup-replied))
(gnus-summary-position-point))
-(defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks)
-(make-obsolete 'gnus-summary-delete-marked-with
- 'gnus-summary-limit-exclude-marks "Emacs 20.4")
-
(defun gnus-summary-limit-exclude-marks (marks &optional reverse)
"Exclude articles that are marked with MARKS (e.g. \"DK\").
If REVERSE, limit the summary buffer to articles that are marked
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 1a09e04193b..5bcda97ab1a 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1974,6 +1974,14 @@ Sizes are in pixels."
image)))
image)))
+(defun gnus-list-memq-of-list (elements list)
+ "Return non-nil if any of the members of ELEMENTS are in LIST."
+ (let ((found nil))
+ (dolist (elem elements)
+ (setq found (or found
+ (memq elem list))))
+ found))
+
(provide 'gnus-util)
;;; gnus-util.el ends here
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index baed48d7733..ab0d3b3e59a 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1256,15 +1256,6 @@ by the user.
If you want to change servers, you should use `gnus-select-method'.
See the documentation to that variable.")
-;; Don't touch this variable.
-(defvar gnus-nntp-service "nntp"
- "NNTP service name (\"nntp\" or 119).
-This is an obsolete variable, which is scarcely used. If you use an
-nntp server for your newsgroup and want to change the port number
-used to 899, you would say something along these lines:
-
- (setq gnus-select-method '(nntp \"my.nntp.server\" (nntp-port-number 899)))")
-
(defcustom gnus-nntpserver-file "/etc/nntpserver"
"A file with only the name of the nntp server in it."
:group 'gnus-files
@@ -1288,20 +1279,11 @@ Check the NNTPSERVER environment variable and the
;;;###autoload (custom-autoload 'gnus-select-method "gnus"))
(defcustom gnus-select-method
- (condition-case nil
- (nconc
- (list 'nntp (or (condition-case nil
- (gnus-getenv-nntpserver)
- (error nil))
- (when (and gnus-default-nntp-server
- (not (string= gnus-default-nntp-server "")))
- gnus-default-nntp-server)
- "news"))
- (if (or (null gnus-nntp-service)
- (equal gnus-nntp-service "nntp"))
- nil
- (list gnus-nntp-service)))
- (error nil))
+ (list 'nntp (or (gnus-getenv-nntpserver)
+ (when (and gnus-default-nntp-server
+ (not (string= gnus-default-nntp-server "")))
+ gnus-default-nntp-server)
+ "news"))
"Default method for selecting a newsgroup.
This variable should be a list, where the first element is how the
news is to be fetched, the second is the address.
@@ -1386,14 +1368,14 @@ To make Gnus query you for a server, you have to give `gnus' a
non-numeric prefix - `C-u M-x gnus', in short."
:group 'gnus-server
:type '(repeat string))
+(make-obsolete-variable 'gnus-secondary-servers 'gnus-select-method "24.1")
(defcustom gnus-nntp-server nil
- "*The name of the host running the NNTP server.
-This variable is semi-obsolete. Use the `gnus-select-method'
-variable instead."
+ "The name of the host running the NNTP server."
:group 'gnus-server
:type '(choice (const :tag "disable" nil)
string))
+(make-obsolete-variable 'gnus-nntp-server 'gnus-select-method "24.1")
(defcustom gnus-secondary-select-methods nil
"A list of secondary methods that will be used for reading news.
@@ -1492,7 +1474,7 @@ Also see `gnus-large-ephemeral-newsgroup'."
integer))
(defcustom gnus-use-long-file-name (not (memq system-type '(usg-unix-v)))
- "*Non-nil means that the default name of a file to save articles in is the group name.
+ "Non-nil means that the default name of a file to save articles in is the group name.
If it's nil, the directory form of the group name is used instead.
If this variable is a list, and the list contains the element
@@ -1502,8 +1484,8 @@ saving; and if it contains the element `not-kill', long file names
will not be used for kill files.
Note that the default for this variable varies according to what system
-type you're using. On `usg-unix-v' and `xenix' this variable defaults
-to nil while on all other systems it defaults to t."
+type you're using. On `usg-unix-v' this variable defaults to nil while
+on all other systems it defaults to t."
:group 'gnus-start
:type '(radio (sexp :format "Non-nil\n"
:match (lambda (widget value)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 8ea50632a55..37956058f0e 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -78,6 +78,9 @@ Uses the same syntax as nnmail-split-methods")
(defvoo nnimap-split-fancy nil
"Uses the same syntax as nnmail-split-fancy.")
+(defvoo nnimap-unsplittable-articles '(%Deleted %Seen)
+ "Articles with the flags in the list will not be considered when splitting.")
+
(make-obsolete-variable 'nnimap-split-rule "see `nnimap-split-methods'"
"Emacs 24.1")
@@ -412,9 +415,18 @@ textual parts.")
;; physical address.
(nnimap-credentials nnimap-address ports)))))
(setq nnimap-object nil)
- (setq login-result (nnimap-command "LOGIN %S %S"
- (car credentials)
- (cadr credentials)))
+ (setq login-result
+ (if (member "AUTH=PLAIN"
+ (nnimap-capabilities nnimap-object))
+ (nnimap-command
+ "AUTHENTICATE PLAIN %s"
+ (base64-encode-string
+ (format "\000%s\000%s"
+ (nnimap-quote-specials (car credentials))
+ (nnimap-quote-specials (cadr credentials)))))
+ (nnimap-command "LOGIN %S %S"
+ (car credentials)
+ (cadr credentials))))
(unless (car login-result)
;; If the login failed, then forget the credentials
;; that are now possibly cached.
@@ -431,6 +443,16 @@ textual parts.")
(nnimap-command "ENABLE QRESYNC"))
(nnimap-process nnimap-object))))))))
+(defun nnimap-quote-specials (string)
+ (with-temp-buffer
+ (insert string)
+ (goto-char (point-min))
+ (while (re-search-forward "[\\\"]" nil t)
+ (forward-char -1)
+ (insert "\\")
+ (forward-char 1))
+ (buffer-string)))
+
(defun nnimap-find-parameter (parameter elems)
(let (result)
(dolist (elem elems)
@@ -1593,6 +1615,7 @@ textual parts.")
new-articles)
(erase-buffer)
(nnimap-command "SELECT %S" nnimap-inbox)
+ (setf (nnimap-group nnimap-object) nnimap-inbox)
(setq new-articles (nnimap-new-articles (nnimap-get-flags "1:*")))
(when new-articles
(nnimap-fetch-inbox new-articles)
@@ -1665,9 +1688,8 @@ textual parts.")
(defun nnimap-new-articles (flags)
(let (new)
(dolist (elem flags)
- (when (or (null (cdr elem))
- (and (not (memq '%Deleted (cdr elem)))
- (not (memq '%Seen (cdr elem)))))
+ (unless (gnus-list-memq-of-list nnimap-unsplittable-articles
+ (cdr elem))
(push (car elem) new)))
(gnus-compress-sequence (nreverse new))))
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 8bb532eb27e..bbb7ff18a46 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -90,6 +90,7 @@ cid: URL as the argument.")
(defvar shr-list-mode nil)
(defvar shr-content-cache nil)
(defvar shr-kinsoku-shorten nil)
+(defvar shr-table-depth 0)
(defvar shr-map
(let ((map (make-sparse-keymap)))
@@ -369,18 +370,17 @@ redirects somewhere else."
(let ((alt (buffer-substring start end))
(inhibit-read-only t))
(delete-region start end)
- (shr-put-image data start alt))))))
+ (goto-char start)
+ (shr-put-image data alt))))))
(kill-buffer (current-buffer)))
-(defun shr-put-image (data point alt)
+(defun shr-put-image (data alt)
(if (display-graphic-p)
(let ((image (ignore-errors
(shr-rescale-image data))))
(when image
- (put-image image point alt)))
- (save-excursion
- (goto-char point)
- (insert alt))))
+ (insert-image image (or alt "*"))))
+ (insert alt)))
(defun shr-rescale-image (data)
(if (or (not (fboundp 'imagemagick-types))
@@ -470,14 +470,6 @@ Return a string with image data."
(defun shr-tag-s (cont)
(shr-fontize-cont cont 'strike-through))
-(defun shr-tag-span (cont)
- (let ((start (point))
- (color (cdr (assq 'color (shr-parse-style (cdr (assq :style cont)))))))
- (shr-generic cont)
- (when color
- (let ((overlay (make-overlay start (point))))
- (overlay-put overlay 'face (cons 'foreground-color color))))))
-
(defun shr-parse-style (style)
(when style
(let ((plist nil))
@@ -501,24 +493,43 @@ Return a string with image data."
(shr-urlify (or shr-start start) url)))
(defun shr-tag-object (cont)
- (let ((url (cdr (assq :src (cdr (assq 'embed cont)))))
- (start (point)))
+ (let ((start (point))
+ url)
+ (dolist (elem cont)
+ (when (eq (car elem) 'embed)
+ (setq url (or url (cdr (assq :src (cdr elem))))))
+ (when (and (eq (car elem) 'param)
+ (equal (cdr (assq :name (cdr elem))) "movie"))
+ (setq url (or url (cdr (assq :value (cdr elem)))))))
(when url
(shr-insert " [multimedia] ")
- (shr-urlify start url))))
+ (shr-urlify start url))
+ (shr-generic cont)))
+
+(defun shr-tag-video (cont)
+ (let ((image (cdr (assq :poster cont)))
+ (url (cdr (assq :src cont)))
+ (start (point)))
+ (shr-tag-img nil image)
+ (shr-urlify start url)))
-(defun shr-tag-img (cont)
- (when (and cont
- (cdr (assq :src cont)))
+(defun shr-tag-img (cont &optional url)
+ (when (or url
+ (and cont
+ (cdr (assq :src cont))))
(when (and (> (current-column) 0)
(not (eq shr-state 'image)))
(insert "\n"))
(let ((alt (cdr (assq :alt cont)))
- (url (cdr (assq :src cont))))
+ (url (or url (cdr (assq :src cont)))))
(let ((start (point-marker)))
(when (zerop (length alt))
(setq alt "[img]"))
(cond
+ ((or (member (cdr (assq :height cont)) '("0" "1"))
+ (member (cdr (assq :width cont)) '("0" "1")))
+ ;; Ignore zero-sized or single-pixel images.
+ )
((and (not shr-inhibit-images)
(string-match "\\`cid:" url))
(let ((url (substring url (match-end 0)))
@@ -526,7 +537,7 @@ Return a string with image data."
(if (or (not shr-content-function)
(not (setq image (funcall shr-content-function url))))
(insert alt)
- (shr-put-image image (point) alt))))
+ (shr-put-image image alt))))
((or shr-inhibit-images
(and shr-blocked-images
(string-match shr-blocked-images url)))
@@ -536,17 +547,17 @@ Return a string with image data."
(shr-insert (substring alt 0 8))
(shr-insert alt))))
((url-is-cached (shr-encode-url url))
- (shr-put-image (shr-get-image-data url) (point) alt))
+ (shr-put-image (shr-get-image-data url) alt))
(t
(insert alt)
(ignore-errors
(url-retrieve (shr-encode-url url) 'shr-image-fetched
(list (current-buffer) start (point-marker))
t))))
- (insert " ")
(put-text-property start (point) 'keymap shr-map)
(put-text-property start (point) 'shr-alt alt)
(put-text-property start (point) 'shr-image url)
+ (put-text-property start (point) 'help-echo alt)
(setq shr-state 'image)))))
(defun shr-tag-pre (cont)
@@ -630,6 +641,7 @@ Return a string with image data."
(setq cont (or (cdr (assq 'tbody cont))
cont))
(let* ((shr-inhibit-images t)
+ (shr-table-depth (1+ shr-table-depth))
(shr-kinsoku-shorten t)
;; Find all suggested widths.
(columns (shr-column-specs cont))
@@ -651,8 +663,9 @@ Return a string with image data."
;; Finally, insert all the images after the table. The Emacs buffer
;; model isn't strong enough to allow us to put the images actually
;; into the tables.
- (dolist (elem (shr-find-elements cont 'img))
- (shr-tag-img (cdr elem))))
+ (when (zerop shr-table-depth)
+ (dolist (elem (shr-find-elements cont 'img))
+ (shr-tag-img (cdr elem)))))
(defun shr-tag-table (cont)
(shr-ensure-paragraph)