You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.8 KiB
EmacsLisp
60 lines
1.8 KiB
EmacsLisp
;;; $DOOMDIR/user/org.el -*- lexical-binding: t; -*-
|
|
|
|
(add-hook! 'org-mode-hook 'org-num-mode)
|
|
(setq org-directory "~/org/")
|
|
(setq org-noter-notes-search-path '("~/Documents/notes/"))
|
|
(after! org
|
|
(setq org-agenda-files
|
|
'("~/Documents/agendas"))
|
|
(org-link-set-parameters "rel" :follow #'browse-url :export #'wvxvw/export-rel-url)
|
|
(set-company-backend!
|
|
'org-mode
|
|
'company-capf 'company-files)
|
|
(setq org-todo-keywords
|
|
'((sequence
|
|
"TODO(t)"
|
|
"BLOCKED(b)"
|
|
"WIP(w)"
|
|
"REVIEW(r)"
|
|
"|"
|
|
"CLOSED(c)"
|
|
"RESOLVED(R)"
|
|
"DONE(d)"))))
|
|
|
|
|
|
|
|
;; (setcdr (assq 'system org-file-apps-defaults-gnu) "xdg-open %s")
|
|
(setcdr (assq 'system org-file-apps-gnu) "xdg-open %s")
|
|
|
|
(advice-add 'org-open-file :around
|
|
(lambda (orig-fun &rest args)
|
|
;; Work around a weird problem with xdg-open.
|
|
(let ((process-connection-type nil))
|
|
(apply orig-fun args))))
|
|
|
|
(defun org-table-import-xlsx-to-csv-org ()
|
|
(interactive)
|
|
(let* ((source-file (file-name-sans-extension (buffer-file-name
|
|
(current-buffer))))
|
|
(xlsx-file (concat source-file ".xlsx"))
|
|
(csv-file (concat source-file ".csv")))
|
|
(org-odt-convert xlsx-file "csv")
|
|
(org-table-import csv-file nil)))
|
|
|
|
|
|
(defun org-table-import-xlsx-file-to-csv-org (file)
|
|
(interactive "f")
|
|
(let* ((source-file (file-name-sans-extension (buffer-file-name
|
|
(current-buffer))))
|
|
(xlsx-file (concat source-file ".xlsx"))
|
|
(csv-file (concat source-file ".csv")))
|
|
(org-odt-convert file "csv")
|
|
(org-table-import csv-file nil)))
|
|
|
|
;; I originally added this to fix relative links when converting org to html links but I'm pretty sure it doesn't even work
|
|
(defun wvxvw/export-rel-url (path desc format)
|
|
(cl-case format
|
|
(html (format "<a href=\"%s\">%s</a>" path (or desc path)))
|
|
(latex (format "\\href{%s}{%s}" path (or desc path)))
|
|
(otherwise path)))
|