summaryrefslogtreecommitdiff
path: root/.emacs.d/init-org.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-07-14 11:21:42 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-07-14 11:24:30 -0700
commit3a50a1473eaed5cfb6538544386de659604e5095 (patch)
treef5d7e2efe00f1ac127049b645cf5a9c0b84c7b25 /.emacs.d/init-org.el
parent5478f807e66f6181dc7621b40b4f996ffbbdb483 (diff)
downloaddotfiles-3a50a1473eaed5cfb6538544386de659604e5095.tar.gz
drop remaining uses of use-package and bind-key
Diffstat (limited to '.emacs.d/init-org.el')
-rw-r--r--.emacs.d/init-org.el56
1 files changed, 26 insertions, 30 deletions
diff --git a/.emacs.d/init-org.el b/.emacs.d/init-org.el
index 3a540bf5..1360c624 100644
--- a/.emacs.d/init-org.el
+++ b/.emacs.d/init-org.el
@@ -2,9 +2,6 @@
;;;; ---- packages ----
-(eval-when-compile
- (require 'use-package))
-
;;; this config uses `f-glob', `-any' and `diminish'
(require 'f)
@@ -34,28 +31,27 @@
;;; links to notmuch messages
-(use-package ol-notmuch
- :demand
- :config
- ;; the default value for `org-notmuch-open-function' is
- ;; `org-notmuch-follow-link', but that function is broken: it calls
- ;; `notmuch-show' with a search query rather than a thread ID. This
- ;; causes `notmuch-show-thread-id' to be populated with a value
- ;; which is not a thread ID, which breaks various other things
- ;;
- ;; so use a custom function instead
- (defun spw--org-notmuch-follow-link (search)
- (let ((thread-id
- (substring
- (shell-command-to-string
- (combine-and-quote-strings (list "notmuch" "search"
- "--output=threads" "--limit=1"
- "--format=text"
- "--format-version=4" search)))
- 0 -1)))
- (notmuch-show thread-id nil nil search
- (concat "*notmuch-" search "*"))))
- (setq org-notmuch-open-function #'spw--org-notmuch-follow-link))
+(require 'ol-notmuch)
+
+;; the default value for `org-notmuch-open-function' is
+;; `org-notmuch-follow-link', but that function is broken: it calls
+;; `notmuch-show' with a search query rather than a thread ID. This
+;; causes `notmuch-show-thread-id' to be populated with a value
+;; which is not a thread ID, which breaks various other things
+;;
+;; so use a custom function instead
+(defun spw--org-notmuch-follow-link (search)
+ (let ((thread-id
+ (substring
+ (shell-command-to-string
+ (combine-and-quote-strings (list "notmuch" "search"
+ "--output=threads" "--limit=1"
+ "--format=text"
+ "--format-version=4" search)))
+ 0 -1)))
+ (notmuch-show thread-id nil nil search
+ (concat "*notmuch-" search "*"))))
+(setq org-notmuch-open-function #'spw--org-notmuch-follow-link)
@@ -706,7 +702,7 @@ different occasions."
(insert path)
(save-buffer)
(message "added")))))))
-(bind-key "C-c [" 'spw--org-agenda-file-to-front org-mode-map)
+(define-key org-mode-map "\C-c[" #'spw--org-agenda-file-to-front)
(defun spw--org-remove-file ()
(interactive)
@@ -720,7 +716,7 @@ different occasions."
(kill-line 1)
(save-buffer)
(message "removed")))))))
-(bind-key "C-c ]" 'spw--org-remove-file org-mode-map)
+(define-key org-mode-map "\C-c]" #'spw--org-remove-file)
;;;; ---- hooks and bindings ----
@@ -733,7 +729,7 @@ different occasions."
(org-agenda-filter-apply org-agenda-regexp-filter 'regexp))
(require 'org-agenda)
-(bind-key (kbd "&") 'spw--org-agenda-priority-filter org-agenda-mode-map)
+(define-key org-agenda-mode-map "&" #'spw--org-agenda-priority-filter)
;; auto-fill-mode
(add-hook 'org-mode-hook 'turn-on-auto-fill)
@@ -748,10 +744,10 @@ different occasions."
(define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
;; this binding seems to have dropped out of upstream, so define it again
-(bind-key "C-c C-SPC" 'org-mark-subtree org-mode-map)
+(define-key org-mode-map (kbd "C-c C-SPC") #'org-mark-subtree)
;; this works well whether or not `org-adapt-indentation' is set
-(bind-key "RET" 'org-return-indent org-mode-map)
+(define-key org-mode-map (kbd "RET") #'org-return-indent)
(defun spw--org-reformat-subtree ()
(interactive)