Add ejira, remove results from config file
This commit is contained in:
parent
936e09ce31
commit
a345a1da44
1 changed files with 47 additions and 7 deletions
|
|
@ -36,9 +36,6 @@ To get started, run =C-c C-v t=
|
|||
t)))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
| org-appear-mode | org-tempo-setup | yas-minor-mode | #[nil (evil-org-mode) nil] | #[0 \300\301\302\303\304$\207 [add-hook change-major-mode-hook org-fold-show-all append local] 5] | #[0 \300\301\302\303\304$\207 [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] | org-babel-result-hide-spec | org-babel-hide-all-hashes | #[0 \301\211\207 [imenu-create-index-function org-imenu-get-tree] 2] | #[nil ((display-line-numbers-mode 0)) nil] | #[nil ((add-hook 'after-save-hook #'dotfiles/org-babel-tangle-config nil t)) nil] |
|
||||
|
||||
** Package initialization
|
||||
=TODO:= savehist mode doesn't seem to save the history correctly
|
||||
#+begin_src emacs-lisp
|
||||
|
|
@ -1207,11 +1204,56 @@ that ever loads/starts the corresponding package.
|
|||
:target (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n"))))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
| d | Daily Routine | entry | * Scheduled Today |
|
||||
* Jira
|
||||
#+begin_src emacs-lisp
|
||||
(use-package jiralib2
|
||||
:straight (jiralib2 :host github :repo "nyyManni/jiralib2")
|
||||
:commands (jiralib2-get-projects))
|
||||
|
||||
(use-package ejira
|
||||
:straight (ejira :host github :repo "nyyManni/ejira")
|
||||
:after (org jiralib2)
|
||||
:commands (ejira-update-my-issues ejira-update-issues-in-project
|
||||
ejira-switch-jira-instance)
|
||||
:config
|
||||
(setq jiralib2-auth 'token)
|
||||
|
||||
;; name -> (url . email) ; email differs per-account
|
||||
(defvar my/jira-instances
|
||||
(if IS-MACOS
|
||||
'(("ians-tasks" . ("https://ians-tasks.atlassian.net" . "ian@keane.sh"))
|
||||
;; add more here, e.g.:
|
||||
;; ("otherco" . ("https://otherco.atlassian.net" . "ian@otherco.com"))
|
||||
)
|
||||
'(("ians-tasks" . ("https://ians-tasks.atlassian.net" . "ian@keane.sh")))))
|
||||
|
||||
(defvar my/jira-current-instance nil)
|
||||
|
||||
(defun my/jira-set-projects ()
|
||||
"Auto-populate ejira-projects from the currently configured Jira instance."
|
||||
(setq ejira-projects
|
||||
(mapcar (lambda (p) (alist-get 'key p)) (jiralib2-get-projects))))
|
||||
|
||||
(defun ejira-switch-jira-instance (&optional name)
|
||||
"Switch active Jira instance/account and refresh project list."
|
||||
(interactive
|
||||
(list (completing-read "Jira instance: " (mapcar #'car my/jira-instances) nil t)))
|
||||
(let* ((name (or name (caar my/jira-instances)))
|
||||
(entry (alist-get name my/jira-instances nil nil #'equal)))
|
||||
(unless entry (error "Unknown jira instance: %s" name))
|
||||
(setq jiralib2-url (car entry))
|
||||
(setq jiralib2-user-login-name (cdr entry))
|
||||
(setq jiralib2-token (password-store-get (format "jira/%s" name)))
|
||||
(setq my/jira-current-instance name)
|
||||
(setq ejira-org-directory
|
||||
(expand-file-name (format "jira/%s" name) "~/notes"))
|
||||
(make-directory ejira-org-directory t)
|
||||
(my/jira-set-projects)
|
||||
(message "Switched to Jira instance: %s (%s)" name (car entry))))
|
||||
|
||||
;; auto-select the default (and only, on Linux) instance at load time
|
||||
(ejira-switch-jira-instance (caar my/jira-instances)))
|
||||
#+end_src
|
||||
|
||||
* Project management
|
||||
#+begin_src emacs-lisp
|
||||
|
|
@ -1346,8 +1388,6 @@ Idk I think this came from the vertico readme
|
|||
embark-isearch-highlight-indicator))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
|
||||
** Snippets
|
||||
#+begin_src emacs-lisp
|
||||
(use-package yasnippet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue