Skip to content

Commit

Permalink
Clean up org-board-options-handler, add page separation.
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesroelli committed Nov 12, 2016
1 parent fcc6537 commit 3ddccc0
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions org-board.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
"--page-requisites"
"--adjust-extension"
"--convert-links")
;; "--span-hosts")
;; --span-hosts is useful when files are referenced from CDNs
;; (i.e. other hosts).
"The default switches to pass to wget."
:type '(repeat string))

Expand Down Expand Up @@ -150,6 +147,8 @@ for `wget', like `--no-check-certificate'."
(define-key org-board-keymap "c" 'org-board-cancel)
(define-key org-board-keymap "O" 'org-attach-reveal-in-emacs)



(defun org-board-wget-process-sentinel-function (process event)
"Outputs debug info to org-board buffer when wget exits abnormally.
Expand Down Expand Up @@ -210,6 +209,8 @@ Returns the process associated with wget."
'org-board-wget-process-sentinel-function))
wget-process))



;;;###autoload
(defun org-board-archive ()
"Archive the URL given by the current entry's :URL: property.
Expand Down Expand Up @@ -290,20 +291,15 @@ according to `org-board-domain-regexp-alist'."
;;;###autoload
(defun org-board-options-handler (wget-options)
"Expand WGET_OPTIONS according to `org-board-agent-header-alist'."
(apply 'append
;; FIXME: See 5.4 in the Emacs manual, "Building Lists". Why
;; does mapcar here generate a list of lists? (ref "apply
;; 'append" halfway through the manual entry) I needed
;; "'apply append", otherwise mapcar returns a list of lists.
(let ((wget-options-expanded))
(mapcar #'(lambda (wget-option)
(let ((expanded
(assoc wget-option
org-board-agent-header-alist)))
(if expanded
(cons (cdr expanded) wget-options-expanded)
(cons wget-option wget-options-expanded))))
wget-options))))
(let ((wget-options-expanded))
(mapcar #'(lambda (wget-option)
(let ((expanded (assoc wget-option
org-board-agent-header-alist)))
(if expanded
(add-to-list 'wget-options-expanded (cdr expanded))
(add-to-list 'wget-options-expanded wget-option))))
wget-options)
wget-options-expanded))

;;;###autoload
(defun org-board-delete-all ()
Expand Down

0 comments on commit 3ddccc0

Please sign in to comment.