Fix org-board-open-with advice

This commit is contained in:
Jeremy Dormitzer 2020-02-23 09:56:12 -05:00
parent 46ca98bd12
commit b7bf077b7f

View File

@ -1943,15 +1943,17 @@ Intelligently inserts an org-mode link from the clipboard.
;; Use w3m instead of eww to open org-board archived links ;; Use w3m instead of eww to open org-board archived links
(advice-add 'org-board-open-with :around (advice-add 'org-board-open-with :around
(lambda (oldfn filename-string arg &rest args) (lambda (oldfn filename-string arg &rest args)
(if (and filename-string (cond
(or (and arg (eq org-board-default-browser 'system)) ((not (file-exists-p filename-string)) 1)
(and (not arg) (eq org-board-default-browser 'eww)))) ((and filename-string
(let ((filename (concat "file://" (or (and arg (eq org-board-default-browser 'system))
(s-chop-prefix "file://" (and (not arg) (eq org-board-default-browser 'eww))))
filename-string)))) (let ((filename (concat "file://"
(w3m filename t) (s-chop-prefix "file://"
0) filename-string))))
(apply oldfn filename-string arg args)))) (w3m filename t)
0))
(:else (apply oldfn filename-string arg args)))))
:general :general
(org-mode-map "C-c b" org-board-keymap)) (org-mode-map "C-c b" org-board-keymap))
#+END_SRC #+END_SRC