From 4ffd8f0d0cd56f1c6e75a55a2676c7300cb6407a Mon Sep 17 00:00:00 2001 From: opfez Date: Mon, 17 May 2021 18:01:52 +0200 Subject: [PATCH] add some stuff for org-capture, move disabling custom-variables --- essential.el | 4 ++++ init.el | 16 ---------------- packages.el | 13 +++++++++++++ tweaks.el | 10 ---------- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/essential.el b/essential.el index 8494986..409b06e 100644 --- a/essential.el +++ b/essential.el @@ -1,6 +1,10 @@ ;; Essential stuff to load. ;; This includes starting the package manager, setting the theme etc. +;; Disable custom adding stuff to init.el by making it add stuff to a file in /tmp instead. +;; Thanks Christopher Wellons! (first comment at https://irreal.org/blog/?p=3765) +(setq custom-file (make-temp-file "emacs-custom")) + ;; call package-initialize manually, disable automatic initialization: (setq package-enable-at-startup nil) diff --git a/init.el b/init.el index 9d16c42..b47705f 100644 --- a/init.el +++ b/init.el @@ -62,19 +62,3 @@ ;; (setq geiser-active-implementations '(mit)) ;; (setq geiser-active-implementations '(chez)) - - - -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(package-selected-packages - '(selectrum use-package undo-tree swiper slime rust-mode paredit nasm-mode multiple-cursors move-text magit helm haskell-mode god-mode go-mode geiser-mit geiser-guile geiser-chicken geiser-chez frames-only-mode exwm expand-region elpher dumb-jump disk-usage disaster dashboard basic-theme avy autothemer auto-package-update))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) diff --git a/packages.el b/packages.el index 54d6b46..838af13 100644 --- a/packages.el +++ b/packages.el @@ -128,4 +128,17 @@ (use-package elpher :ensure t) +(use-package org + :ensure t + :config + ;;; org-capture + ;; Default location for org-capture is ~/org/notes.org + (setq org-default-notes-file (concat org-directory "/notes.org")) + (setq org-capture-templates + '(("t" "Task" entry (file+headline "~/org/tasks.org" "Tasks") + "* TODO %?\n %i\n %a") + ("j" "Journal" entry (file+datetree "~/org/journal.org") + "* %?\nEntered on %U\n %i\n %a"))) + (global-set-key (kbd "C-c o") 'org-capture)) + (provide 'packages) diff --git a/tweaks.el b/tweaks.el index 570f97b..8e1206b 100644 --- a/tweaks.el +++ b/tweaks.el @@ -62,12 +62,6 @@ (setq-default fill-column 80) (add-hook 'text-mode-hook 'turn-on-auto-fill) -;; I don't remember what this does, but it's probably important. -(put 'downcase-region 'disabled nil) - -;; Line numbers -(global-linum-mode) - ;; Ask before closing Emacs (setq confirm-kill-emacs 'y-or-n-p) @@ -76,7 +70,3 @@ ;; delete trailing whitespace before saving (add-hook 'before-save-hook 'delete-trailing-whitespace) - -;; Disable custom adding stuff to init.el by making it add stuff to a file in /tmp instead. -;; Thanks Christopher Wellons! (first comment at https://irreal.org/blog/?p=3765) -(setq custom-file (make-temp-file "emacs-custom"))