* 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'.
This commit is contained in:
Stefan Monnier 2013-12-16 21:48:06 -05:00
parent 5556c0cef1
commit e914544431
2 changed files with 20 additions and 15 deletions

View file

@ -1,3 +1,11 @@
2013-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
* 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 <dgutov@yandex.ru>
* emacs-lisp/smie.el (smie-indent--rule): Extract `smie-indent--rule-1'.

View file

@ -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 <a name="foo"> 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"))