+#+END_SRC
+** Writeroom Mode
+#+BEGIN_SRC emacs-lisp
+ (use-package writeroom-mode
+ :config
+ (defun my/writing-mode ()
+ "Start my writing mode; enable visual-line-mode and auto-fill-mode"
+ (interactive)
+ (if writeroom-mode
+ (progn
+ (writeroom-mode -1)
+ (visual-line-mode -1)
+ (auto-fill-mode -1)
+ (visual-fill-column-mode -1)
+ )
+ (visual-line-mode 1)
+ (auto-fill-mode 1)
+ (visual-fill-column-mode 1)
+ (writeroom-mode 1))
+ )
+ )
+#+END_SRC
+** GhostText/Atomic Chrome
+#+BEGIN_SRC emacs-lisp
+ (use-package atomic-chrome
+ :config
+ (ignore-errors (atomic-chrome-start-server))
+ (setq atomic-chrome-buffer-open-style 'full)
+ )
+#+END_SRC
+** Multiple Cursors
+ :PROPERTIES:
+ :ID: 6fcf218b-a762-4c37-9339-a8202ddeb544
+ :END:
+[[https://github.com/magnars/multiple-cursors.el][Multiple Cursors]]
+#+BEGIN_SRC emacs-lisp
+ (use-package multiple-cursors
+ :bind* (("C-;" . mc/mark-all-dwim)
+ ("C-<" . mc/mark-previous-like-this)
+ ("C->" . mc/mark-next-like-this)
+ ("C-S-c C-S-c" . mc/edit-lines))
+ )
+#+END_SRC
+** Web Mode
+#+BEGIN_SRC emacs-lisp
+ (use-package web-mode
+ :config
+ (add-to-list 'auto-mode-alist '("\\.tmpl\\'" . web-mode))
+ (setq web-mode-enable-engine-detection t)
+ (setq web-mode-engines-alist
+ '(("template-toolkit" . "\\.tmpl\\'")))
+ )
+#+END_SRC
+** Spamassassin Mode
+#+BEGIN_SRC emacs-lisp
+ (use-package spamassassin-mode
+ :commands spamassassin-mode
+ :ensure f
+ )
+#+END_SRC
+** Password Store
+#+BEGIN_SRC emacs-lisp
+ (use-package password-store
+ :ensure f
+ :commands password-store-edit password-store-create
+ )
+#+END_SRC
+** CSS mode
+#+BEGIN_SRC emacs-lisp
+ (use-package css
+ :mode "\\.css'"
+ :config
+ ;; fix up css mode to not be silly
+ ;; from http://www.stokebloke.com/wordpress/2008/03/21/css-mode-indent-buffer-fix/
+ (setq cssm-indent-level 4)
+ (setq cssm-newline-before-closing-bracket t)
+ (setq cssm-indent-function #'cssm-c-style-indenter)
+ (setq cssm-mirror-mode nil))
+#+END_SRC
+** Abbrev Mode
+#+BEGIN_SRC emacs-lisp
+ (use-package abbrev
+ :diminish abbrev-mode
+ :config
+ ;; load abbreviations from
+ (setq abbrev-file-name
+ "~/.emacs_abbrev_def")
+
+ ;; read the abbrev file if it exists
+ (if (file-exists-p abbrev-file-name)
+ (quietly-read-abbrev-file))
+
+ ;; for now, use abbrev mode everywhere
+ (setq default-abbrev-mode t))
+#+END_SRC
+
+* Email
+** Mutt
+*** Message-mode
+#+BEGIN_SRC emacs-lisp
+ (use-package message
+ :ensure f
+ :diminish (message "✉")
+ :mode ("muttng-[a-z0-9]+-[0-9]+-" . message-mode)
+ :mode ("mutt-[a-z0-9]+-[0-9]+-" . message-mode)
+ :hook 'my/message-mode-settings
+ :hook 'turn-on-flyspell
+ :bind (:map message-mode-map
+ ("C-c C-a" . my/post-attach-file))
+ :delight (message-mode "✉")
+ :config
+ (defun my/message-mode-settings ()
+ (font-lock-add-keywords nil
+ '(("^[ \t]*>[ \t]*>[ \t]*>.*$"
+ (0 'message-multiply-quoted-text-face))
+ ("^[ \t]*>[ \t]*>.*$"
+ (0 'message-double-quoted-text-face))))
+ )
+
+ (defun my/post-attach-file ()
+ "Prompt for an attachment."
+ (interactive)
+ (let ((file (read-file-name "Attach file: " nil nil t nil)))
+ (my/header-attach-file file "")))
+
+ (defun my/header-attach-file (file description)
+ "Attach a FILE to the current message (works with Mutt).
+ Argument DESCRIPTION MIME description."
+ (interactive "fAttach file: \nsDescription: ")
+ (when (> (length file) 0)
+ (save-excursion
+ (save-match-data
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (search-forward-regexp "^$")
+ (insert (concat "Attach: " (replace-regexp-in-string "\\([[:space:]\\]\\)" "\\\\\\1" (file-truename file)) " "
+ description "\n"))
+ (message (concat "Attached '" file "'."))
+ (setq post-has-attachment t))))))
+
+ (setq mail-yank-prefix "> ")
+ )
+#+END_SRC
+*** Muttrc mode
+#+BEGIN_SRC emacs-lisp
+ (use-package muttrc-mode
+ :mode "muttngrc"
+ :mode "muttrc"
+ )
+
+#+END_SRC
+* Base emacs
+** Reverting buffers
+#+BEGIN_SRC emacs-lisp
+ (use-package autorevert
+ :diminish auto-revert-mode
+ :config
+ (setq global-auto-revert-non-file-buffers t
+ global-auto-revert-ignore-modes '(pdf-view-mode)
+ auto-revert-verbose nil)
+ (global-auto-revert-mode 1))
+#+END_SRC
+* Org Mode
+** Use-package and load things
+#+BEGIN_SRC emacs-lisp
+
+ (use-package org
+ :delight (org-mode "ø")
+ :mode ("\\.\\(org\\|org_archive\\|txt\\)\\'" . org-mode)
+ :bind (("C-c l" . org-store-link)
+ ("C-c a" . org-agenda)
+ ("C-c b" . org-iswitchb))
+#+END_SRC
+** Agenda Configuration
+#+BEGIN_SRC emacs-lisp
+ :config
+ (setq-default org-log-done 'time)
+ (setq-default org-agenda-ndays 5)
+
+ ;; agenda configuration
+ ;; Do not dim blocked tasks
+ (setq org-agenda-dim-blocked-tasks nil)
+ (setq org-agenda-inhibit-startup t)
+ (setq org-agenda-use-tag-inheritance nil)
+
+ ;; Compact the block agenda view
+ (setq org-agenda-compact-blocks t)
+
+ ;; Custom agenda command definitions
+ (setq org-agenda-custom-commands
+ (quote (("N" "Notes" tags "NOTE"
+ ((org-agenda-overriding-header "Notes")
+ (org-tags-match-list-sublevels t)))
+ ("h" "Habits" tags-todo "STYLE=\"habit\""
+ ((org-agenda-overriding-header "Habits")
+ (org-agenda-sorting-strategy
+ '(todo-state-down effort-up category-keep))))
+ (" " "Agenda"
+ ((agenda "" nil)
+ (tags "REFILE"
+ ((org-agenda-overriding-header "Tasks to Refile")
+ (org-tags-match-list-sublevels nil)))
+ (tags-todo "-CANCELLED/!"
+ ((org-agenda-overriding-header "Stuck Projects")
+ (org-agenda-skip-function 'bh/skip-non-stuck-projects)
+ (org-agenda-sorting-strategy
+ '(category-keep))))
+ (tags-todo "-HOLD-CANCELLED/!"
+ ((org-agenda-overriding-header "Projects")
+ (org-agenda-skip-function 'bh/skip-non-projects)
+ (org-tags-match-list-sublevels 'indented)
+ (org-agenda-sorting-strategy
+ '(category-keep))))
+ (tags-todo "-CANCELLED/!NEXT"
+ ((org-agenda-overriding-header (concat "Project Next Tasks"
+ (if bh/hide-scheduled-and-waiting-next-tasks
+ ""
+ " (including WAITING and SCHEDULED tasks)")))
+ (org-agenda-skip-function 'bh/skip-projects-and-habits-and-single-tasks)
+ (org-tags-match-list-sublevels t)
+ (org-agenda-todo-ignore-scheduled bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-todo-ignore-deadlines bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-todo-ignore-with-date bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-sorting-strategy
+ '(todo-state-down effort-up category-keep))))
+ (tags-todo "-REFILE-CANCELLED-WAITING-HOLD/!"
+ ((org-agenda-overriding-header (concat "Project Subtasks"
+ (if bh/hide-scheduled-and-waiting-next-tasks
+ ""
+ " (including WAITING and SCHEDULED tasks)")))
+ (org-agenda-skip-function 'bh/skip-non-project-tasks)
+ (org-agenda-todo-ignore-scheduled bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-todo-ignore-deadlines bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-todo-ignore-with-date bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-sorting-strategy
+ '(category-keep))))
+ (tags-todo "-REFILE-CANCELLED-WAITING-HOLD/!"
+ ((org-agenda-overriding-header (concat "Standalone Tasks"
+ (if bh/hide-scheduled-and-waiting-next-tasks
+ ""
+ " (including WAITING and SCHEDULED tasks)")))
+ (org-agenda-skip-function 'bh/skip-project-tasks)
+ (org-agenda-todo-ignore-scheduled bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-todo-ignore-deadlines bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-todo-ignore-with-date bh/hide-scheduled-and-waiting-next-tasks)
+ (org-agenda-sorting-strategy
+ '(category-keep))))
+ (tags-todo "-CANCELLED+WAITING|HOLD/!"
+ ((org-agenda-overriding-header "Waiting and Postponed Tasks")
+ (org-agenda-skip-function 'bh/skip-stuck-projects)
+ (org-tags-match-list-sublevels nil)
+ (org-agenda-todo-ignore-scheduled t)
+ (org-agenda-todo-ignore-deadlines t)))
+ (tags "-REFILE/"
+ ((org-agenda-overriding-header "Tasks to Archive")
+ (org-agenda-skip-function 'bh/skip-non-archivable-tasks)
+ (org-tags-match-list-sublevels nil))))
+ nil))))
+
+ ; org mode agenda files
+ (setq org-agenda-files
+ (quote ("~/projects/org-notes/debbugs.org"
+ "~/projects/org-notes/notes.org"
+ "~/projects/org-notes/holidays.org"
+ "~/projects/org-notes/refile.org"
+ "~/projects/org-notes/diary.org"
+ "~/projects/org-notes/ool.org"
+ "~/projects/org-notes/sndservers.org"
+ "~/projects/org-notes/chaim.org"
+ "~/projects/org-notes/wildman.org"
+ "~/projects/org-notes/uddin.org"
+ "~/projects/org-notes/reviews.org"
+ "~/org-mode/from-mobile.org"
+ "~/projects/org-notes/fh.org")))
+
+ (set-register ?n (cons 'file "~/projects/org-notes/notes.org"))
+ (set-register ?r (cons 'file "~/projects/org-notes/refile.org"))
+ (set-register ?o (cons 'file "~/projects/org-notes/ool.org"))
+ (set-register ?s (cons 'file "~/projects/org-notes/sndservers.org"))
+ (set-register ?c (cons 'file "~/projects/org-notes/chaim.org"))
+ (set-register ?w (cons 'file "~/projects/org-notes/wildman.org"))
+ (set-register ?u (cons 'file "~/projects/org-notes/uddin.org"))
+ (set-register ?R (cons 'file "~/projects/reviews/reviews.org"))
+ (set-register ?d (cons 'file "~/projects/org-notes/diary.org"))
+ ; from https://emacs.stackexchange.com/questions/909/how-can-i-have-an-agenda-timeline-view-of-multiple-files
+ (defun org-agenda-timeline-all (&optional arg)
+ (interactive "P")
+ (with-temp-buffer
+ (dolist (org-agenda-file org-agenda-files)
+ (insert-file-contents org-agenda-file nil)
+ (goto-char (point-max))
+ (newline))
+ (write-file "/tmp/timeline.org")
+ (org-agenda arg "L")))
+ (define-key org-mode-map (kbd "C-c t") 'org-agenda-timeline-all)
+
+#+END_SRC
+** General config
+#+BEGIN_SRC emacs-lisp
+ (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")
+
+ (setq org-default-notes-file "~/projects/org-notes/notes.org")
+ (setq org-id-link-to-org-use-id 'use-existing)
+#+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 "~/projects/org-notes/refile.org")
+ "* TODO Apply for %a%? :job:\nSCHEDULED: %(format-time-string \"<%Y-%m-%d 17:00-17:30>\")\n%U\n%a\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 ()
+ (interactive)
+ (save-excursion
+ (beginning-of-line 0)
+ (org-remove-empty-drawer-at (point))))
+
+ (defun my/org-add-id ()
+ (interactive)
+ (save-excursion
+ (if (org-current-level)
+ ()
+ (forward-char 1)
+ )
+ (org-id-get-create)
+ )
+ )
+
+#+END_SRC
+** Org mode key bindings
+#+BEGIN_SRC emacs-lisp
+ ;; org mode configuration from http://doc.norang.ca/org-mode.html
+ ;; Custom Key Bindings
+ :bind* (("<f9> a" . org-agenda)
+ ("<f9> I" . bh/punch-in)
+ ("<f9> O" . bh/punch-out)
+ ("<f9> SPC" . bh/clock-in-last-task)
+ ("<f12>" . org-agenda)
+ ;; ("<f5>" . bh/org-todo)
+ ("<S-f5>" . bh/widen)
+ ("<f7>" . bh/set-truncate-lines)
+ ("<f8>" . org-cycle-agenda-files)
+ ("<f9> <f9>" . bh/show-org-agenda)
+ ("<f9> b" . bbdb)
+ ("<f9> c" . calendar)
+ ("<f9> f" . boxquote-insert-file)
+ ("<f9> h" . bh/hide-other)
+ ("<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)
+
+ ("<f9> t" . bh/insert-inactive-timestamp)
+ ("<f9> T" . bh/toggle-insert-inactive-timestamp)
+
+ ("<f9> v" . visible-mode)
+ ("<f9> l" . org-toggle-link-display)
+ ("<f9> SPC" . bh/clock-in-last-task)
+ ("C-<f9>" . previous-buffer)
+ ("M-<f9>" . org-toggle-inline-images)
+ ("C-x n r" . narrow-to-region)
+ ("C-<f10>" . next-buffer)
+ ("<f11>" . org-clock-goto)
+ ("C-<f11>" . org-clock-in)
+ ("C-s-<f12>" . bh/save-then-publish)
+ ("C-c c" . org-capture))
+ :config
+#+END_SRC
+** Utility Functions
+#+BEGIN_SRC emacs-lisp
+ (defun bh/hide-other ()
+ (interactive)
+ (save-excursion
+ (org-back-to-heading 'invisible-ok)
+ (hide-other)
+ (org-cycle)
+ (org-cycle)
+ (org-cycle)))
+
+ (defun bh/set-truncate-lines ()
+ "Toggle value of truncate-lines and refresh window display."
+ (interactive)
+ (setq truncate-lines (not truncate-lines))
+ ;; now refresh window display (an idiom from simple.el):
+ (save-excursion
+ (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*"))
+
+ (setq org-use-fast-todo-selection t)
+ (setq org-treat-S-cursor-todo-selection-as-state-change nil)
+
+ ; create function to create headlines in file. This comes from
+ ; http://stackoverflow.com/questions/13340616/assign-ids-to-every-entry-in-org-mode
+ (defun my/org-add-ids-to-headlines-in-file ()
+ "Add ID properties to all headlines in the current file which
+ do not already have one."
+ (interactive)
+ (org-map-entries 'org-id-get-create))
+ (defun dla/org-update-ids-to-headlines-in-file ()
+ "Add or replace ID properties to all headlines in the current file
+ (or narrowed region)."
+ (interactive)
+ (org-map-entries '(lambda () (org-id-get-create t))))
+ ; if we wanted to do this to every buffer, do the following:
+ ; (add-hook 'org-mode-hook
+ ; (lambda ()
+ ; (add-hook 'before-save-hook 'my/org-add-ids-to-headlines-in-file nil 'local)))
+#+END_SRC
+** Keywords (TODO)
+#+BEGIN_SRC emacs-lisp
+ (setq org-todo-keywords
+ (quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
+ (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "PHONE" "MEETING"))))
+
+ (setq org-todo-keyword-faces
+ (quote (("TODO" :foreground "red" :weight bold)
+ ("NEXT" :foreground "blue" :weight bold)
+ ("DONE" :foreground "forest green" :weight bold)
+ ("WAITING" :foreground "orange" :weight bold)
+ ("HOLD" :foreground "magenta" :weight bold)
+ ("CANCELLED" :foreground "forest green" :weight bold)
+ ("MEETING" :foreground "forest green" :weight bold)
+ ("PHONE" :foreground "forest green" :weight bold))))
+
+ (setq org-todo-state-tags-triggers
+ (quote (("CANCELLED" ("CANCELLED" . t))
+ ("WAITING" ("WAITING" . t))
+ ("HOLD" ("WAITING") ("HOLD" . t))
+ (done ("WAITING") ("HOLD"))
+ ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
+ ("NEXT" ("WAITING") ("CANCELLED") ("HOLD"))
+ ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
+
+
+
+ ; (add-hook 'org-clock-out-hook 'bh/remove-empty-drawer-on-clock-out 'append)
+ ; add ids on creation of nodes
+ (add-hook 'org-capture-prepare-finalize-hook 'my/org-add-id)
+
+
+ ; resolve clocks after 10 minutes of idle; use xprintidle
+ ; (setq org-clock-idle-time 10)
+ ; (setq org-clock-x11idle-program-name "xprintidle")
+
+ ; this is from http://doc.norang.ca/org-mode.html#Capture
+ ; use C-M-r for org mode capture
+ (global-set-key (kbd "C-M-r") 'org-capture)
+
+ ; Targets include this file and any file contributing to the agenda - up to 9 levels deep
+ (setq org-refile-targets (quote ((nil :maxlevel . 9)
+ (org-agenda-files :maxlevel . 9))))
+
+ ; Use full outline paths for refile targets - we file directly with IDO
+ (setq org-refile-use-outline-path t)
+
+ ; Targets complete directly with IDO
+ (setq org-outline-path-complete-in-steps nil)
+
+ ; Allow refile to create parent tasks with confirmation
+ (setq org-refile-allow-creating-parent-nodes (quote confirm))
+
+ ; ; Use IDO for both buffer and file completion and ido-everywhere to t
+ ; (setq org-completion-use-ido t)
+ ; (setq ido-everywhere t)
+ ; (setq ido-max-directory-size 100000)
+ ; (ido-mode (quote both))
+ ; ; Use the current window when visiting files and buffers with ido
+ ; (setq ido-default-file-method 'selected-window)
+ ; (setq ido-default-buffer-method 'selected-window)
+ ; ; Use the current window for indirect buffer display
+ ; (setq org-indirect-buffer-display 'current-window)
+
+
+ ;;;; Refile settings
+ ; Exclude DONE state tasks from refile targets
+ (defun bh/verify-refile-target ()
+ "Exclude todo keywords with a done state from refile targets"
+ (not (member (nth 2 (org-heading-components)) org-done-keywords)))
+
+ (setq org-refile-target-verify-function 'bh/verify-refile-target)
+
+ ;; ensure that emacsclient will show just the note to be edited when invoked
+ ;; from Mutt, and that it will shut down emacsclient once finished;
+ ;; fallback to legacy behavior when not invoked via org-protocol.
+ (require 'org-protocol)
+ ; (add-hook 'org-capture-mode-hook 'delete-other-windows)
+ (setq my-org-protocol-flag nil)
+ (defadvice org-capture-finalize (after delete-frame-at-end activate)
+ "Delete frame at remember finalization"
+ (progn (if my-org-protocol-flag (delete-frame))
+ (setq my-org-protocol-flag nil)))
+ (defadvice org-capture-refile (around delete-frame-after-refile activate)
+ "Delete frame at remember refile"
+ (if my-org-protocol-flag
+ (progn
+ (setq my-org-protocol-flag nil)
+ ad-do-it
+ (delete-frame))
+ ad-do-it)
+ )
+ (defadvice org-capture-kill (after delete-frame-at-end activate)
+ "Delete frame at remember abort"
+ (progn (if my-org-protocol-flag (delete-frame))
+ (setq my-org-protocol-flag nil)))
+ (defadvice org-protocol-capture (before set-org-protocol-flag activate)
+ (setq my-org-protocol-flag t))
+
+ (defadvice org-insert-todo-heading (after dla/create-id activate)
+ (org-id-get-create)
+ )