From e9145444310f03b0b9bdcf9a227376282be45b67 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 16 Dec 2013 21:48:06 -0500 Subject: [PATCH] * lisp/net/shr.el (shr-insert-document): Remove unused var `shr-preliminary-table-render'. (shr-rescale-image): Remove unused arg `force'. (shr-put-image): Update calls accordingly. (shr-tag-a): Use `cont' rather than dyn-bound `dom'. --- lisp/ChangeLog | 8 ++++++++ lisp/net/shr.el | 27 ++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4835311599..a0651917f3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-12-17 Stefan Monnier + + * net/shr.el (shr-insert-document): Remove unused var + `shr-preliminary-table-render'. + (shr-rescale-image): Remove unused arg `force'. + (shr-put-image): Update calls accordingly. + (shr-tag-a): Use `cont' rather than dyn-bound `dom'. + 2013-12-17 Dmitry Gutov * emacs-lisp/smie.el (smie-indent--rule): Extract `smie-indent--rule-1'. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 34672b2819..81a597c270 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -196,7 +196,6 @@ DOM should be a parse tree as generated by (shr-state nil) (shr-start nil) (shr-base nil) - (shr-preliminary-table-render 0) (shr-width (or shr-width (1- (window-width))))) (shr-descend (shr-transform-dom dom)) (shr-remove-trailing-whitespace start (point)))) @@ -380,8 +379,7 @@ size, and full-buffer size." (setq shr-stylesheet (nconc (shr-parse-style style) shr-stylesheet)) (setq style nil))) - ;; If we have a display:none, then just ignore this part of the - ;; DOM. + ;; If we have a display:none, then just ignore this part of the DOM. (unless (equal (cdr (assq 'display shr-stylesheet)) "none") (if (fboundp function) (funcall function (cdr dom)) @@ -754,10 +752,10 @@ element is the data blob and the second element is the content-type." :format content-type)) ((eq size 'full) (ignore-errors - (shr-rescale-image data t content-type))) + (shr-rescale-image data content-type))) (t (ignore-errors - (shr-rescale-image data nil content-type)))))) + (shr-rescale-image data content-type)))))) (when image ;; When inserting big-ish pictures, put them at the ;; beginning of the line. @@ -779,11 +777,10 @@ element is the data blob and the second element is the content-type." image) (insert alt))) -(defun shr-rescale-image (data &optional force content-type) - "Rescale DATA, if too big, to fit the current buffer. -If FORCE, rescale the image anyway." - (if (or (not (fboundp 'imagemagick-types)) - (not (get-buffer-window (current-buffer)))) +(defun shr-rescale-image (data &optional content-type) + "Rescale DATA, if too big, to fit the current buffer." + (if (not (and (fboundp 'imagemagick-types) + (get-buffer-window (current-buffer)))) (create-image data nil t :ascent 100) (let ((edges (window-inside-pixel-edges (get-buffer-window (current-buffer))))) @@ -964,13 +961,13 @@ ones, in case fg and bg are nil." (shr-generic cont) (shr-colorize-region start (point) fgcolor bgcolor))) -(defun shr-tag-style (cont) +(defun shr-tag-style (_cont) ) -(defun shr-tag-script (cont) +(defun shr-tag-script (_cont) ) -(defun shr-tag-comment (cont) +(defun shr-tag-comment (_cont) ) (defun shr-dom-to-xml (dom) @@ -1079,7 +1076,7 @@ ones, in case fg and bg are nil." shr-start) (shr-generic cont) (when (and shr-target-id - (equal (cdr (assq :name (cdr dom))) shr-target-id)) + (equal (cdr (assq :name cont)) shr-target-id)) ;; We have a zero-length element, so just ;; insert... something. (when (= start (point)) @@ -1326,7 +1323,7 @@ The preference is a float determined from `shr-prefer-media-type'." (defun shr-tag-h6 (cont) (shr-heading cont)) -(defun shr-tag-hr (cont) +(defun shr-tag-hr (_cont) (shr-ensure-newline) (insert (make-string shr-width shr-hr-line) "\n")) -- 2.20.1