No NARF, only DOOM
This commit is contained in:
parent
a984bf4f26
commit
ad225d2591
104 changed files with 1404 additions and 1409 deletions
|
@ -9,19 +9,19 @@
|
|||
;; for images and documents into org files
|
||||
;; + A pandoc-powered export system
|
||||
|
||||
(add-hook 'org-load-hook 'narf|org-notebook-init t)
|
||||
(add-hook 'org-load-hook 'narf|org-attach-init t)
|
||||
(add-hook 'org-load-hook 'narf|org-export-init t)
|
||||
(add-hook 'org-load-hook 'doom|org-notebook-init t)
|
||||
(add-hook 'org-load-hook 'doom|org-attach-init t)
|
||||
(add-hook 'org-load-hook 'doom|org-export-init t)
|
||||
|
||||
(defvar org-directory-notebook (expand-file-name "/notebook/" org-directory))
|
||||
(defvar org-default-notes-file (expand-file-name "inbox.org" org-directory))
|
||||
|
||||
(defvar org-attach-directory ".attach/")
|
||||
(defvar narf-org-export-directory (concat org-directory ".export"))
|
||||
(defvar narf-org-quicknote-dir (concat org-directory "Inbox/"))
|
||||
(defvar doom-org-export-directory (concat org-directory ".export"))
|
||||
(defvar doom-org-quicknote-dir (concat org-directory "Inbox/"))
|
||||
|
||||
;; Keep track of attachments
|
||||
(defvar-local narf-org-attachments-list '()
|
||||
(defvar-local doom-org-attachments-list '()
|
||||
"A list of attachments for the current buffer")
|
||||
|
||||
;; Tell helm to ignore these directories
|
||||
|
@ -31,14 +31,14 @@
|
|||
|
||||
|
||||
;;
|
||||
(defun narf|org-notebook-init ()
|
||||
(defun doom|org-notebook-init ()
|
||||
;; (define-org-section! course "Classes"
|
||||
;; (lambda (path) (substring path 0 (s-index-of " " path))) "%s*.org")
|
||||
;; (exmap "ocl[ass]" 'narf:org-search-course)
|
||||
(narf-fix-unicode "FontAwesome" '(? ? ? ? ? ? ? ? ?) 13))
|
||||
;; (exmap "ocl[ass]" 'doom:org-search-course)
|
||||
(doom-fix-unicode "FontAwesome" '(? ? ? ? ? ? ? ?) 13))
|
||||
|
||||
;;
|
||||
(defun narf|org-attach-init ()
|
||||
(defun doom|org-attach-init ()
|
||||
;; Drag-and-drop support
|
||||
(require 'org-download)
|
||||
(setq-default org-download-image-dir org-attach-directory
|
||||
|
@ -50,23 +50,23 @@
|
|||
|
||||
;; Write download paths relative to current file
|
||||
(defun org-download--dir-2 () nil)
|
||||
(defun narf*org-download--fullname (path)
|
||||
(defun doom*org-download--fullname (path)
|
||||
(f-relative path (f-dirname (buffer-file-name))))
|
||||
(advice-add 'org-download--fullname :filter-return 'narf*org-download--fullname)
|
||||
(advice-add 'org-download--fullname :filter-return 'doom*org-download--fullname)
|
||||
|
||||
;; Add another drag-and-drop handler that will handle anything but image files
|
||||
(setq dnd-protocol-alist `(("^\\(https?\\|ftp\\|file\\|nfs\\):\\(//\\)?" . narf/org-download-dnd)
|
||||
(setq dnd-protocol-alist `(("^\\(https?\\|ftp\\|file\\|nfs\\):\\(//\\)?" . doom/org-download-dnd)
|
||||
,@dnd-protocol-alist))
|
||||
|
||||
;; ...auto-delete attachments once all references to it have been deleted.
|
||||
(add-hook 'org-mode-hook 'narf|org-attach-track-init)
|
||||
(defun narf|org-attach-track-init ()
|
||||
(setq narf-org-attachments-list (narf/org-attachments))
|
||||
(add-hook 'after-save-hook 'narf/org-cleanup-attachments nil t)))
|
||||
(add-hook 'org-mode-hook 'doom|org-attach-track-init)
|
||||
(defun doom|org-attach-track-init ()
|
||||
(setq doom-org-attachments-list (doom/org-attachments))
|
||||
(add-hook 'after-save-hook 'doom/org-cleanup-attachments nil t)))
|
||||
|
||||
|
||||
;;
|
||||
(defun narf|org-export-init ()
|
||||
(defun doom|org-export-init ()
|
||||
"Set up my own exporting system."
|
||||
(setq org-export-backends '(ascii html latex md)
|
||||
org-export-with-toc t
|
||||
|
@ -76,21 +76,21 @@
|
|||
(setq org-pandoc-options '((standalone . t) (mathjax . t) (parse-raw . t)))
|
||||
|
||||
;; Export to a central directory (why isn't this easier?)
|
||||
(unless (file-directory-p narf-org-export-directory)
|
||||
(mkdir narf-org-export-directory))
|
||||
(defun narf*org-export-output-file-name (args)
|
||||
(unless (file-directory-p doom-org-export-directory)
|
||||
(mkdir doom-org-export-directory))
|
||||
(defun doom*org-export-output-file-name (args)
|
||||
(unless (nth 2 args)
|
||||
(setq args (append args (list narf-org-export-directory))))
|
||||
(setq args (append args (list doom-org-export-directory))))
|
||||
args)
|
||||
(advice-add 'org-export-output-file-name :filter-args 'narf*org-export-output-file-name))
|
||||
(advice-add 'org-export-output-file-name :filter-args 'doom*org-export-output-file-name))
|
||||
|
||||
|
||||
;;
|
||||
;; (defvar narf-org-tags '())
|
||||
;; (defun narf|org-tag-init ()
|
||||
;; (defvar doom-org-tags '())
|
||||
;; (defun doom|org-tag-init ()
|
||||
;; (async-start
|
||||
;; `(lambda ()
|
||||
;; (let ((default-directory (narf/project-root))
|
||||
;; (let ((default-directory (doom/project-root))
|
||||
;; (data (s-trim (shell-command-to-string "ag --nocolor --nonumbers '^#\\+TAGS:'")))
|
||||
;; (alist '()))
|
||||
;; (unless (zerop (length data))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue