]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/org-mode-configuration.el
add from-mobile to agenda files
[lib.git] / emacs_el / configuration / org-mode-configuration.el
index 01b7546bcfec0030c17f1d29d39678549845b8ec..6b942a8fdf31dd104ca2377f500214884c409745 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"))
       '(("m" "Mail" entry (file+headline "~/projects/org-notes/refile.org" "Mail")
          "* %?\n\n  Source: %u, %c\n  %i")
         ("t" "todo" entry (file "~/projects/org-notes/refile.org")
-         "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
+         "* TODO %?\n  :PROPERTIES:\n  :END:\n  :LOGBOOK:\n  :END:\n%U\n%a\n" :clock-in t :clock-resume t)
         ("r" "respond" entry (file "~/projects/org-notes/refile.org")
          "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t)
         ("n" "note" entry (file "~/projects/org-notes/refile.org")
          "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
         ("s" "schedule" entry (file "~/projects/org-notes/refile.org")
-         "* %? \n%^{scheduled:}t\n%U\n%a\n" :clock-in t :clock-resume t)
+         "* %? :cal:\n%^{scheduled:}t\n%U\n%a\n" :clock-in t :clock-resume t)
         ("j" "Journal" entry (file+datetree "~/projects/org-notes/diary.org")
          "* %?\n%U\n" :clock-in t :clock-resume t)
         ("w" "org-protocol" entry (file "~/projects/org-notes/refile.org")
@@ -460,14 +461,22 @@ Maildir, or by Message-ID."
    (R . t)
    (latex . t)
    (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
@@ -553,6 +562,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
@@ -833,6 +845,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
@@ -851,6 +864,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)
 
@@ -999,4 +1014,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)