summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-16 02:12:12 +0100
committerjao <jao@gnu.org>2021-05-16 02:12:12 +0100
commitcf81ccc6e7a4cb50151d1b2f7a81369ef516a0db (patch)
tree8ea7b9c6ccfcb250d5697d0dca1ccccbf3bffba5
parentdebec7e4a401b0ae2d12923264db8adfa577f3c2 (diff)
downloadelibs-cf81ccc6e7a4cb50151d1b2f7a81369ef516a0db.tar.gz
elibs-cf81ccc6e7a4cb50151d1b2f7a81369ef516a0db.tar.bz2
fix for init loading
-rw-r--r--completion.org27
-rw-r--r--email.org34
-rw-r--r--init.org5
3 files changed, 34 insertions, 32 deletions
diff --git a/completion.org b/completion.org
index 29b85a3..b00b8cd 100644
--- a/completion.org
+++ b/completion.org
@@ -118,33 +118,6 @@
(define-key consult-narrow-map (vconcat consult-narrow-key "?")
#'consult-narrow-help))
#+end_src
-*** notmuch
- #+begin_src emacs-lisp
- (use-package consult-notmuch
- :ensure t
- :init (setq consult-notmuch-authors-width 30)
- :config
- (add-to-list 'consult-config '(consult-notmuch :preview-key any))
- (add-to-list 'consult-buffer-sources 'consult-notmuch-buffer-source))
-
- (defvar jao-consult-notmuch-folders
- (seq-mapcat (lambda (base)
- (mapcar `(lambda (d) (format "%s/%s" ,base d))
- (jao-list-mailboxes base)))
- '("jao" "bigml" "feeds" "trove")))
-
- (defun jao-consult-notmuch-folder (&optional tree folder)
- (interactive "P")
- (let* ((root "~/var/mail/")
- (folder (if folder
- (file-name-as-directory folder)
- (completing-read "Folder: "
- jao-consult-notmuch-folders)))
- (folder (replace-regexp-in-string "/\\(.\\)" ".\\1" folder))
- (init (read-string "Initial query: "))
- (init (format "folder:/%s/ %s" folder init)))
- (if tree (consult-notmuch-tree init) (consult-notmuch init))))
- #+end_src
*** recoll
#+begin_src emacs-lisp
(jao-load-path "consult-recoll")
diff --git a/email.org b/email.org
index 745fb07..64b4e7c 100644
--- a/email.org
+++ b/email.org
@@ -247,6 +247,13 @@
(setq bbdb-file (expand-file-name "~/.emacs.d/bbdb"))
(bbdb-initialize 'message 'pgp 'mail)
#+end_src
+* mailboxes
+ #+begin_src emacs-lisp
+ (defun jao-list-mailboxes (base)
+ (let ((dir (expand-file-name base "~/var/mail")))
+ (seq-difference (directory-files dir)
+ '("." ".." "sent" "inbox" "trash"))))
+ #+end_src
* gnus
*** Directories
#+begin_src emacs-lisp
@@ -322,6 +329,33 @@
,(jao-notmuch--q "new" nil "n" '("tag:new"))
,(jao-notmuch--q "draft" nil "d" '("tag:draft"))))
#+end_src
+*** consult
+ #+begin_src emacs-lisp
+ (use-package consult-notmuch
+ :ensure t
+ :init (setq consult-notmuch-authors-width 30)
+ :config
+ (add-to-list 'consult-config '(consult-notmuch :preview-key any))
+ (add-to-list 'consult-buffer-sources 'consult-notmuch-buffer-source))
+
+ (defvar jao-consult-notmuch-folders
+ (seq-mapcat (lambda (base)
+ (mapcar `(lambda (d) (format "%s/%s" ,base d))
+ (jao-list-mailboxes base)))
+ '("jao" "bigml" "feeds" "trove")))
+
+ (defun jao-consult-notmuch-folder (&optional tree folder)
+ (interactive "P")
+ (let* ((root "~/var/mail/")
+ (folder (if folder
+ (file-name-as-directory folder)
+ (completing-read "Folder: "
+ jao-consult-notmuch-folders)))
+ (folder (replace-regexp-in-string "/\\(.\\)" ".\\1" folder))
+ (init (read-string "Initial query: "))
+ (init (format "folder:/%s/ %s" folder init)))
+ (if tree (consult-notmuch-tree init) (consult-notmuch init))))
+ #+end_src
*** org mode integration
Stolen and adapted from [[https://gist.github.com/fedxa/fac592424473f1b70ea489cc64e08911][Fedor Bezrukov]].
#+begin_src emacs-lisp
diff --git a/init.org b/init.org
index e0e8438..d04e46c 100644
--- a/init.org
+++ b/init.org
@@ -1578,11 +1578,6 @@
(if (fboundp 'w3m-view-mode) (w3m-view-source) (View-quit))
(when url (cons url (or title ""))))))))
- (defun jao-list-mailboxes (base)
- (let ((dir (expand-file-name base "~/var/mail")))
- (seq-difference (directory-files dir)
- '("." ".." "sent" "inbox" "trash"))))
-
(defun jao-rss-subscribe ()
(interactive)
(let* ((url (or (jao-url-around-point)