;; into the buffer:
;;
;; (setq svg (svg-create 800 800 :stroke "orange" :stroke-width 5))
-;; (svg-gradient svg "gradient" 'linear '(0 . "red") '(100 . "blue"))
+;; (svg-gradient svg "gradient" 'linear '((0 . "red") (100 . "blue")))
;; (save-excursion (goto-char (point-max)) (svg-insert-image svg))
;; Then add various elements to the structure:
(svg--def
svg
(apply
- 'dom-node
+ #'dom-node
(if (eq type 'linear)
'linearGradient
'radialGradient)
(plist-get command-args :default-relative))))
(intern (if relative (downcase char) (upcase char)))))
-(defun svg--elliptical-arc-coordinates
- (rx ry x y &rest args)
+(defun svg--elliptical-arc-coordinates (rx ry x y &rest args)
(list
rx ry
(or (plist-get args :x-axis-rotation) 0)
(defun svg--elliptical-arc-command (coordinates-list &rest args)
(cons
(svg--path-command-symbol 'a args)
- (apply 'append
- (mapcar
- (lambda (coordinates)
- (apply 'svg--elliptical-arc-coordinates
- coordinates))
- coordinates-list))))
+ (mapcan
+ (lambda (coordinates)
+ (apply #'svg--elliptical-arc-coordinates
+ coordinates))
+ coordinates-list)))
(defun svg--moveto-command (coordinates-list &rest args)
(cons
(svg--path-command-symbol 'm args)
- (apply 'append
- (mapcar
- (lambda (coordinates)
- (list (car coordinates) (cdr coordinates)))
- coordinates-list))))
+ (mapcan
+ (lambda (coordinates)
+ (list (car coordinates) (cdr coordinates)))
+ coordinates-list)))
(defun svg--closepath-command (&rest args)
(list (svg--path-command-symbol 'z args)))
(defun svg--lineto-command (coordinates-list &rest args)
(cons
(svg--path-command-symbol 'l args)
- (apply 'append
- (mapcar
- (lambda (coordinates)
- (list (car coordinates) (cdr coordinates)))
- coordinates-list))))
+ (mapcan
+ (lambda (coordinates)
+ (list (car coordinates) (cdr coordinates)))
+ coordinates-list)))
(defun svg--horizontal-lineto-command (coordinate-list &rest args)
(cons
(defun svg--curveto-command (coordinates-list &rest args)
(cons
(svg--path-command-symbol 'c args)
- (apply 'append coordinates-list)))
+ (apply #'append coordinates-list)))
(defun svg--smooth-curveto-command (coordinates-list &rest args)
(cons
(svg--path-command-symbol 's args)
- (apply 'append coordinates-list)))
+ (apply #'append coordinates-list)))
(defun svg--quadratic-bezier-curveto-command (coordinates-list
&rest args)
(cons
(svg--path-command-symbol 'q args)
- (apply 'append coordinates-list)))
+ (apply #'append coordinates-list)))
(defun svg--smooth-quadratic-bezier-curveto-command (coordinates-list
&rest args)
(cons
(svg--path-command-symbol 't args)
- (apply 'append coordinates-list)))
+ (apply #'append coordinates-list)))
(defun svg--eval-path-command (command default-relative)
(cl-letf
#'svg--elliptical-arc-command)
(extended-command (append command (list :default-relative
default-relative))))
- (mapconcat 'prin1-to-string (apply extended-command) " ")))
+ (mapconcat #'prin1-to-string (apply extended-command) " ")))
(defun svg-path (svg commands &rest args)
"Add the outline of a shape to SVG according to COMMANDS.
the last position, or -- initially -- to the origin."
(let* ((default-relative (plist-get args :relative))
(stripped-args (svg--plist-delete args :relative))
- (d (mapconcat 'identity
+ (d (mapconcat #'identity
(mapcar
(lambda (command)
(svg--eval-path-command command