Merge branch 'main' of git.sr.ht:~marcuskammer/emacs.d

This commit is contained in:
Marcus Kammer 2023-09-28 18:05:34 +02:00
commit 5ba08fca2d
Signed by: marcuskammer
GPG key ID: C374817BE285268F
2 changed files with 59 additions and 16 deletions

View file

@ -144,39 +144,56 @@
(":-)" . "😊")
(":-(" . "😞")))
;; Notes are always in the context of a specific task.
(defun mk/link-to-current-task ()
"Return an Org link to the current clocked-in task, if any, or prompt for manual entry."
(if (org-clock-is-active)
(with-current-buffer (marker-buffer org-clock-marker)
(save-excursion
(goto-char org-clock-marker)
(format ":TASK_ID: [[id:%s][%s]]" (org-id-get) (org-get-heading t t))))
(let ((manual-id (read-string "Enter Task ID (leave empty if not applicable): ")))
(unless (string-empty-p manual-id)
(format ":TASK_ID: [[id:%s][Task]]" manual-id)))))
(add-to-list 'org-capture-templates
'("n" "Note" entry (file+headline "agenda/notes.org" "Notes")
"* %? :NOTE:\n%i\n%a"))
`("n" "Note" entry (file+headline "agenda/notes.org" "Notes")
,(concat "* %? :NOTE:\n"
":PROPERTIES:\n"
"%(mk/link-to-current-task)\n"
":END:\n"
"%i\n%a\n"
"Entered on: %U\n")))
;; A task can be everything to do which involves some kind of physical activity.
(add-to-list 'org-capture-templates
'("t" "Task" entry (file "agenda/tasks.org")
"* TODO %? :TASK:\nEntered on %U\n%a"))
`("t" "Task" entry (file "agenda/tasks.org")
,(format "* TODO %%? :TASK:\n:PROPERTIES:\n:ID: %s\n:END:\nEntered on %%U\n%%a"
(org-id-new))))
;; A journal is an unordered collection of thougths and ideas.
(add-to-list 'org-capture-templates
'("j" "Journal" entry (file "agenda/journal.org")
"* %? :JOURNAL:\nEntered on %T\n\n"
'("j" "Journal" entry (file+olp+datetree "agenda/journal.org")
"* %T - End of Day Reflection :JOURNAL:\n- What went well today?\n %?\n- What could have been improved?\n \n- What will I focus on tomorrow?\n "
:empty-lines 1))
;; Remember me of an important event.
(add-to-list 'org-capture-templates
'("a" "Appointment" entry (file "agenda/appointments.org")
"* %? :APPOINTMENT:\n%T\n"))
;; Capture a meeting
(add-to-list 'org-capture-templates
'("m" "Meeting" entry (file "agenda/meetings.org")
"* %^{Topic} :MEETING:\n%T\n%?"
:clock-in t
:empty-lines 1))
;; Capture activities in a chronological order.
(add-to-list 'org-capture-templates
'("l" "Log" entry (file+olp+datetree "agenda/logbook.org")
"* %T - %^{Activity} :LOG:\n%?"
:clock-in t
:empty-lines 1))
;; Record general hours
(add-to-list 'org-capture-templates
'("A" "Allgemein" table-line (file+olp "agenda/hours.org")
"| %u | %^{Stunden} | %? |"))
(add-to-list 'org-capture-templates
'("u" "UTM Parameters" entry (file+headline "utm.org" "UTM Parameters")
@ -190,6 +207,35 @@
'("c" "Code Snippet" entry (file+headline "code.org" "Snippets")
"* %?\n#+begin_src %^{language}\n%i\n#+end_src"))
(add-to-list 'org-capture-templates
'("H" "How Might We" entry (file+headline "interviews.org" "HMW Questions")
"* HOW MIGHT WE %? :HMW:\n%U\n** Interviewee: %^{Interviewee}\n** Context: %^{Context}\n"))
(require 'request)
(defun fetch-gitlab-issue-and-capture ()
(interactive)
(let ((project-id (read-string "Enter GitLab Project ID: "))
(issue-id (read-string "Enter GitLab Issue ID: "))
(gitlab-token (getenv "GITLAB_TOKEN")))
(unless gitlab-token
(error "GITLAB_TOKEN environment variable not set"))
(request
(format "https://code.siemens.com/api/v4/projects/%s/issues/%s" project-id issue-id)
:headers `(("Private-Token" . ,gitlab-token))
:parser 'json-read
:success (cl-function
(lambda (&key data &allow-other-keys)
(org-capture nil "g")
(let ((title (assoc-default 'title data))
(description (assoc-default 'description data)))
(insert (format "%s\n%s" title description))))))))
(add-to-list 'org-capture-templates
'("g" "GitLab Issue" entry (file "gitlab_issues.org")
"* %?"))
(global-set-key (kbd "C-c g") 'fetch-gitlab-issue-and-capture)
(use-package org-roam
:after org

View file

@ -50,15 +50,13 @@
("\\?\\?\\?+" . "#dc752f")))
'(initial-buffer-choice
"d:/UserData/marcus.kammer/OneDrive - Siemens AG/org/agenda/tasks.org")
; '(initial-frame-alist '((fullscreen . maximized)))
'(ispell-program-name "c:/msys64/ucrt64/bin/hunspell.exe")
'(ls-lisp-dirs-first t)
'(magit-git-executable "C:/Program Files/Git/mingw64/libexec/git-core/git.exe")
'(mail-host-address "evosoft.com")
'(mail-send-hook nil)
'(mouse-wheel-scroll-amount '(1 ((shift) . 1) ((meta)) ((control) . text-scale)))
'(org-agenda-files
'("agenda/meetings.org" "agenda/tasks.org" "agenda/appointments.org"))
'(org-agenda-files '("d:/UserData/marcus.kammer/OneDrive - Siemens AG/org/agenda/"))
'(org-directory "d:/UserData/marcus.kammer/OneDrive - Siemens AG/org/")
'(org-modules
'(ol-bbdb ol-bibtex ol-docview ol-eww ol-gnus ol-info ol-irc ol-mhe ol-rmail org-tempo ol-w3m))
@ -66,7 +64,7 @@
'(org-roam-db-autosync-mode t)
'(org-roam-directory "d:/UserData/marcus.kammer/OneDrive - Siemens AG/org/")
'(package-selected-packages
'(jabber js2-mode gptel elpher plantuml-mode htmlize hyperbole typescript-mode markdown-mode csv-mode yaml-mode magit nim-mode ox-rss kotlin-mode nano-theme mastodon mpv ob-http ob-go powershell ox-reveal org-web-tools org-tree-slide org-roam elfeed erc-image go-translate simple-httpd slime racket-mode web-mode go-mode eglot nov shrface smartparens emojify olivetti rainbow-delimiters helpful doom-modeline doom-themes all-the-icons-dired all-the-icons))
'(ob-restclient restclient which-key auctex ace-window jabber js2-mode gptel elpher plantuml-mode htmlize hyperbole typescript-mode markdown-mode csv-mode yaml-mode magit nim-mode kotlin-mode nano-theme mastodon mpv ob-http powershell ox-reveal org-web-tools org-tree-slide org-roam elfeed erc-image go-translate simple-httpd slime racket-mode web-mode go-mode eglot nov shrface smartparens emojify olivetti rainbow-delimiters helpful doom-modeline doom-themes all-the-icons-dired all-the-icons))
'(python-indent-guess-indent-offset nil)
'(python-shell-interpreter "ipython")
'(python-shell-interpreter-args "-i --simple-prompt --InteractiveShell.display_page=True")
@ -79,7 +77,6 @@
'(sql-sqlite-program
"~/AppData/Local/Programs/sqlite-tools-win32-x86-3410200/sqlite3.exe")
'(subed-mpv-executable "c:/AppData/Local/Programs/mpv/mpv.exe")
'(tab-bar-mode nil)
'(tetris-x-colors
[[229 192 123]
[97 175 239]