Insult byte-compiler's mom
Yeah, that shut him up.
This commit is contained in:
parent
5f7add8360
commit
e10cd8cf2e
14 changed files with 126 additions and 122 deletions
|
@ -38,33 +38,37 @@
|
|||
;;;###autoload
|
||||
(defun +org-present-detect-slide-h ()
|
||||
(outline-show-all)
|
||||
(if (member "title" (org-get-tags-at))
|
||||
(if (member "title" (org-get-tags))
|
||||
(text-scale-set 10)
|
||||
(text-scale-set +org-present-text-scale)))
|
||||
|
||||
(defvar cwm-use-vertical-padding)
|
||||
(defvar cwm-frame-internal-border)
|
||||
(defvar cwm-left-fringe-ratio)
|
||||
(defvar cwm-centered-window-width)
|
||||
;;;###autoload
|
||||
(defun +org-present-init-org-tree-window-h ()
|
||||
"Set up the org window for presentation."
|
||||
(doom/window-maximize-buffer)
|
||||
(let ((cwm-use-vertical-padding t)
|
||||
(cwm-frame-internal-border 110)
|
||||
(cwm-left-fringe-ratio -10)
|
||||
(cwm-centered-window-width 240)
|
||||
(arg (if org-tree-slide-mode +1 -1)))
|
||||
(let ((arg (if org-tree-slide-mode +1 -1)))
|
||||
(when (fboundp 'centered-window-mode)
|
||||
(centered-window-mode arg))
|
||||
(let ((cwm-use-vertical-padding t)
|
||||
(cwm-frame-internal-border 110)
|
||||
(cwm-left-fringe-ratio -10)
|
||||
(cwm-centered-window-width 240))
|
||||
(centered-window-mode arg)))
|
||||
(window-divider-mode (* arg -1))
|
||||
(hide-mode-line-mode arg)
|
||||
(+org-pretty-mode arg)
|
||||
(cond (org-tree-slide-mode
|
||||
(org-indent-mode -1)
|
||||
(text-scale-set +org-present-text-scale)
|
||||
(ignore-errors (org-toggle-latex-fragment '(4)))
|
||||
(ignore-errors (org-latex-preview '(4)))
|
||||
(set-face-attribute 'org-level-2 nil :height 1.4))
|
||||
(t
|
||||
(org-indent-mode +1)
|
||||
(text-scale-set 0)
|
||||
(org-remove-latex-fragment-image-overlays)
|
||||
(org-clear-latex-preview)
|
||||
(set-face-attribute 'org-level-2 nil :height 1.0)
|
||||
(+org-present-remove-overlays-h)
|
||||
(org-remove-inline-images)))))
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"A list of all indexed attachments in `org-directory'.")
|
||||
|
||||
(defvar +org-attachments-files nil
|
||||
"A list of all attachments in `org-attach-directory'.")
|
||||
"A list of all attachments in `org-attach-id-dir'.")
|
||||
|
||||
(defun +org-attachments--list (&optional beg end)
|
||||
"Return a list of all attachment file names in the current buffer between BEG
|
||||
|
@ -33,20 +33,20 @@ and END (defaults to `point-min' and `point-max')."
|
|||
(while (search-forward "[[attach:" end t)
|
||||
(let* ((context (save-match-data (org-element-context)))
|
||||
(link (expand-file-name (org-link-unescape (org-element-property :path context))
|
||||
org-attach-directory)))
|
||||
org-attach-id-dir)))
|
||||
(when (and (equal "file" (org-element-property :type context))
|
||||
(file-in-directory-p link org-attach-directory))
|
||||
(file-in-directory-p link org-attach-id-dir))
|
||||
(push (file-name-nondirectory link) attachments))))))
|
||||
(cl-delete-duplicates attachments :test #'string=)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-attach/sync (arg)
|
||||
"Reindex all attachments in `org-directory' and delete orphaned attachments in
|
||||
`org-attach-directory'. If ARG (universal arg), conduct a dry run."
|
||||
`org-attach-id-dir'. If ARG (universal arg), conduct a dry run."
|
||||
(declare (interactive-only t))
|
||||
(interactive "P")
|
||||
(message "Reloading")
|
||||
(setq +org-attachments-files (directory-files org-attach-directory nil "^[^.]" t))
|
||||
(setq +org-attachments-files (directory-files org-attach-id-dir nil "^[^.]" t))
|
||||
(with-temp-buffer
|
||||
(delay-mode-hooks (org-mode))
|
||||
(dolist (org-file (directory-files-recursively org-directory "\\.org$"))
|
||||
|
@ -59,14 +59,14 @@ and END (defaults to `point-min' and `point-max')."
|
|||
(message "Deleting orphaned attachment: %s" file)
|
||||
(cl-incf deleted)
|
||||
(unless arg
|
||||
(delete-file (expand-file-name file org-attach-directory))))
|
||||
(delete-file (expand-file-name file org-attach-id-dir))))
|
||||
(message "Buffer's attachments synced (%d deleted)" deleted)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-attach/find-file ()
|
||||
"Open a file from `org-attach-directory'."
|
||||
"Open a file from `org-attach-id-dir'."
|
||||
(interactive)
|
||||
(doom-project-browse org-attach-directory))
|
||||
(doom-project-browse org-attach-id-dir))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-attach/file (path)
|
||||
|
|
|
@ -111,8 +111,8 @@ If on a:
|
|||
'done)))
|
||||
(t
|
||||
(+org/refresh-inline-images)
|
||||
(org-remove-latex-fragment-image-overlays)
|
||||
(org-toggle-latex-fragment '(4)))))
|
||||
(org-clear-latex-preview)
|
||||
(org-latex-preview '(4)))))
|
||||
|
||||
(`clock (org-clock-update-time-maybe))
|
||||
|
||||
|
@ -150,7 +150,7 @@ If on a:
|
|||
(org-babel-execute-src-block))
|
||||
|
||||
((or `latex-fragment `latex-environment)
|
||||
(org-toggle-latex-fragment))
|
||||
(org-latex-preview))
|
||||
|
||||
(`link
|
||||
(let* ((lineage (org-element-lineage context '(link) t))
|
||||
|
|
|
@ -254,7 +254,7 @@ underlying, modified buffer. This fixes that."
|
|||
"I believe Org's native attachment system is over-complicated and litters
|
||||
files with metadata I don't want. So I wrote my own, which:
|
||||
|
||||
+ Places attachments in a centralized location (`org-attach-directory' in
|
||||
+ Places attachments in a centralized location (`org-attach-id-dir' in
|
||||
`org-directory').
|
||||
+ Adds attach:* link abbreviation for quick links to these files from anywhere.
|
||||
+ Use `+org-attach/sync' to index all attachments in `org-directory' that use
|
||||
|
@ -268,30 +268,30 @@ Some commands of interest:
|
|||
+ `+org-attach/file'
|
||||
+ `+org-attach/url'
|
||||
+ `+org-attach/sync'"
|
||||
(setq org-attach-directory (doom-path org-directory org-attach-directory))
|
||||
(setq org-attach-id-dir (doom-path org-directory org-attach-id-dir))
|
||||
|
||||
;; A shorter link to attachments
|
||||
(add-to-list 'org-link-abbrev-alist
|
||||
(cons "attach"
|
||||
(abbreviate-file-name org-attach-directory)))
|
||||
(abbreviate-file-name org-attach-id-dir)))
|
||||
|
||||
(org-link-set-parameters
|
||||
"attach"
|
||||
:follow (lambda (link) (find-file (doom-path org-attach-directory link)))
|
||||
:follow (lambda (link) (find-file (doom-path org-attach-id-dir link)))
|
||||
:complete (lambda (&optional _arg)
|
||||
(+org--relpath (+org-link-read-file "attach" org-attach-directory)
|
||||
org-attach-directory))
|
||||
(+org--relpath (+org-link-read-file "attach" org-attach-id-dir)
|
||||
org-attach-id-dir))
|
||||
:face (lambda (link)
|
||||
(if (file-exists-p (expand-file-name link org-attach-directory))
|
||||
(if (file-exists-p (expand-file-name link org-attach-id-dir))
|
||||
'org-link
|
||||
'error)))
|
||||
|
||||
(after! projectile
|
||||
(add-to-list 'projectile-globally-ignored-directories org-attach-directory))
|
||||
(add-to-list 'projectile-globally-ignored-directories org-attach-id-dir))
|
||||
|
||||
(after! recentf
|
||||
(add-to-list 'recentf-exclude
|
||||
(lambda (file) (file-in-directory-p file org-attach-directory)))))
|
||||
(lambda (file) (file-in-directory-p file org-attach-id-dir)))))
|
||||
|
||||
|
||||
(defun +org-init-centralized-exports-h ()
|
||||
|
@ -455,7 +455,7 @@ eldoc string."
|
|||
for n from 0
|
||||
for face = (nth (% n org-n-level-faces) org-level-faces)
|
||||
collect
|
||||
(org-add-props (replace-regexp-in-string org-any-link-re "\\4" part)
|
||||
(org-add-props (replace-regexp-in-string org-link-any-re "\\4" part)
|
||||
nil 'face `(:foreground ,(face-foreground face nil t) :weight bold)))
|
||||
separator)))
|
||||
|
||||
|
@ -599,7 +599,7 @@ between the two."
|
|||
"t" #'org-agenda-todo))
|
||||
|
||||
|
||||
(defun +org-init-keybinds-for-evil-h (&rest args)
|
||||
(defun +org-init-keybinds-for-evil-h (&rest _)
|
||||
"TODO"
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(use-package! evil-org
|
||||
|
@ -793,7 +793,7 @@ compelling reason, so..."
|
|||
:preface
|
||||
;; Change org defaults (should be set before org loads)
|
||||
(defvar org-directory "~/org/")
|
||||
(defvar org-attach-directory ".attach/")
|
||||
(defvar org-attach-id-dir ".attach/")
|
||||
|
||||
(setq org-clock-persist-file (concat doom-etc-dir "org-clock-save.el")
|
||||
org-publish-timestamp-directory (concat doom-cache-dir "org-timestamps/")
|
||||
|
@ -848,7 +848,8 @@ compelling reason, so..."
|
|||
|
||||
;; In case the user has eagerly loaded org from their configs
|
||||
(when (and (featurep 'org)
|
||||
(not doom-reloading-p))
|
||||
(not doom-reloading-p)
|
||||
(not byte-compile-current-file))
|
||||
(message "`org' was already loaded by the time lang/org loaded, this may cause issues")
|
||||
(run-hooks 'org-load-hook))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue