]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/don-configuration.org
add from-calendar and laurel.org to agenda
[lib.git] / emacs_el / configuration / don-configuration.org
index d6a21fa86711e604b52b459a9eec10b79495c03e..6556a069435cfbdcd397645245932bb02c826942 100644 (file)
 Borrowed from https://github.com/nilcons/emacs-use-package-fast/ to
 load  [[https://github.com/jwiegley/use-package/][use-package]] even faster
 #+BEGIN_SRC emacs-lisp
-  (setq package-enable-at-startup nil)
-  (setq package--init-file-ensured t)
-  (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
-                           ("melpa" . "https://melpa.org/packages/")
-                           ("org" . "http://orgmode.org/elpa/") ))
   (eval-and-compile
+    (setq package-enable-at-startup nil)
+    (setq package--init-file-ensured t)
+    (setq package-user-dir "~/var/emacs/elpa")
+    (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
+                             ("melpa" . "https://melpa.org/packages/")
+                             ("org" . "http://orgmode.org/elpa/")))
     (setq use-package-verbose (not (bound-and-true-p byte-compile-current-file))))
   (mapc #'(lambda (add) (add-to-list 'load-path add))
     (eval-when-compile
@@ -52,7 +53,19 @@ load  [[https://github.com/jwiegley/use-package/][use-package]] even faster
                        nil))
                      load-path))))))
 
-  (require 'use-package)
+  ;;; fix up info paths for packages
+  (with-eval-after-load "info"
+    (info-initialize)
+    (dolist (dir (directory-files package-user-dir))
+      (let ((fdir (concat (file-name-as-directory package-user-dir) dir)))
+        (unless (or (member dir '("." ".." "archives" "gnupg"))
+                    (not (file-directory-p fdir))
+                    (not (file-exists-p (concat (file-name-as-directory fdir) "dir"))))
+          (add-to-list 'Info-directory-list fdir)))))
+
+
+  (eval-when-compile
+    (require 'use-package))
   (require 'diminish)
   (require 'bind-key)
 #+END_SRC
@@ -345,6 +358,7 @@ value, scrolling continues until there is no more output.
 *** Auto-YASnippet
 #+BEGIN_SRC emacs-lisp
   (use-package auto-yasnippet
+    :ensure t
     :bind (("H-w" . aya-create)
            ("H-y" . aya-expand)
            )
@@ -373,7 +387,7 @@ value, scrolling continues until there is no more output.
   
     (bind-key "C-n"   #'company-select-next company-active-map)
     (bind-key "C-p"   #'company-select-previous company-active-map)
-    (bind-key "<tab>" #'company-complete company-active-map)
+    (bind-key "<tab>" #'company-complete company-active-map)
     (bind-key "M-?"   #'company-show-doc-buffer company-active-map)
     (bind-key "M-."   #'company-show-location company-active-map)
     (bind-key "M-/"   #'company-complete-common org-mode-map)
@@ -1391,6 +1405,24 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   (setq-default org-log-done 'time)
   (setq-default org-agenda-ndays 5)
 
+  (setq org-agenda-sticky t)
+  (defun dla/show-org-agenda ()
+    (interactive)
+    (let (agendabuffer
+          '(delq nil 
+                (mapcar (lambda (x)
+                          (and (string-match-p
+                                "\*Org Agenda.*\*"
+                                (buffer-name x))
+                               x)
+                          )
+                        (buffer-list))))
+      (if agendabuffer
+          (switch-to-buffer
+           (buffer-name agendabuffer))
+        (org-agenda-list)))
+      (delete-other-windows))
+
   ;; agenda configuration
   ;; Do not dim blocked tasks
   (setq org-agenda-dim-blocked-tasks nil)
@@ -1484,6 +1516,8 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
             "~/projects/org-notes/wildman.org"
             "~/projects/org-notes/uddin.org"
             "~/projects/org-notes/reviews.org"
+            "~/projects/org-notes/laurel.org"
+            "~/projects/org-notes/from-calendar.org"
             "~/org-mode/from-mobile.org"
             "~/projects/org-notes/fh.org")))
 
@@ -1519,37 +1553,37 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 #+END_SRC
 ** Capture Templates
 #+BEGIN_SRC emacs-lisp
-    (setq org-capture-templates  ;; mail-specific note template, identified by "m"
-          `(("m" "Mail" entry (file "~/projects/org-notes/refile.org")
-             "* %?\n\n  Source: %u, [[%:link][%:description]]\n  %:initial")
-            ("t" "todo" entry (file "~/projects/org-notes/refile.org")
-             "* 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")
-             "* %? :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")
-             "* TODO Review %c\n%U\n" :immediate-finish t)
-            ("M" "Meeting" entry (file "~/projects/org-notes/refile.org")
-             "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
-            ("S" "Seminar" entry (file "~/projects/org-notes/refile.org")
-             "* SEMINAR notes %? :SEMINAR:\n%U" :clock-in t :clock-resume t)
-            ("P" "Paper to read" entry (file+headline "~/projects/research/papers_to_read.org" "Refile")
-             "* TODO Get/Read %? \n%U" :clock-in t :clock-resume t)
-            ("p" "Phone call" entry (file "~/projects/org-notes/refile.org")
-             "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
-             ("J" "job" entry (file+olp "~/projects/org-notes/notes.org"
-                                         "Jobs"
-                                         ,(format-time-string "Positions %Y"))
-             "* TODO Apply for %? :job:\nSCHEDULED: <%<%Y-%m-%d>>\n%U\n%x\n" :clock-in t :clock-resume t)
-            ("h" "Habit" entry (file "~/projects/org-notes/refile.org")
-             "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"<%Y-%m-%d .+1d/3d>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n%a\n")
-            )
+  (setq org-capture-templates  ;; mail-specific note template, identified by "m"
+        `(("m" "Mail" entry (file "~/projects/org-notes/refile.org")
+           "* %?\n\n  Source: %u, [[%:link][%:description]]\n  %:initial")
+          ("t" "todo" entry (file "~/projects/org-notes/refile.org")
+           "* 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")
+           "* %? :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")
+           "* TODO Review %c\n%U\n" :immediate-finish t)
+          ("M" "Meeting" entry (file "~/projects/org-notes/refile.org")
+           "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
+          ("S" "Seminar" entry (file "~/projects/org-notes/refile.org")
+           "* SEMINAR notes %? :SEMINAR:\n%U" :clock-in t :clock-resume t)
+          ("P" "Paper to read" entry (file+headline "~/projects/research/papers_to_read.org" "Refile")
+           "* TODO Get/Read %? \n%U" :clock-in t :clock-resume t)
+          ("p" "Phone call" entry (file "~/projects/org-notes/refile.org")
+           "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
+           ("J" "job" entry (file+olp "~/projects/org-notes/notes.org"
+                                       "Jobs"
+                                       ,(format-time-string "Positions %Y"))
+           "* TODO Apply for %? :job:\nSCHEDULED: <%<%Y-%m-%d>>\n%U\n%x\n" :clock-in t :clock-resume t)
+          ("h" "Habit" entry (file "~/projects/org-notes/refile.org")
+           "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"<%Y-%m-%d .+1d/3d>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n%a\n")
           )
+        )
 
   ;; Remove empty LOGBOOK drawers on clock out
   (defun bh/remove-empty-drawer-on-clock-out ()
@@ -1583,7 +1617,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
           ("<S-f5>" . bh/widen)
           ("<f7>" . bh/set-truncate-lines)
           ("<f8>" . org-cycle-agenda-files)
-          ("<f9> <f9>" . bh/show-org-agenda)
+          ("<f9> <f9>" . org-agenda)
           ("<f9> b" . bbdb)
           ("<f9> c" . calendar)
           ("<f9> f" . boxquote-insert-file)
@@ -1591,8 +1625,6 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
           ("<f9> n" . bh/toggle-next-task-display)
           ("<f9> w" . widen)
 
-          ("<f9> o" . bh/make-org-scratch)
-
           ("<f9> r" . boxquote-region)
           ("<f9> s" . bh/switch-to-scratch)
 
@@ -1632,11 +1664,6 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
       (set-window-start (selected-window)
                         (window-start (selected-window)))))
 
-  (defun bh/make-org-scratch ()
-    (interactive)
-    (find-file "/tmp/publish/scratch.org")
-    (gnus-make-directory "/tmp/publish"))
-
   (defun bh/switch-to-scratch ()
     (interactive)
     (switch-to-buffer "*scratch*"))
@@ -1761,7 +1788,9 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
     (setq my-org-protocol-flag t))
 
   (defadvice org-insert-todo-heading (after dla/create-id activate)
-    (org-id-get-create)
+    (unless (org-in-item-p)
+      (org-id-get-create)
+      )
     )
 
   ;; org modules
@@ -2353,8 +2382,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 * Debian
 ** debian-changelog
 #+BEGIN_SRC emacs-lisp
-  (use-package debian-changelog
-    :ensure f
+  (use-package debian-changelog-mode
     :mode "debian/changelog"
     :config
     (setq debian-changelog-mailing-address "don@debian.org")
@@ -2367,10 +2395,6 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   (setq case-fold-search t)
   (setq confirm-kill-emacs (quote y-or-n-p))
   (setq cperl-lazy-help-time nil)
-  (display-time)
-  (setq display-time-24hr-format t)
-  (setq display-time-day-and-date t)
-  (display-time-mode 1)
   (global-font-lock-mode 1)
   (icomplete-mode 1)
   (setq log-edit-keep-buffer t)
@@ -2448,7 +2472,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 If the envvar EMACS_SERVER_NAME is set, consider this a separate
 emacs, and use a different desktop file to restore history
 #+BEGIN_SRC emacs-lisp
-  (use-package emacs
+  (use-package desktop
     :demand
     :config
     (setq desktop-base-file-name