From: Frederik Vanrenterghem Date: Wed, 9 Apr 2025 14:08:11 +0000 (+0800) Subject: Improve Org drawing and calendar configuration. X-Git-Url: http://git.vanrenterghem.biz/Dotty.git/commitdiff_plain/778bee4ef81147222132f11e616156ab0c59fb28?ds=inline Improve Org drawing and calendar configuration. - Support Gnuplot. - Support edraw-org. - Redisplay inline org images. - Use inbox file for calendar. - Export todo items to calendar. --- diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 7df9f5a..89adbf7 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -151,6 +151,9 @@ vc-follow-symlinks t ;; ... ) +(use-package gnuplot + :ensure t) + (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) + (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) @@ -217,7 +230,9 @@ vc-follow-symlinks 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. @@ -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 - (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) +(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