]> git.vanrenterghem.biz Git - Dotty.git/commitdiff
Improve Org drawing and calendar configuration.
authorFrederik Vanrenterghem <frederik@vanrenterghem.biz>
Wed, 9 Apr 2025 14:08:11 +0000 (22:08 +0800)
committerFrederik Vanrenterghem <frederik@vanrenterghem.biz>
Wed, 9 Apr 2025 14:08:11 +0000 (22:08 +0800)
- Support Gnuplot.
- Support edraw-org.
- Redisplay inline org images.
- Use inbox file for calendar.
- Export todo items to calendar.

emacs/.emacs.d/init.el

index 7df9f5a0e62123c5f925b92bf5f4c5a77614a896..89adbf7aa7257382008dbc427a464a683845eb7d 100644 (file)
@@ -151,6 +151,9 @@ vc-follow-symlinks t
   ;; ...
   )
 
   ;; ...
   )
 
+(use-package gnuplot
+  :ensure t)
+
 (use-package org
   :ensure t
   :bind
 (use-package org
   :ensure t
   :bind
@@ -209,6 +212,16 @@ vc-follow-symlinks t
   (setq org-agenda-skip-deadline-if-done t)
   (setq org-agenda-start-on-weekday nil)
   (setq org-log-done 'time)
   (setq org-agenda-skip-deadline-if-done t)
   (setq org-agenda-start-on-weekday nil)
   (setq org-log-done 'time)
+  (require 'subr-x)
+  (defun fv/org-babel-after-execute-redisplay ()
+  "Redisplay inline images in subtree if cursor in source block with :result graphics."
+
+  (when-let ((info (org-babel-get-src-block-info t))
+             (params (org-babel-process-params (nth 2 info)))
+             (result-params (cdr (assq :result-params params)))
+             ((member "graphics" result-params)))
+    (org-display-inline-images nil t)))
+  (add-hook 'org-babel-after-execute-hook #'fv/org-babel-after-execute-redisplay)
   ;; Automatically flow lines based on window width and use
   ;; variable width fonts in org-mode.
   (add-hook 'org-mode-hook 'visual-line-mode)
   ;; Automatically flow lines based on window width and use
   ;; variable width fonts in org-mode.
   (add-hook 'org-mode-hook 'visual-line-mode)
@@ -217,7 +230,9 @@ vc-follow-symlinks t
   (org-babel-do-load-languages
    'org-babel-load-languages
    '((R . t)
   (org-babel-do-load-languages
    'org-babel-load-languages
    '((R . t)
-     (latex . t))))
+     (latex . t)
+     (gnuplot . t)
+     (dot . t))))
 
 (defun fv/org-capture-appointment-timestamp (&optional duration)
   "Get an Org timestamp for an appointment.
 
 (defun fv/org-capture-appointment-timestamp (&optional duration)
   "Get an Org timestamp for an appointment.
@@ -238,13 +253,28 @@ minutes), and return a formatted Org timestamp with start and end times."
   ;; Org filename where new entries from calendar stored
   (setq org-caldav-inbox '(file+olp+datetree "~/Nextcloud/notes/calendar-nextcloud.org"))
   ;; Additional Org files to check for calendar events
   ;; Org filename where new entries from calendar stored
   (setq org-caldav-inbox '(file+olp+datetree "~/Nextcloud/notes/calendar-nextcloud.org"))
   ;; Additional Org files to check for calendar events
-  (setq org-caldav-files nil)
+  (setq org-caldav-files `(,org-default-notes-file))
+  (setq org-export-with-broken-links t)
+  ;; This makes sure to-do items as a category can show up on the calendar
+  (setq org-icalendar-include-todo t)
+  ;; This ensures all org "deadlines" show up, and show up as due dates
+  (setq org-icalendar-use-deadline '(event-if-todo event-if-not-todo todo-due))
+  ;; This ensures "scheduled" org items show up, and show up as start times
+  (setq org-icalendar-use-scheduled '(todo-start event-if-todo event-if-not-todo))
   ;; Usually a good idea to set the timezone manually
   (setq org-icalendar-timezone "Australia/Perth")
   (setq org-caldav-delete-calendar-entries 'ask))
 
 (use-package org-protocol)
 
   ;; Usually a good idea to set the timezone manually
   (setq org-icalendar-timezone "Australia/Perth")
   (setq org-caldav-delete-calendar-entries 'ask))
 
 (use-package org-protocol)
 
+(use-package edraw-org
+  :ensure nil ;; cloned in
+  :load-path "~/.emacs.d/lisp/el-easydraw/"
+  :after (org)
+  :config
+  (edraw-org-setup-default)
+  (edraw-org-setup-exporter))
+  
 (use-package tex
   :ensure auctex
   :config
 (use-package tex
   :ensure auctex
   :config