aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2017-05-23 09:09:28 -0400
committerStefan Monnier2017-05-23 09:09:28 -0400
commita8d0a91841121a7bdae668a5f29c1ba84739e14f (patch)
treecf242f14f7e501cf7f59eba9601ec77687ddbcea
parent91b114354d32b5eacdfab4996cae0f3b9b4cc628 (diff)
downloademacs-a8d0a91841121a7bdae668a5f29c1ba84739e14f.tar.gz
emacs-a8d0a91841121a7bdae668a5f29c1ba84739e14f.zip
* lisp/net/shr.el: Use cl-lib instead of cl.
-rw-r--r--lisp/net/shr.el29
1 files changed, 15 insertions, 14 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 6b62a05227c..2a6b3960c46 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -30,7 +30,7 @@
30 30
31;;; Code: 31;;; Code:
32 32
33(eval-when-compile (require 'cl)) 33(eval-when-compile (require 'cl-lib))
34(eval-when-compile (require 'url)) ;For url-filename's setf handler. 34(eval-when-compile (require 'url)) ;For url-filename's setf handler.
35(require 'browse-url) 35(require 'browse-url)
36(eval-when-compile (require 'subr-x)) 36(eval-when-compile (require 'subr-x))
@@ -1790,14 +1790,14 @@ The preference is a float determined from `shr-prefer-media-type'."
1790 (elems (or (dom-attr dom 'shr-suggested-widths) 1790 (elems (or (dom-attr dom 'shr-suggested-widths)
1791 (shr-make-table dom suggested-widths nil 1791 (shr-make-table dom suggested-widths nil
1792 'shr-suggested-widths))) 1792 'shr-suggested-widths)))
1793 (sketch (loop for line in elems 1793 (sketch (cl-loop for line in elems
1794 collect (mapcar #'car line))) 1794 collect (mapcar #'car line)))
1795 (natural (loop for line in elems 1795 (natural (cl-loop for line in elems
1796 collect (mapcar #'cdr line))) 1796 collect (mapcar #'cdr line)))
1797 (sketch-widths (shr-table-widths sketch natural suggested-widths))) 1797 (sketch-widths (shr-table-widths sketch natural suggested-widths)))
1798 ;; This probably won't work very well. 1798 ;; This probably won't work very well.
1799 (when (> (+ (loop for width across sketch-widths 1799 (when (> (+ (cl-loop for width across sketch-widths
1800 summing (1+ width)) 1800 summing (1+ width))
1801 shr-indentation shr-table-separator-pixel-width) 1801 shr-indentation shr-table-separator-pixel-width)
1802 (frame-width)) 1802 (frame-width))
1803 (setq truncate-lines t)) 1803 (setq truncate-lines t))
@@ -2315,13 +2315,14 @@ flags that control whether to collect or render objects."
2315(defun shr-dom-max-natural-width (dom max) 2315(defun shr-dom-max-natural-width (dom max)
2316 (if (eq (dom-tag dom) 'table) 2316 (if (eq (dom-tag dom) 'table)
2317 (max max (or 2317 (max max (or
2318 (loop for line in (dom-attr dom 'shr-suggested-widths) 2318 (cl-loop
2319 maximize (+ 2319 for line in (dom-attr dom 'shr-suggested-widths)
2320 shr-table-separator-length 2320 maximize (+
2321 (loop for elem in line 2321 shr-table-separator-length
2322 summing 2322 (cl-loop for elem in line
2323 (+ (cdr elem) 2323 summing
2324 (* 2 shr-table-separator-length))))) 2324 (+ (cdr elem)
2325 (* 2 shr-table-separator-length)))))
2325 0)) 2326 0))
2326 (dolist (child (dom-children dom)) 2327 (dolist (child (dom-children dom))
2327 (unless (stringp child) 2328 (unless (stringp child)