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
|
@ -147,7 +147,7 @@ selection of all minor-modes, active or not."
|
||||||
(list (or (+org-get-property "TITLE")
|
(list (or (+org-get-property "TITLE")
|
||||||
(file-relative-name buffer-file-name))))
|
(file-relative-name buffer-file-name))))
|
||||||
path
|
path
|
||||||
(list (replace-regexp-in-string org-any-link-re "\\4" text)))
|
(list (replace-regexp-in-string org-link-any-re "\\4" text)))
|
||||||
" > ")
|
" > ")
|
||||||
tags)
|
tags)
|
||||||
" ")
|
" ")
|
||||||
|
@ -408,78 +408,77 @@ If prefix arg is present, refresh the cache."
|
||||||
(if guess (symbol-name guess))))))))
|
(if guess (symbol-name guess))))))))
|
||||||
(require 'core-packages)
|
(require 'core-packages)
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
(let ((straight-packages (mapcar #'intern (hash-table-keys straight--build-cache))))
|
(if (or (package-desc-p package)
|
||||||
(if (or (package-desc-p package)
|
(and (symbolp package)
|
||||||
(and (symbolp package)
|
(or (assq package package-alist)
|
||||||
(or (assq package package-alist)
|
(assq package package--builtins))))
|
||||||
(assq package package--builtins))))
|
(describe-package package)
|
||||||
(describe-package package)
|
(help-setup-xref (list #'doom/help-packages package)
|
||||||
(help-setup-xref (list #'doom/help-packages package)
|
(called-interactively-p 'interactive))
|
||||||
(called-interactively-p 'interactive))
|
(with-help-window (help-buffer)))
|
||||||
(with-help-window (help-buffer)))
|
(save-excursion
|
||||||
(save-excursion
|
(with-current-buffer (help-buffer)
|
||||||
(with-current-buffer (help-buffer)
|
(let ((inhibit-read-only t)
|
||||||
(let ((inhibit-read-only t)
|
(indent (make-string 13 ? )))
|
||||||
(indent (make-string 13 ? )))
|
(goto-char (point-max))
|
||||||
(goto-char (point-max))
|
(if (re-search-forward "^ *Status: " nil t)
|
||||||
(if (re-search-forward "^ *Status: " nil t)
|
(progn
|
||||||
(progn
|
(end-of-line)
|
||||||
(end-of-line)
|
(insert "\n"))
|
||||||
(insert "\n"))
|
(re-search-forward "\n\n" nil t))
|
||||||
(re-search-forward "\n\n" nil t))
|
|
||||||
|
|
||||||
(package--print-help-section "Package")
|
(package--print-help-section "Package")
|
||||||
(insert (symbol-name package) "\n")
|
(insert (symbol-name package) "\n")
|
||||||
|
|
||||||
(package--print-help-section "Source")
|
(package--print-help-section "Source")
|
||||||
(insert (or (pcase (doom-package-backend package)
|
(insert (or (pcase (doom-package-backend package)
|
||||||
(`straight
|
(`straight
|
||||||
(format! "Straight (%s)\n%s"
|
(format! "Straight (%s)\n%s"
|
||||||
(let ((default-directory (straight--build-dir (symbol-name package))))
|
(let ((default-directory (straight--build-dir (symbol-name package))))
|
||||||
(string-trim
|
(string-trim
|
||||||
(shell-command-to-string "git log -1 --format=\"%D %h %ci\"")))
|
(shell-command-to-string "git log -1 --format=\"%D %h %ci\"")))
|
||||||
(indent
|
(indent
|
||||||
13 (string-trim
|
13 (string-trim
|
||||||
(pp-to-string
|
(pp-to-string
|
||||||
(doom-package-build-recipe package))))))
|
(doom-package-build-recipe package))))))
|
||||||
(`elpa
|
(`elpa
|
||||||
(format "[M]ELPA %s" (doom--package-url package)))
|
(format "[M]ELPA %s" (doom--package-url package)))
|
||||||
(`builtin "Built-in")
|
(`builtin "Built-in")
|
||||||
(_ (abbreviate-file-name (symbol-file package))))
|
(_ (abbreviate-file-name (symbol-file package))))
|
||||||
"unknown")
|
"unknown")
|
||||||
"\n")
|
"\n")
|
||||||
|
|
||||||
(when (gethash (symbol-name package) straight--build-cache)
|
(when (gethash (symbol-name package) straight--build-cache)
|
||||||
(package--print-help-section "Modules")
|
(package--print-help-section "Modules")
|
||||||
(insert "Declared by the following Doom modules:\n")
|
(insert "Declared by the following Doom modules:\n")
|
||||||
(dolist (m (doom-package-get package :modules))
|
(dolist (m (doom-package-get package :modules))
|
||||||
(insert indent)
|
(insert indent)
|
||||||
(doom--help-package-insert-button
|
(doom--help-package-insert-button
|
||||||
(format "%s %s" (car m) (or (cdr m) ""))
|
(format "%s %s" (car m) (or (cdr m) ""))
|
||||||
(pcase (car m)
|
(pcase (car m)
|
||||||
(:core doom-core-dir)
|
(:core doom-core-dir)
|
||||||
(:private doom-private-dir)
|
(:private doom-private-dir)
|
||||||
(category (doom-module-path category (cdr m)))))
|
(category (doom-module-path category (cdr m)))))
|
||||||
(insert "\n")))
|
(insert "\n")))
|
||||||
|
|
||||||
(package--print-help-section "Configs")
|
(package--print-help-section "Configs")
|
||||||
(insert "This package is configured in the following locations:")
|
(insert "This package is configured in the following locations:")
|
||||||
(dolist (location (doom--help-package-configs package))
|
(dolist (location (doom--help-package-configs package))
|
||||||
(insert "\n" indent)
|
(insert "\n" indent)
|
||||||
(insert-text-button
|
(insert-text-button
|
||||||
location
|
location
|
||||||
'face 'link
|
'face 'link
|
||||||
'follow-link t
|
'follow-link t
|
||||||
'action
|
'action
|
||||||
`(lambda (_)
|
`(lambda (_)
|
||||||
(cl-destructuring-bind (file line _match)
|
(cl-destructuring-bind (file line _match)
|
||||||
,(split-string location ":")
|
,(split-string location ":")
|
||||||
(find-file (expand-file-name file doom-emacs-dir))
|
(find-file (expand-file-name file doom-emacs-dir))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(forward-line (1- line))
|
(forward-line (1- line))
|
||||||
(recenter)))))
|
(recenter)))))
|
||||||
|
|
||||||
(insert "\n\n"))))))
|
(insert "\n\n")))))
|
||||||
|
|
||||||
(defvar doom--package-cache nil)
|
(defvar doom--package-cache nil)
|
||||||
(defun doom--package-list ()
|
(defun doom--package-list ()
|
||||||
|
|
|
@ -214,7 +214,7 @@ If ARG (universal argument), open selection in other-window."
|
||||||
|
|
||||||
(defun +ivy--tasks-open-action (x)
|
(defun +ivy--tasks-open-action (x)
|
||||||
"Jump to the file and line of the current task."
|
"Jump to the file and line of the current task."
|
||||||
(cl-destructuring-bind (label type file line) x
|
(cl-destructuring-bind (_label type file line) x
|
||||||
(with-ivy-window
|
(with-ivy-window
|
||||||
(find-file (expand-file-name file (doom-project-root)))
|
(find-file (expand-file-name file (doom-project-root)))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
|
|
|
@ -62,8 +62,6 @@ immediately runs it on the current candidate (ending the ivy session)."
|
||||||
projectile-completion-system 'ivy
|
projectile-completion-system 'ivy
|
||||||
;; Don't use ^ as initial input
|
;; Don't use ^ as initial input
|
||||||
ivy-initial-inputs-alist nil
|
ivy-initial-inputs-alist nil
|
||||||
;; highlight til EOL
|
|
||||||
ivy-format-function #'ivy-format-function-line
|
|
||||||
;; disable magic slash on non-match
|
;; disable magic slash on non-match
|
||||||
ivy-magic-slash-non-match-action nil
|
ivy-magic-slash-non-match-action nil
|
||||||
;; don't show recent files in switch-buffer
|
;; don't show recent files in switch-buffer
|
||||||
|
@ -75,6 +73,9 @@ immediately runs it on the current candidate (ending the ivy session)."
|
||||||
;; enable ability to select prompt (alternative to `ivy-immediate-done')
|
;; enable ability to select prompt (alternative to `ivy-immediate-done')
|
||||||
ivy-use-selectable-prompt t)
|
ivy-use-selectable-prompt t)
|
||||||
|
|
||||||
|
(setf (alist-get 't ivy-format-functions-alist)
|
||||||
|
#'ivy-format-function-line)
|
||||||
|
|
||||||
;; REVIEW Move this somewhere else and perhaps generalize this so both
|
;; REVIEW Move this somewhere else and perhaps generalize this so both
|
||||||
;; ivy/helm users can enjoy it.
|
;; ivy/helm users can enjoy it.
|
||||||
(defadvice! +ivy--counsel-file-jump-use-fd-rg-a (args)
|
(defadvice! +ivy--counsel-file-jump-use-fd-rg-a (args)
|
||||||
|
|
|
@ -283,11 +283,11 @@ If prefix ARG is set, prompt for a known project to search from."
|
||||||
((rgrep (regexp-quote symbol))))))
|
((rgrep (regexp-quote symbol))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/search-notes-for-symbol-at-point (&optional arg symbol)
|
(defun +default/search-notes-for-symbol-at-point (&optional symbol)
|
||||||
"Conduct a text search in the current project for symbol at point. If prefix
|
"Conduct a text search in the current project for symbol at point. If prefix
|
||||||
ARG is set, prompt for a known project to search from."
|
ARG is set, prompt for a known project to search from."
|
||||||
(interactive
|
(interactive
|
||||||
(list current-prefix-arg (thing-at-point 'symbol t)))
|
(list (thing-at-point 'symbol t)))
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(let ((default-directory org-directory))
|
(let ((default-directory org-directory))
|
||||||
(+default/search-project-for-symbol-at-point
|
(+default/search-project-for-symbol-at-point
|
||||||
|
|
|
@ -200,13 +200,13 @@ See `+evil/next-preproc-directive' for details."
|
||||||
(dotimes (_ (abs count))
|
(dotimes (_ (abs count))
|
||||||
(cond ((> count 0)
|
(cond ((> count 0)
|
||||||
(while (and (not (eobp)) (sp-point-in-comment))
|
(while (and (not (eobp)) (sp-point-in-comment))
|
||||||
(next-line))
|
(forward-line 1))
|
||||||
(unless (comment-search-forward (point-max) 'noerror)
|
(unless (comment-search-forward (point-max) 'noerror)
|
||||||
(goto-char orig-pt)
|
(goto-char orig-pt)
|
||||||
(user-error "No comment after point")))
|
(user-error "No comment after point")))
|
||||||
(t
|
(t
|
||||||
(while (and (not (bobp)) (sp-point-in-comment))
|
(while (and (not (bobp)) (sp-point-in-comment))
|
||||||
(previous-line))
|
(forward-line -1))
|
||||||
(unless (comment-search-backward nil 'noerror)
|
(unless (comment-search-backward nil 'noerror)
|
||||||
(goto-char orig-pt)
|
(goto-char orig-pt)
|
||||||
(user-error "No comment before point")))))))
|
(user-error "No comment before point")))))))
|
||||||
|
|
|
@ -177,7 +177,7 @@ If BANG, search Doom documentation."
|
||||||
'module (list cat mod))))
|
'module (list cat mod))))
|
||||||
(module (completing-read "Describe module: " modules nil t query))
|
(module (completing-read "Describe module: " modules nil t query))
|
||||||
(key (get-text-property 0 'module module)))
|
(key (get-text-property 0 'module module)))
|
||||||
(doom/help-modules key)))
|
(doom/help-modules (car key) (cdr key))))
|
||||||
((and (string-match-p "\\(?:SPC\\|[CMsSH]-[^ ]\\|<[^>]+>\\)" query)
|
((and (string-match-p "\\(?:SPC\\|[CMsSH]-[^ ]\\|<[^>]+>\\)" query)
|
||||||
(helpful-key (kbd (string-trim query)))))
|
(helpful-key (kbd (string-trim query)))))
|
||||||
((apropos query t)))))
|
((apropos query t)))))
|
||||||
|
|
|
@ -85,31 +85,31 @@
|
||||||
|
|
||||||
;;; ]u / [u
|
;;; ]u / [u
|
||||||
;;;###autoload (autoload '+evil:url-encode "editor/evil/autoload/unimpaired" nil t)
|
;;;###autoload (autoload '+evil:url-encode "editor/evil/autoload/unimpaired" nil t)
|
||||||
(evil-define-operator +evil:url-encode (count &optional beg end type)
|
(evil-define-operator +evil:url-encode (_count &optional beg end)
|
||||||
"TODO"
|
"TODO"
|
||||||
(interactive "<c><R>")
|
(interactive "<c><r>")
|
||||||
(+evil--encode beg end #'url-encode-url))
|
(+evil--encode beg end #'url-encode-url))
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil:url-decode "editor/evil/autoload/unimpaired" nil t)
|
;;;###autoload (autoload '+evil:url-decode "editor/evil/autoload/unimpaired" nil t)
|
||||||
(evil-define-operator +evil:url-decode (count &optional beg end type)
|
(evil-define-operator +evil:url-decode (_count &optional beg end)
|
||||||
"TODO"
|
"TODO"
|
||||||
(interactive "<c><R>")
|
(interactive "<c><r>")
|
||||||
(+evil--encode beg end #'url-unhex-string))
|
(+evil--encode beg end #'url-unhex-string))
|
||||||
|
|
||||||
;;; ]y / [y
|
;;; ]y / [y
|
||||||
;;;###autoload (autoload '+evil:c-string-encode "editor/evil/autoload/unimpaired" nil t)
|
;;;###autoload (autoload '+evil:c-string-encode "editor/evil/autoload/unimpaired" nil t)
|
||||||
(evil-define-operator +evil:c-string-encode (count &optional beg end type)
|
(evil-define-operator +evil:c-string-encode (_count &optional beg end)
|
||||||
"TODO"
|
"TODO"
|
||||||
(interactive "<c><R>")
|
(interactive "<c><r>")
|
||||||
(+evil--encode
|
(+evil--encode
|
||||||
beg end
|
beg end
|
||||||
(lambda (text)
|
(lambda (text)
|
||||||
(replace-regexp-in-string "[\"\\]" (lambda (ch) (concat "\\" ch)) text))))
|
(replace-regexp-in-string "[\"\\]" (lambda (ch) (concat "\\" ch)) text))))
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil:c-string-decode "editor/evil/autoload/unimpaired" nil t)
|
;;;###autoload (autoload '+evil:c-string-decode "editor/evil/autoload/unimpaired" nil t)
|
||||||
(evil-define-operator +evil:c-string-decode (count &optional beg end type)
|
(evil-define-operator +evil:c-string-decode (_count &optional beg end)
|
||||||
"TODO"
|
"TODO"
|
||||||
(interactive "<c><R>")
|
(interactive "<c><r>")
|
||||||
(+evil--encode
|
(+evil--encode
|
||||||
beg end
|
beg end
|
||||||
(lambda (text)
|
(lambda (text)
|
||||||
|
|
|
@ -225,7 +225,7 @@ You will be prompted for a snippet to alias."
|
||||||
"# condition: t}\n"
|
"# condition: t}\n"
|
||||||
"# type: command\n"
|
"# type: command\n"
|
||||||
"# --\n"
|
"# --\n"
|
||||||
"(%alias \"${4:" (or template "uuid") "}\")"))
|
"(%alias \"${4:" (or template-uuid "uuid") "}\")"))
|
||||||
(when (bound-and-true-p evil-local-mode)
|
(when (bound-and-true-p evil-local-mode)
|
||||||
(evil-insert-state)))))
|
(evil-insert-state)))))
|
||||||
|
|
||||||
|
|
|
@ -38,33 +38,37 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-present-detect-slide-h ()
|
(defun +org-present-detect-slide-h ()
|
||||||
(outline-show-all)
|
(outline-show-all)
|
||||||
(if (member "title" (org-get-tags-at))
|
(if (member "title" (org-get-tags))
|
||||||
(text-scale-set 10)
|
(text-scale-set 10)
|
||||||
(text-scale-set +org-present-text-scale)))
|
(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
|
;;;###autoload
|
||||||
(defun +org-present-init-org-tree-window-h ()
|
(defun +org-present-init-org-tree-window-h ()
|
||||||
"Set up the org window for presentation."
|
"Set up the org window for presentation."
|
||||||
(doom/window-maximize-buffer)
|
(doom/window-maximize-buffer)
|
||||||
(let ((cwm-use-vertical-padding t)
|
(let ((arg (if org-tree-slide-mode +1 -1)))
|
||||||
(cwm-frame-internal-border 110)
|
|
||||||
(cwm-left-fringe-ratio -10)
|
|
||||||
(cwm-centered-window-width 240)
|
|
||||||
(arg (if org-tree-slide-mode +1 -1)))
|
|
||||||
(when (fboundp 'centered-window-mode)
|
(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))
|
(window-divider-mode (* arg -1))
|
||||||
(hide-mode-line-mode arg)
|
(hide-mode-line-mode arg)
|
||||||
(+org-pretty-mode arg)
|
(+org-pretty-mode arg)
|
||||||
(cond (org-tree-slide-mode
|
(cond (org-tree-slide-mode
|
||||||
(org-indent-mode -1)
|
(org-indent-mode -1)
|
||||||
(text-scale-set +org-present-text-scale)
|
(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))
|
(set-face-attribute 'org-level-2 nil :height 1.4))
|
||||||
(t
|
(t
|
||||||
(org-indent-mode +1)
|
(org-indent-mode +1)
|
||||||
(text-scale-set 0)
|
(text-scale-set 0)
|
||||||
(org-remove-latex-fragment-image-overlays)
|
(org-clear-latex-preview)
|
||||||
(set-face-attribute 'org-level-2 nil :height 1.0)
|
(set-face-attribute 'org-level-2 nil :height 1.0)
|
||||||
(+org-present-remove-overlays-h)
|
(+org-present-remove-overlays-h)
|
||||||
(org-remove-inline-images)))))
|
(org-remove-inline-images)))))
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
"A list of all indexed attachments in `org-directory'.")
|
"A list of all indexed attachments in `org-directory'.")
|
||||||
|
|
||||||
(defvar +org-attachments-files nil
|
(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)
|
(defun +org-attachments--list (&optional beg end)
|
||||||
"Return a list of all attachment file names in the current buffer between BEG
|
"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)
|
(while (search-forward "[[attach:" end t)
|
||||||
(let* ((context (save-match-data (org-element-context)))
|
(let* ((context (save-match-data (org-element-context)))
|
||||||
(link (expand-file-name (org-link-unescape (org-element-property :path 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))
|
(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))))))
|
(push (file-name-nondirectory link) attachments))))))
|
||||||
(cl-delete-duplicates attachments :test #'string=)))
|
(cl-delete-duplicates attachments :test #'string=)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-attach/sync (arg)
|
(defun +org-attach/sync (arg)
|
||||||
"Reindex all attachments in `org-directory' 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."
|
`org-attach-id-dir'. If ARG (universal arg), conduct a dry run."
|
||||||
(declare (interactive-only t))
|
(declare (interactive-only t))
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(message "Reloading")
|
(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
|
(with-temp-buffer
|
||||||
(delay-mode-hooks (org-mode))
|
(delay-mode-hooks (org-mode))
|
||||||
(dolist (org-file (directory-files-recursively org-directory "\\.org$"))
|
(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)
|
(message "Deleting orphaned attachment: %s" file)
|
||||||
(cl-incf deleted)
|
(cl-incf deleted)
|
||||||
(unless arg
|
(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)))
|
(message "Buffer's attachments synced (%d deleted)" deleted)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-attach/find-file ()
|
(defun +org-attach/find-file ()
|
||||||
"Open a file from `org-attach-directory'."
|
"Open a file from `org-attach-id-dir'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(doom-project-browse org-attach-directory))
|
(doom-project-browse org-attach-id-dir))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-attach/file (path)
|
(defun +org-attach/file (path)
|
||||||
|
|
|
@ -111,8 +111,8 @@ If on a:
|
||||||
'done)))
|
'done)))
|
||||||
(t
|
(t
|
||||||
(+org/refresh-inline-images)
|
(+org/refresh-inline-images)
|
||||||
(org-remove-latex-fragment-image-overlays)
|
(org-clear-latex-preview)
|
||||||
(org-toggle-latex-fragment '(4)))))
|
(org-latex-preview '(4)))))
|
||||||
|
|
||||||
(`clock (org-clock-update-time-maybe))
|
(`clock (org-clock-update-time-maybe))
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ If on a:
|
||||||
(org-babel-execute-src-block))
|
(org-babel-execute-src-block))
|
||||||
|
|
||||||
((or `latex-fragment `latex-environment)
|
((or `latex-fragment `latex-environment)
|
||||||
(org-toggle-latex-fragment))
|
(org-latex-preview))
|
||||||
|
|
||||||
(`link
|
(`link
|
||||||
(let* ((lineage (org-element-lineage context '(link) t))
|
(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
|
"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:
|
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').
|
`org-directory').
|
||||||
+ Adds attach:* link abbreviation for quick links to these files from anywhere.
|
+ 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
|
+ 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/file'
|
||||||
+ `+org-attach/url'
|
+ `+org-attach/url'
|
||||||
+ `+org-attach/sync'"
|
+ `+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
|
;; A shorter link to attachments
|
||||||
(add-to-list 'org-link-abbrev-alist
|
(add-to-list 'org-link-abbrev-alist
|
||||||
(cons "attach"
|
(cons "attach"
|
||||||
(abbreviate-file-name org-attach-directory)))
|
(abbreviate-file-name org-attach-id-dir)))
|
||||||
|
|
||||||
(org-link-set-parameters
|
(org-link-set-parameters
|
||||||
"attach"
|
"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)
|
:complete (lambda (&optional _arg)
|
||||||
(+org--relpath (+org-link-read-file "attach" org-attach-directory)
|
(+org--relpath (+org-link-read-file "attach" org-attach-id-dir)
|
||||||
org-attach-directory))
|
org-attach-id-dir))
|
||||||
:face (lambda (link)
|
: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
|
'org-link
|
||||||
'error)))
|
'error)))
|
||||||
|
|
||||||
(after! projectile
|
(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
|
(after! recentf
|
||||||
(add-to-list 'recentf-exclude
|
(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 ()
|
(defun +org-init-centralized-exports-h ()
|
||||||
|
@ -455,7 +455,7 @@ eldoc string."
|
||||||
for n from 0
|
for n from 0
|
||||||
for face = (nth (% n org-n-level-faces) org-level-faces)
|
for face = (nth (% n org-n-level-faces) org-level-faces)
|
||||||
collect
|
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)))
|
nil 'face `(:foreground ,(face-foreground face nil t) :weight bold)))
|
||||||
separator)))
|
separator)))
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ between the two."
|
||||||
"t" #'org-agenda-todo))
|
"t" #'org-agenda-todo))
|
||||||
|
|
||||||
|
|
||||||
(defun +org-init-keybinds-for-evil-h (&rest args)
|
(defun +org-init-keybinds-for-evil-h (&rest _)
|
||||||
"TODO"
|
"TODO"
|
||||||
(when (featurep! :editor evil +everywhere)
|
(when (featurep! :editor evil +everywhere)
|
||||||
(use-package! evil-org
|
(use-package! evil-org
|
||||||
|
@ -793,7 +793,7 @@ compelling reason, so..."
|
||||||
:preface
|
:preface
|
||||||
;; Change org defaults (should be set before org loads)
|
;; Change org defaults (should be set before org loads)
|
||||||
(defvar org-directory "~/org/")
|
(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")
|
(setq org-clock-persist-file (concat doom-etc-dir "org-clock-save.el")
|
||||||
org-publish-timestamp-directory (concat doom-cache-dir "org-timestamps/")
|
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
|
;; In case the user has eagerly loaded org from their configs
|
||||||
(when (and (featurep 'org)
|
(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")
|
(message "`org' was already loaded by the time lang/org loaded, this may cause issues")
|
||||||
(run-hooks 'org-load-hook))
|
(run-hooks 'org-load-hook))
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
:init
|
:init
|
||||||
(add-hook! 'doom-load-theme-hook :append
|
(add-hook! 'doom-load-theme-hook :append
|
||||||
(defun +doom-solaire-mode-swap-bg-maybe-h ()
|
(defun +doom-solaire-mode-swap-bg-maybe-h ()
|
||||||
(pcase-let ((`(,theme . ,swap) (assq doom-theme +doom-solaire-themes)))
|
(pcase-let ((`(,_theme . ,swap) (assq doom-theme +doom-solaire-themes)))
|
||||||
(require 'solaire-mode)
|
(require 'solaire-mode)
|
||||||
(if swap (solaire-mode-swap-bg)))))
|
(if swap (solaire-mode-swap-bg)))))
|
||||||
:config
|
:config
|
||||||
|
|
|
@ -491,10 +491,9 @@ This be hooked to `projectile-after-switch-project-hook'."
|
||||||
(if (and (not (null +workspaces-on-switch-project-behavior))
|
(if (and (not (null +workspaces-on-switch-project-behavior))
|
||||||
(or (eq +workspaces-on-switch-project-behavior t)
|
(or (eq +workspaces-on-switch-project-behavior t)
|
||||||
(+workspace-buffer-list)))
|
(+workspace-buffer-list)))
|
||||||
(let* (persp-p
|
(let* ((persp
|
||||||
(persp
|
|
||||||
(let ((project-name (doom-project-name +workspaces--project-dir)))
|
(let ((project-name (doom-project-name +workspaces--project-dir)))
|
||||||
(or (setq persp-p (+workspace-get project-name t))
|
(or (+workspace-get project-name t)
|
||||||
(+workspace-new project-name))))
|
(+workspace-new project-name))))
|
||||||
(new-name (persp-name persp)))
|
(new-name (persp-name persp)))
|
||||||
(+workspace-switch new-name)
|
(+workspace-switch new-name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue