diff --git a/modules/app/rss/autoload.el b/modules/app/rss/autoload.el index 176f253df..ce89ef798 100644 --- a/modules/app/rss/autoload.el +++ b/modules/app/rss/autoload.el @@ -13,7 +13,7 @@ (elfeed-db-compact) (doom-kill-matching-buffers "^\\*elfeed") (dolist (file +rss-elfeed-files) - (when-let* ((buf (get-file-buffer (expand-file-name file +org-dir)))) + (when-let* ((buf (get-file-buffer (expand-file-name file org-directory)))) (kill-buffer buf)))) ;;;###autoload diff --git a/modules/app/rss/config.el b/modules/app/rss/config.el index 1de35ecea..2dd134aa1 100644 --- a/modules/app/rss/config.el +++ b/modules/app/rss/config.el @@ -5,8 +5,8 @@ ;; don't care for the UI you can invoke elfeed directly with `elfeed'. (defvar +rss-elfeed-files (list "elfeed.org") - "Where to look for elfeed.org files, relative to `+org-dir'. Can be absolute -paths.") + "Where to look for elfeed.org files, relative to `org-directory'. Can be +absolute paths.") (defvar +rss-split-direction 'below "What direction to pop up the entry buffer in elfeed.") @@ -65,6 +65,6 @@ paths.") :after elfeed :config (setq rmh-elfeed-org-files - (let ((default-directory +org-dir)) + (let ((default-directory org-directory)) (mapcar #'expand-file-name +rss-elfeed-files))) (elfeed-org)) diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index 52943b47e..c49518f0e 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -29,10 +29,10 @@ ;;;###autoload (defun +default/browse-notes () - (interactive) (doom-project-browse +org-dir)) + (interactive) (doom-project-browse org-directory)) ;;;###autoload (defun +default/find-in-notes () - (interactive) (doom-project-find-file +org-dir)) + (interactive) (doom-project-find-file org-directory)) ;;;###autoload (defun +default/browse-snippets () diff --git a/modules/lang/org/+attach.el b/modules/lang/org/+attach.el index 8c366b6d3..4f7982909 100644 --- a/modules/lang/org/+attach.el +++ b/modules/lang/org/+attach.el @@ -6,9 +6,9 @@ ;; files with metadata I don't want. So I wrote my own, which: ;; ;; + Places attachments in a centralized location (`+org-attach-dir' in -;; `+org-dir'), using an attach:* link abbreviation. -;; + Use `+org-attach/sync' to index all attachments in `+org-dir' that use the -;; attach:* abbreviation and delete orphaned ones that are no longer +;; `org-directory'), using an attach:* link abbreviation. +;; + Use `+org-attach/sync' to index all attachments in `org-directory' that use +;; the attach:* abbreviation and delete orphaned ones that are no longer ;; referenced. ;; + Adds drag-and-drop support for images (with inline image preview) ;; + Adds drag-and-drop support for media files (pdfs, zips, etc) with a @@ -21,7 +21,7 @@ ;; + `+org-attach/sync' (defvar +org-attach-dir ".attach/" - "Where to store attachments relative to `+org-dir'.") + "Where to store attachments relative to `org-directory'.") ;; @@ -55,14 +55,14 @@ (advice-add #'org-download-insert-link :override #'+org-attach*insert-link) (defun +org-attach*download-subdir () - (when (file-in-directory-p buffer-file-name +org-dir) - (file-relative-name buffer-file-name +org-dir))) + (when (file-in-directory-p buffer-file-name org-directory) + (file-relative-name buffer-file-name org-directory))) (defun +org-attach*download-fullname (path) "Write PATH relative to current file." (let ((dir (or (if buffer-file-name (file-name-directory buffer-file-name)) default-directory))) - (if (file-in-directory-p dir +org-dir) + (if (file-in-directory-p dir org-directory) (file-relative-name path dir) path))) (advice-add #'org-download--dir-2 :override #'ignore) @@ -75,7 +75,7 @@ ;; (defun +org|init-attach () - (setq org-attach-directory (expand-file-name +org-attach-dir +org-dir)) + (setq org-attach-directory (expand-file-name +org-attach-dir org-directory)) ;; A shorter link to attachments (push (cons "attach" (abbreviate-file-name org-attach-directory)) org-link-abbrev-alist) diff --git a/modules/lang/org/+capture.el b/modules/lang/org/+capture.el index b8fe048b1..988b71400 100644 --- a/modules/lang/org/+capture.el +++ b/modules/lang/org/+capture.el @@ -29,10 +29,8 @@ (defun +org|init-capture () - (defvaralias 'org-default-notes-file '+org-default-notes-file) - - (setq org-default-notes-file (expand-file-name +org-default-notes-file +org-dir) - +org-default-todo-file (expand-file-name +org-default-todo-file +org-dir)) + (setq org-default-notes-file (expand-file-name +org-default-notes-file org-directory) + +org-default-todo-file (expand-file-name +org-default-todo-file org-directory)) (add-hook 'org-capture-after-finalize-hook #'+org-capture|cleanup-frame) diff --git a/modules/lang/org/+export.el b/modules/lang/org/+export.el index 8097283e4..975977cb0 100644 --- a/modules/lang/org/+export.el +++ b/modules/lang/org/+export.el @@ -23,17 +23,17 @@ (when (executable-find "pandoc") (require 'ox-pandoc)) - ;; Export to a central location by default or if target isn't in `+org-dir'. - (setq org-export-directory (expand-file-name ".export" +org-dir)) + ;; Export to a central location by default or if target isn't in `org-directory'. + (setq org-export-directory (expand-file-name ".export" org-directory)) (unless (file-directory-p org-export-directory) (make-directory org-export-directory t)) (defun +org*export-output-file-name (args) "Return a centralized export location unless one is provided or the current -file isn't in `+org-dir'." +file isn't in `org-directory'." (when (and (not (nth 2 args)) buffer-file-name - (file-in-directory-p (file-truename buffer-file-name) (file-truename +org-dir))) + (file-in-directory-p (file-truename buffer-file-name) (file-truename org-directory))) (setq args (append args (list org-export-directory)))) args) (advice-add #'org-export-output-file-name :filter-args #'+org*export-output-file-name)) diff --git a/modules/lang/org/autoload/org-attach.el b/modules/lang/org/autoload/org-attach.el index ad74b56b9..1eb724d7c 100644 --- a/modules/lang/org/autoload/org-attach.el +++ b/modules/lang/org/autoload/org-attach.el @@ -17,7 +17,7 @@ ;; (defvar +org-attachments nil - "A list of all indexed attachments in `+org-dir'.") + "A list of all indexed attachments in `org-directory'.") (defvar +org-attachments-files nil "A list of all attachments in `org-attach-directory'.") @@ -42,7 +42,7 @@ and END (defaults to `point-min' and `point-max')." ;;;###autoload (defun +org-attach/sync (arg) - "Reindex all attachments in `+org-dir' and delete orphaned attachments in + "Reindex all attachments in `org-directory' and delete orphaned attachments in `org-attach-directory'. If ARG (universal arg), conduct a dry run." (declare (interactive-only t)) (interactive "P") @@ -50,7 +50,7 @@ and END (defaults to `point-min' and `point-max')." (setq +org-attachments-files (directory-files org-attach-directory nil "^[^.]" t)) (with-temp-buffer (delay-mode-hooks (org-mode)) - (dolist (org-file (directory-files-recursively +org-dir "\\.org$")) + (dolist (org-file (directory-files-recursively org-directory "\\.org$")) (insert-file-contents-literally org-file)) (setq +org-attachments (+org-attachments--list))) ;; clean up @@ -132,8 +132,8 @@ an file icon produced by `+org-attach--icon')." (format "#+attr_latex: :width %dcm\n" org-download-image-latex-width)) (cond ((file-in-directory-p filename org-attach-directory) (format "[[attach:%s]]" (file-relative-name filename org-attach-directory))) - ((file-in-directory-p filename +org-dir) - (format org-download-link-format (file-relative-name filename +org-dir))) + ((file-in-directory-p filename org-directory) + (format org-download-link-format (file-relative-name filename org-directory))) (t (format org-download-link-format filename))))) (org-display-inline-images)) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 7d7679bb2..37e4fe4dd 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -1,7 +1,9 @@ ;;; lang/org/config.el -*- lexical-binding: t; -*- -(defvar +org-dir (expand-file-name "~/org/") - "The directory where org files are kept.") +;; FIXME deprecated +(define-obsolete-variable-alias '+org-dir 'org-directory "2.1.0") + +(defvar org-directory "~/org/") ;; Sub-modules (if (featurep! +attach) (load! "+attach")) @@ -61,9 +63,6 @@ +org|unfold-to-2nd-level-or-point +org|show-paren-mode-compatibility)) -(after! org - (defvaralias 'org-directory '+org-dir)) - ;; ;; `org-mode' hooks @@ -240,7 +239,7 @@ unfold to point on startup." 'org-link 'error))))) - (def-org-file-link! "org" +org-dir) + (def-org-file-link! "org" org-directory) (def-org-file-link! "doom" doom-emacs-dir) (def-org-file-link! "doom-docs" doom-docs-dir) (def-org-file-link! "doom-modules" doom-modules-dir)