From b7bf077b7f027a03e625b16a11cf10952f6c3da3 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sun, 23 Feb 2020 09:56:12 -0500 Subject: [PATCH] Fix org-board-open-with advice --- emacs/init.org | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index d90ba16..f70c485 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -1943,15 +1943,17 @@ Intelligently inserts an org-mode link from the clipboard. ;; Use w3m instead of eww to open org-board archived links (advice-add 'org-board-open-with :around (lambda (oldfn filename-string arg &rest args) - (if (and filename-string - (or (and arg (eq org-board-default-browser 'system)) - (and (not arg) (eq org-board-default-browser 'eww)))) - (let ((filename (concat "file://" - (s-chop-prefix "file://" - filename-string)))) - (w3m filename t) - 0) - (apply oldfn filename-string arg args)))) + (cond + ((not (file-exists-p filename-string)) 1) + ((and filename-string + (or (and arg (eq org-board-default-browser 'system)) + (and (not arg) (eq org-board-default-browser 'eww)))) + (let ((filename (concat "file://" + (s-chop-prefix "file://" + filename-string)))) + (w3m filename t) + 0)) + (:else (apply oldfn filename-string arg args))))) :general (org-mode-map "C-c b" org-board-keymap)) #+END_SRC