aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/gnus
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog40
-rw-r--r--lisp/gnus/gnus-sum.el9
-rw-r--r--lisp/gnus/nnimap.el23
-rw-r--r--lisp/gnus/shr-color.el9
-rw-r--r--lisp/gnus/shr.el22
5 files changed, 86 insertions, 17 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 740a2340243..7c83b9d99de 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,43 @@
12012-02-07 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-sum.el (gnus-summary-show-thread): Revert last two changes.
4
52012-02-07 Lars Ingebrigtsen <larsi@gnus.org>
6
7 * nnimap.el (nnimap-transform-headers): Remove unused variable.
8 (nnimap-transform-headers): Fix parsing BODYSTRUCTURE elements that
9 have newlines within the strings, and where the UID comes after the
10 BODYSTRUCTURE element (bug#10537).
11
12 * shr-color.el (shr-color-set-minimum-interval): Renamed to add prefix
13 (bug#10732).
14
15 * shr.el (shr-insert-document): Add doc string.
16 (shr-visit-file): Ditto.
17 (shr-remove-trailing-whitespace): New function.
18 (shr-insert-document): Use it to clean up trailing whitespace as the
19 final step (bug#10714).
20
212012-02-06 Lars Ingebrigtsen <larsi@gnus.org>
22
23 * gnus-sum.el (gnus-summary-exit-no-update): Really deaden the summary
24 buffer if `gnus-kill-summary-on-exit' is nil.
25
262012-02-06 Katsumi Yamaoka <yamaoka@jpl.org>
27
28 * gnus-sum.el (gnus-summary-show-thread):
29 next-single-char-property-change may return nil in XEmacs.
30
312012-02-06 Lars Ingebrigtsen <larsi@gnus.org>
32
33 * gnus-sum.el (gnus-handle-ephemeral-exit): Allow exiting from Gnus
34 when just reading a single group from "without" Gnus.
35
362012-02-06 Chong Yidong <cyd@gnu.org>
37
38 * gnus-sum.el (gnus-summary-show-thread):
39 next-single-char-property-change never returns nil (Bug#8657).
40
12012-02-05 Lars Ingebrigtsen <larsi@gnus.org> 412012-02-05 Lars Ingebrigtsen <larsi@gnus.org>
2 42
3 * nnimap.el (nnimap-open-server): Allow switching the nnoo server 43 * nnimap.el (nnimap-open-server): Allow switching the nnoo server
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index d0a582e2712..296f25a09f9 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -7328,9 +7328,11 @@ If FORCE (the prefix), also save the .newsrc file(s)."
7328 (gnus-kill-buffer gnus-original-article-buffer) 7328 (gnus-kill-buffer gnus-original-article-buffer)
7329 (setq gnus-article-current nil)) 7329 (setq gnus-article-current nil))
7330 ;; Return to the group buffer. 7330 ;; Return to the group buffer.
7331 (gnus-configure-windows 'group 'force)
7332 (if (not gnus-kill-summary-on-exit) 7331 (if (not gnus-kill-summary-on-exit)
7333 (gnus-deaden-summary) 7332 (progn
7333 (gnus-deaden-summary)
7334 (gnus-configure-windows 'group 'force))
7335 (gnus-configure-windows 'group 'force)
7334 (gnus-close-group group) 7336 (gnus-close-group group)
7335 (gnus-kill-buffer gnus-summary-buffer)) 7337 (gnus-kill-buffer gnus-summary-buffer))
7336 (unless gnus-single-article-buffer 7338 (unless gnus-single-article-buffer
@@ -7352,7 +7354,7 @@ If FORCE (the prefix), also save the .newsrc file(s)."
7352(defun gnus-handle-ephemeral-exit (quit-config) 7354(defun gnus-handle-ephemeral-exit (quit-config)
7353 "Handle movement when leaving an ephemeral group. 7355 "Handle movement when leaving an ephemeral group.
7354The state which existed when entering the ephemeral is reset." 7356The state which existed when entering the ephemeral is reset."
7355 (if (not (buffer-name (car quit-config))) 7357 (if (not (buffer-live-p (car quit-config)))
7356 (gnus-configure-windows 'group 'force) 7358 (gnus-configure-windows 'group 'force)
7357 (set-buffer (car quit-config)) 7359 (set-buffer (car quit-config))
7358 (unless (eq (cdr quit-config) 'group) 7360 (unless (eq (cdr quit-config) 'group)
@@ -11579,6 +11581,7 @@ Returns nil if no thread was there to be shown."
11579 (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point))))) 11581 (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point)))))
11580 (eoi (when end 11582 (eoi (when end
11581 (if (fboundp 'next-single-char-property-change) 11583 (if (fboundp 'next-single-char-property-change)
11584 ;; Note: XEmacs version of n-s-c-p-c may return nil
11582 (or (next-single-char-property-change end 'invisible) 11585 (or (next-single-char-property-change end 'invisible)
11583 (point-max)) 11586 (point-max))
11584 (while (progn 11587 (while (progn
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 09cf554312b..4c75f721ff6 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -189,25 +189,32 @@ textual parts.")
189 189
190(defun nnimap-transform-headers () 190(defun nnimap-transform-headers ()
191 (goto-char (point-min)) 191 (goto-char (point-min))
192 (let (article bytes lines size string) 192 (let (article lines size string)
193 (block nil 193 (block nil
194 (while (not (eobp)) 194 (while (not (eobp))
195 (while (not (looking-at "\\* [0-9]+ FETCH.+?UID \\([0-9]+\\)")) 195 (while (not (looking-at "\\* [0-9]+ FETCH"))
196 (delete-region (point) (progn (forward-line 1) (point))) 196 (delete-region (point) (progn (forward-line 1) (point)))
197 (when (eobp) 197 (when (eobp)
198 (return))) 198 (return)))
199 (setq article (match-string 1)) 199 (goto-char (match-end 0))
200 ;; Unfold quoted {number} strings. 200 ;; Unfold quoted {number} strings.
201 (while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r?\n" 201 (while (re-search-forward
202 (1+ (line-end-position)) t) 202 "[^]][ (]{\\([0-9]+\\)}\r?\n"
203 (save-excursion
204 (or (re-search-forward "\\* [0-9]+ FETCH" nil t)
205 (point-max)))
206 t)
203 (setq size (string-to-number (match-string 1))) 207 (setq size (string-to-number (match-string 1)))
204 (delete-region (+ (match-beginning 0) 2) (point)) 208 (delete-region (+ (match-beginning 0) 2) (point))
205 (setq string (buffer-substring (point) (+ (point) size))) 209 (setq string (buffer-substring (point) (+ (point) size)))
206 (delete-region (point) (+ (point) size)) 210 (delete-region (point) (+ (point) size))
207 (insert (format "%S" string))) 211 (insert (format "%S" (mm-subst-char-in-string ?\n ?\s string))))
208 (setq bytes (nnimap-get-length)
209 lines nil)
210 (beginning-of-line) 212 (beginning-of-line)
213 (setq article
214 (and (re-search-forward "UID \\([0-9]+\\)" (line-end-position)
215 t)
216 (match-string 1)))
217 (setq lines nil)
211 (setq size 218 (setq size
212 (and (re-search-forward "RFC822.SIZE \\([0-9]+\\)" 219 (and (re-search-forward "RFC822.SIZE \\([0-9]+\\)"
213 (line-end-position) 220 (line-end-position)
diff --git a/lisp/gnus/shr-color.el b/lisp/gnus/shr-color.el
index e23ab57965e..7011034d242 100644
--- a/lisp/gnus/shr-color.el
+++ b/lisp/gnus/shr-color.el
@@ -267,7 +267,8 @@ Like rgb() or hsl()."
267 (t 267 (t
268 nil)))) 268 nil))))
269 269
270(defun set-minimum-interval (val1 val2 min max interval &optional fixed) 270(defun shr-color-set-minimum-interval (val1 val2 min max interval
271 &optional fixed)
271 "Set minimum interval between VAL1 and VAL2 to INTERVAL. 272 "Set minimum interval between VAL1 and VAL2 to INTERVAL.
272The values are bound by MIN and MAX. 273The values are bound by MIN and MAX.
273If FIXED is t, then VAL1 will not be touched." 274If FIXED is t, then VAL1 will not be touched."
@@ -341,9 +342,9 @@ color will be adapted to be visible on BG."
341 (>= luminance-distance shr-color-visible-luminance-min)) 342 (>= luminance-distance shr-color-visible-luminance-min))
342 (list bg fg) 343 (list bg fg)
343 ;; Not visible, try to change luminance to make them visible 344 ;; Not visible, try to change luminance to make them visible
344 (let ((Ls (set-minimum-interval (car bg-lab) (car fg-lab) 0 100 345 (let ((Ls (shr-color-set-minimum-interval
345 shr-color-visible-luminance-min 346 (car bg-lab) (car fg-lab) 0 100
346 fixed-background))) 347 shr-color-visible-luminance-min fixed-background)))
347 (unless fixed-background 348 (unless fixed-background
348 (setcar bg-lab (car Ls))) 349 (setcar bg-lab (car Ls)))
349 (setcar fg-lab (cadr Ls)) 350 (setcar fg-lab (cadr Ls))
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index acce7660263..deaef1d3f25 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -128,6 +128,7 @@ cid: URL as the argument.")
128;; Public functions and commands. 128;; Public functions and commands.
129 129
130(defun shr-visit-file (file) 130(defun shr-visit-file (file)
131 "Parse FILE as an HTML document, and render it in a new buffer."
131 (interactive "fHTML file name: ") 132 (interactive "fHTML file name: ")
132 (pop-to-buffer "*html*") 133 (pop-to-buffer "*html*")
133 (erase-buffer) 134 (erase-buffer)
@@ -139,12 +140,29 @@ cid: URL as the argument.")
139 140
140;;;###autoload 141;;;###autoload
141(defun shr-insert-document (dom) 142(defun shr-insert-document (dom)
143 "Render the parsed document DOM into the current buffer.
144DOM should be a parse tree as generated by
145`libxml-parse-html-region' or similar."
142 (setq shr-content-cache nil) 146 (setq shr-content-cache nil)
143 (let ((shr-state nil) 147 (let ((start (point))
148 (shr-state nil)
144 (shr-start nil) 149 (shr-start nil)
145 (shr-base nil) 150 (shr-base nil)
146 (shr-width (or shr-width (window-width)))) 151 (shr-width (or shr-width (window-width))))
147 (shr-descend (shr-transform-dom dom)))) 152 (shr-descend (shr-transform-dom dom))
153 (shr-remove-trailing-whitespace start (point))))
154
155(defun shr-remove-trailing-whitespace (start end)
156 (save-restriction
157 (narrow-to-region start end)
158 (delete-trailing-whitespace)
159 (goto-char start)
160 (while (not (eobp))
161 (end-of-line)
162 (dolist (overlay (overlays-at (point)))
163 (when (overlay-get overlay 'before-string)
164 (overlay-put overlay 'before-string nil)))
165 (forward-line 1))))
148 166
149(defun shr-copy-url () 167(defun shr-copy-url ()
150 "Copy the URL under point to the kill ring. 168 "Copy the URL under point to the kill ring.