diff options
| author | Lars Ingebrigtsen | 2012-02-07 00:42:21 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2012-02-07 00:42:21 +0000 |
| commit | 9ed5a258e2893669791862f8ef4c3ca34d209e75 (patch) | |
| tree | f6e3bb993ed73cd10c5ae63a1f350d2d11e0705b | |
| parent | 32dbaef2a6ea68e4f1effeb6f16c9625b63d6086 (diff) | |
| download | emacs-9ed5a258e2893669791862f8ef4c3ca34d209e75.tar.gz emacs-9ed5a258e2893669791862f8ef4c3ca34d209e75.zip | |
Merge changes made in No Gnus
shr-color.el (shr-color-set-minimum-interval): Renamed to add prefix (bug#10732).
shr.el (shr-insert-document): Add doc string.
(shr-visit-file): Ditto.
(shr-remove-trailing-whitespace): New function.
(shr-insert-document): Use it to clean up trailing whitespace as the final step (bug#10714).
gnus-sum.el (gnus-summary-exit-no-update): Really deaden the summary buffer if `gnus-kill-summary-on-exit' is nil.
| -rw-r--r-- | lisp/gnus/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 6 | ||||
| -rw-r--r-- | lisp/gnus/shr-color.el | 9 | ||||
| -rw-r--r-- | lisp/gnus/shr.el | 22 |
4 files changed, 45 insertions, 8 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index cb9888ac092..7c6388f6f25 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2012-02-07 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * shr-color.el (shr-color-set-minimum-interval): Renamed to add prefix | ||
| 4 | (bug#10732). | ||
| 5 | |||
| 6 | * shr.el (shr-insert-document): Add doc string. | ||
| 7 | (shr-visit-file): Ditto. | ||
| 8 | (shr-remove-trailing-whitespace): New function. | ||
| 9 | (shr-insert-document): Use it to clean up trailing whitespace as the | ||
| 10 | final step (bug#10714). | ||
| 11 | |||
| 12 | 2012-02-06 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 13 | |||
| 14 | * gnus-sum.el (gnus-summary-exit-no-update): Really deaden the summary | ||
| 15 | buffer if `gnus-kill-summary-on-exit' is nil. | ||
| 16 | |||
| 1 | 2012-02-06 Katsumi Yamaoka <yamaoka@jpl.org> | 17 | 2012-02-06 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 18 | ||
| 3 | * gnus-sum.el (gnus-summary-show-thread): | 19 | * gnus-sum.el (gnus-summary-show-thread): |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index c17f16ef212..c10dbe1ad8b 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 |
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. |
| 272 | The values are bound by MIN and MAX. | 273 | The values are bound by MIN and MAX. |
| 273 | If FIXED is t, then VAL1 will not be touched." | 274 | If 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. | ||
| 144 | DOM 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. |