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
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
*** Auto-YASnippet
#+BEGIN_SRC emacs-lisp
(use-package auto-yasnippet
+ :ensure t
:bind (("H-w" . aya-create)
("H-y" . aya-expand)
)
(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)
#+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 ()
("<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)
("<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)
(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 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
* 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")
(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)
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