From 19cfdb44126216d56503a67b277536e82e1b8219 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Wed, 13 Apr 2022 18:51:34 -0400 Subject: [PATCH] [emacs] Speed up startup --- .doom.d/config.org | 127 +++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 62 deletions(-) diff --git a/.doom.d/config.org b/.doom.d/config.org index 4031ff6..6eaf4e0 100644 --- a/.doom.d/config.org +++ b/.doom.d/config.org @@ -1263,6 +1263,7 @@ Prefer sending HTML-formatted messages with plain text as a fallback option #+begin_src emacs-lisp (use-package! org-msg + :after mu4e :config (setq org-msg-default-alternatives '(text html) org-msg-options "html-postamble:nil toc:nil author:nil email:nil ^:nil")) @@ -1372,6 +1373,7 @@ Manage a Kubernetes cluster and set up remote shell/file access via TRAMP. (set-popup-rule! "^\\*kubernetes" :ignore t) (use-package! kubernetes-tramp + :commands (eshell find-file) :config (setq tramp-remote-shell-executable "sh")) #+end_src @@ -1413,78 +1415,79 @@ Pre-load Projectile with projects in my usual code directories. Add some commands for interacting with Jira within org documents. #+begin_src emacs-lisp - (use-package jira-api - :config (setq jira-api-host "jira.aweber.io" - jira-api-user "correlr")) + (after! org + (use-package jira-api + :config (setq jira-api-host "jira.aweber.io" + jira-api-user "correlr")) - (defun my/org-clock-last-time-in-seconds () - (save-excursion - (let ((end (save-excursion (org-end-of-subtree)))) - (when (re-search-forward (concat org-clock-string - ".*\\(\\[[^]]+\\]\\)--\\(\\[[^]]+\\]\\)") - end t) - (let* ((start (match-string 1)) - (end (match-string 2))) - (floor (- (org-time-string-to-seconds end) - (org-time-string-to-seconds start)))))))) + (defun my/org-clock-last-time-in-seconds () + (save-excursion + (let ((end (save-excursion (org-end-of-subtree)))) + (when (re-search-forward (concat org-clock-string + ".*\\(\\[[^]]+\\]\\)--\\(\\[[^]]+\\]\\)") + end t) + (let* ((start (match-string 1)) + (end (match-string 2))) + (floor (- (org-time-string-to-seconds end) + (org-time-string-to-seconds start)))))))) - (defun my/org-jira-add-worklog-latest () - (interactive) - (let ((jira-id (org-entry-get (point) "JIRA_ID")) - (seconds (my/org-clock-last-time-in-seconds))) - (when (and jira-id seconds) - (jira-api-log-work jira-id seconds) - (message - (format "Logged %d minutes to %s on JIRA" - (/ seconds 60) - jira-id))))) + (defun my/org-jira-add-worklog-latest () + (interactive) + (let ((jira-id (org-entry-get (point) "JIRA_ID")) + (seconds (my/org-clock-last-time-in-seconds))) + (when (and jira-id seconds) + (jira-api-log-work jira-id seconds) + (message + (format "Logged %d minutes to %s on JIRA" + (/ seconds 60) + jira-id))))) - (defun my/org-jira-add-worklog-total () - (interactive) - (let ((jira-id (org-entry-get (point) "JIRA_ID")) - (seconds (* 60 (org-clock-sum-current-item)))) - (when (and jira-id seconds) - (jira-api-log-work jira-id seconds) - (message - (format "Logged %d minutes to %s on JIRA" - (/ seconds 60) - jira-id))))) + (defun my/org-jira-add-worklog-total () + (interactive) + (let ((jira-id (org-entry-get (point) "JIRA_ID")) + (seconds (* 60 (org-clock-sum-current-item)))) + (when (and jira-id seconds) + (jira-api-log-work jira-id seconds) + (message + (format "Logged %d minutes to %s on JIRA" + (/ seconds 60) + jira-id))))) - (defun my/org-clock-add-jira-worklog-last () - "Add a work log entry to a JIRA. + (defun my/org-clock-add-jira-worklog-last () + "Add a work log entry to a JIRA. To log work to JIRA, set a property named JIRA_ID on the entry to be logged to a JIRA issue ID." - (interactive) - (save-excursion - (save-window-excursion - (org-clock-goto) - (my/org-jira-add-worklog-latest)))) + (interactive) + (save-excursion + (save-window-excursion + (org-clock-goto) + (my/org-jira-add-worklog-latest)))) - (defun my/org-jira-browse () - (interactive) - (-if-let (jira-id (org-entry-get (point) "JIRA_ID")) - (let ((protocol (if jira-api-use-ssl "https" "http"))) - (browse-url - (concat - protocol "://" jira-api-host "/browse/" jira-id))))) + (defun my/org-jira-browse () + (interactive) + (-if-let (jira-id (org-entry-get (point) "JIRA_ID")) + (let ((protocol (if jira-api-use-ssl "https" "http"))) + (browse-url + (concat + protocol "://" jira-api-host "/browse/" jira-id))))) - (defun my/org-jira-list () - (interactive) - (let ((buffer (generate-new-buffer "*org-jira*"))) - (switch-to-buffer buffer) - (org-mode) - (insert "ohai") - (setq-local buffer-read-only t) - (display-buffer buffer))) + (defun my/org-jira-list () + (interactive) + (let ((buffer (generate-new-buffer "*org-jira*"))) + (switch-to-buffer buffer) + (org-mode) + (insert "ohai") + (setq-local buffer-read-only t) + (display-buffer buffer))) - ;; (add-hook 'org-clock-out-hook 'my/org-clock-add-jira-worklog-last) + ;; (add-hook 'org-clock-out-hook 'my/org-clock-add-jira-worklog-last) - (map! :map org-mode-map - "C-c j t" #'my/org-jira-add-worklog-total - "C-c j l" #'my/org-jira-add-worklog-latest - "C-c j b" #'my/org-jira-browse - "C-c j c" #'jira-api-create-issue-from-heading - "C-c j u" #'jira-api-update-issue-from-heading) + (map! :map org-mode-map + "C-c j t" #'my/org-jira-add-worklog-total + "C-c j l" #'my/org-jira-add-worklog-latest + "C-c j b" #'my/org-jira-browse + "C-c j c" #'jira-api-create-issue-from-heading + "C-c j u" #'jira-api-update-issue-from-heading)) #+end_src ** Source Control #+begin_src emacs-lisp