Refactor org related code
This commit is contained in:
parent
618e69fc3d
commit
eb88540696
25
config.el
25
config.el
@ -42,10 +42,6 @@
|
|||||||
;; change `org-directory'. It must be set before org loads!
|
;; change `org-directory'. It must be set before org loads!
|
||||||
(setq org-directory "~/Nextcloud/org/")
|
(setq org-directory "~/Nextcloud/org/")
|
||||||
|
|
||||||
(after! org
|
|
||||||
;; Store org links to info pages
|
|
||||||
(add-to-list 'org-modules 'ol-info))
|
|
||||||
|
|
||||||
;; (defun max/org-gtd--incubate ()
|
;; (defun max/org-gtd--incubate ()
|
||||||
;; "Process GTD inbox item by incubating it.
|
;; "Process GTD inbox item by incubating it.
|
||||||
;; Allow the user apply user-defined tags from
|
;; Allow the user apply user-defined tags from
|
||||||
@ -366,26 +362,6 @@
|
|||||||
|
|
||||||
;; (setq ns-auto-hide-menu-bar t)
|
;; (setq ns-auto-hide-menu-bar t)
|
||||||
|
|
||||||
(defun max/org-clock-get-clock-string ()
|
|
||||||
"Form a clock string that will be shown in polybar.
|
|
||||||
Adapted from `org-clock-get-clock-string'."
|
|
||||||
(require 'org-clock)
|
|
||||||
(when (org-clocking-p)
|
|
||||||
(let* ((currently-clocked-time
|
|
||||||
(floor (org-time-convert-to-integer
|
|
||||||
(time-since org-clock-start-time))
|
|
||||||
60))
|
|
||||||
(clocked-time (org-clock-get-clocked-time))
|
|
||||||
(current-work-done-str (org-duration-from-minutes currently-clocked-time)))
|
|
||||||
(if org-clock-effort
|
|
||||||
(let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort))
|
|
||||||
(work-done-str (org-duration-from-minutes clocked-time))
|
|
||||||
(effort-str (org-duration-from-minutes effort-in-minutes)))
|
|
||||||
(format "%s (%s/%s) %s"
|
|
||||||
current-work-done-str work-done-str effort-str org-clock-heading))
|
|
||||||
(format "%s %s"
|
|
||||||
current-work-done-str
|
|
||||||
org-clock-heading)))))
|
|
||||||
|
|
||||||
;; (defun my/toggle-org-agenda ()
|
;; (defun my/toggle-org-agenda ()
|
||||||
;; "Toggle my custom org agenda view"
|
;; "Toggle my custom org agenda view"
|
||||||
@ -503,3 +479,4 @@ Adapted from `org-clock-get-clock-string'."
|
|||||||
;; load personal modules
|
;; load personal modules
|
||||||
(load! "email")
|
(load! "email")
|
||||||
(load! "gtd")
|
(load! "gtd")
|
||||||
|
(load! "org")
|
||||||
|
31
org.el
Normal file
31
org.el
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
;;; org.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defun max/org-clock-get-clock-string ()
|
||||||
|
"Form a clock string that will be shown in polybar.
|
||||||
|
Adapted from `org-clock-get-clock-string'."
|
||||||
|
(require 'org-clock)
|
||||||
|
(when (org-clocking-p)
|
||||||
|
(let* ((currently-clocked-time
|
||||||
|
(floor (org-time-convert-to-integer
|
||||||
|
(time-since org-clock-start-time))
|
||||||
|
60))
|
||||||
|
(clocked-time (org-clock-get-clocked-time))
|
||||||
|
(current-work-done-str (org-duration-from-minutes currently-clocked-time)))
|
||||||
|
(if org-clock-effort
|
||||||
|
(let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort))
|
||||||
|
(work-done-str (org-duration-from-minutes clocked-time))
|
||||||
|
(effort-str (org-duration-from-minutes effort-in-minutes)))
|
||||||
|
(format "%s (%s/%s) %s"
|
||||||
|
current-work-done-str work-done-str effort-str org-clock-heading))
|
||||||
|
(format "%s %s"
|
||||||
|
current-work-done-str
|
||||||
|
org-clock-heading)))))
|
||||||
|
|
||||||
|
(after! org
|
||||||
|
;; Store org links to info pages
|
||||||
|
(add-to-list 'org-modules 'ol-info))
|
||||||
|
|
||||||
|
(map! :after org
|
||||||
|
:map org-mode-map
|
||||||
|
:localleader
|
||||||
|
"Y" #'ox-clip-image-to-clipboard)
|
Loading…
x
Reference in New Issue
Block a user