]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/org-mode-configuration.el
add automatic reminders for appointments
[lib.git] / emacs_el / configuration / org-mode-configuration.el
index 59219fcf4492af158dfd5d7e1e76f9d30536c6f6..bd1d036a8910929c5e44e9f3cba7301f991df209 100644 (file)
              "~/projects/org-notes/uddin.org"
           "~/projects/org-notes/reviews.org"
           "~/projects/org-notes/hpcbio.org"
+          "~/org-mode/from-mobile.org"
              "~/projects/org-notes/fh.org")))
 
 (set-register ?n (cons 'file "~/projects/org-notes/notes.org"))
 (setq org-global-properties '(("Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00")))
 (setq org-columns-default-format "%40ITEM(Task) %6Effort{:} %CLOCKSUM %PRIORITY %TODO %13SCHEDULED %13DEADLINE %TAGS")
 
+;; add automatic reminders for appointments
+(defadvice  org-agenda-redo (after org-agenda-redo-add-appts)
+  "Pressing `r' on the agenda will also add appointments."
+  (progn 
+    (setq appt-time-msg-list nil)
+    (org-agenda-to-appt)))
+
 (setq org-default-notes-file "~/projects/org-notes/notes.org")
 (setq org-id-link-to-org-use-id t)
 (setq org-capture-templates  ;; mail-specific note template, identified by "m"
@@ -408,7 +416,7 @@ Maildir, or by Message-ID."
   "Open a paper pdf by bibtex key"
   (interactive "bibtex key: ")
   (shell-command
-   (format "%s -p evince %s"
+   (format "%s -p evince_annot %s"
        (substitute-in-file-name "$HOME/bin/bibtex_to_paper") bibtexkey)))
 (org-add-link-type "papers-pdf" 'open-research-paper-pdf)
 
@@ -441,8 +449,8 @@ Maildir, or by Message-ID."
                    'my-rtcite-export-handler)
 
 
-(setq-default org-mobile-directory "/rzlab.ucr.edu:/sites/dav.donarmstrong.com/root/org/")
-(when (string= system-name "rzlab.ucr.edu")
+(setq-default org-mobile-directory "/linnode.donarmstrong.com:/sites/dav.donarmstrong.com/root/org/")
+(when (string= system-name "linnode.donarmstrong.com")
   (setq-default org-mobile-directory "/sites/dav.donarmstrong.com/root/org/"))
 (setq-default org-directory "/home/don/org-mode/")
 (setq-default org-mobile-inbox-for-pull "/home/don/org-mode/from-mobile.org")
@@ -462,13 +470,20 @@ Maildir, or by Message-ID."
    (ditaa . t)
    (dot . t)
    ))
+;; use graphviz-dot for dot things
+(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
 ;; org-babel-by-backend
 (defmacro org-babel-by-backend (&rest body)
    `(case (if (boundp 'backend) 
               (org-export-backend-name backend)
             nil) ,@body))
 
+(defun my/fix-inline-images ()
+  (when org-inline-image-overlays
+    (org-redisplay-inline-images)))
 
+(add-hook 'org-babel-after-execute-hook
+           'my/fix-inline-images)
 
 ;; ;; org latex
 ;; ;; stolen from http://kieranhealy.org/esk/kjhealy.html
@@ -554,6 +569,9 @@ Maildir, or by Message-ID."
         ("" "longtable" nil)
         ("" "float" )))
 
+;; make equations larger
+(setq org-format-latex-options (plist-put org-format-latex-options :scale 2.0))
+
 (defun org-create-formula--latex-header ()
   "Return LaTeX header appropriate for previewing a LaTeX snippet."
   (let ((info (org-combine-plists (org-export--get-global-options
@@ -834,6 +852,7 @@ Skip project and sub-project tasks, habits, and loose non-project tasks."
 (setq org-clock-in-resume t)
 ;; Change tasks to NEXT when clocking in
 (setq org-clock-in-switch-to-state 'bh/clock-in-to-next)
+;; (setq org-clock-in-switch-to-state "NEXT")
 ;; Separate drawers for clocking and logs
 (setq org-drawers (quote ("PROPERTIES" "LOGBOOK")))
 ;; Save clock data and state changes and notes in the LOGBOOK drawer
@@ -852,6 +871,8 @@ Skip project and sub-project tasks, habits, and loose non-project tasks."
 ;; Include current clocking task in clock reports
 (setq org-clock-report-include-clocking-task t)
 
+;; the cache seems to be broken
+(setq org-element-use-cache nil)
 
 (defvar bh/keep-clock-running nil)
 
@@ -1000,4 +1021,41 @@ same directory as the org-buffer and insert a link to this file."
   (insert (concat "[[" my/org-insert-screenshot/filename "]]"))
   (org-display-inline-images))
 
+(defun my/fix-inline-images ()
+  (when org-inline-image-overlays
+    (org-redisplay-inline-images)))
+
+(add-hook 'org-babel-after-execute-hook 'my/fix-inline-images)
+
+; from http://orgmode.org/Changes.html
+(defun my/org-repair-property-drawers ()
+  "Fix properties drawers in current buffer.
+ Ignore non Org buffers."
+  (interactive)
+  (when (eq major-mode 'org-mode)
+    (org-with-wide-buffer
+     (goto-char (point-min))
+     (let ((case-fold-search t)
+           (inline-re (and (featurep 'org-inlinetask)
+                           (concat (org-inlinetask-outline-regexp)
+                                   "END[ \t]*$"))))
+       (org-map-entries
+        (lambda ()
+          (unless (and inline-re (org-looking-at-p inline-re))
+            (save-excursion
+              (let ((end (save-excursion (outline-next-heading) (point))))
+                (forward-line)
+                (when (org-looking-at-p org-planning-line-re) (forward-line))
+                (when (and (< (point) end)
+                           (not (org-looking-at-p org-property-drawer-re))
+                           (save-excursion
+                             (and (re-search-forward org-property-drawer-re end t)
+                                  (eq (org-element-type
+                                       (save-match-data (org-element-at-point)))
+                                      'drawer))))
+                  (insert (delete-and-extract-region
+                           (match-beginning 0)
+                           (min (1+ (match-end 0)) end)))
+                  (unless (bolp) (insert "\n"))))))))))))
+
 (provide 'org-mode-configuration)