summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-01-17 17:12:34 -0600
committerCase Duckworth2022-01-17 17:12:34 -0600
commit309a34cea5a22d082fce87a1ecea378c41b17ff5 (patch)
tree6f09c3921dff7af029d04686f4127f0ce1c653f4
parentSo! Many! Changes!! (diff)
downloademacs-309a34cea5a22d082fce87a1ecea378c41b17ff5.tar.gz
emacs-309a34cea5a22d082fce87a1ecea378c41b17ff5.zip
Open local HTML files with `browse-url'
-rw-r--r--init.el2
-rw-r--r--lisp/+org.el10
2 files changed, 12 insertions, 0 deletions
diff --git a/init.el b/init.el index 4eb8cdd..4438393 100644 --- a/init.el +++ b/init.el
@@ -490,6 +490,8 @@
490 "|" "DONE(d!)") 490 "|" "DONE(d!)")
491 (sequence "|" "CANCELED(k!)") 491 (sequence "|" "CANCELED(k!)")
492 (sequence "MEETING(m)"))) 492 (sequence "MEETING(m)")))
493 (setf (alist-get "\\.x?html?\\'" org-file-apps nil nil #'equal)
494 #'+org-open-html)
493 (:bind "RET" #'+org-return-dwim 495 (:bind "RET" #'+org-return-dwim
494 "<S-return>" #'+org-table-copy-down 496 "<S-return>" #'+org-table-copy-down
495 "C-c C-l" #'+org-insert-link-dwim 497 "C-c C-l" #'+org-insert-link-dwim
diff --git a/lisp/+org.el b/lisp/+org.el index 348ba6e..5869622 100644 --- a/lisp/+org.el +++ b/lisp/+org.el
@@ -442,5 +442,15 @@ the deletion might narrow the column."
442 (org-up-heading-all 1)) 442 (org-up-heading-all 1))
443 (org-open-at-point arg))))) 443 (org-open-at-point arg)))))
444 444
445;;; Open local HTML files with `browse-url'
446
447(defun +org-open-html (file-path link-string)
448 "Open FILE-PATH with `browse-url'.
449This function is intended to use with `org-file-apps'. See the
450documentation of that function for a description of the two
451arguments here, FILE-PATH and LINK-STRING."
452 (message "Opening %s (%s)..." file-path link-string)
453 (browse-url file-path))
454
445(provide '+org) 455(provide '+org)
446;;; +org.el ends here 456;;; +org.el ends here