diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index 794ef09d..1ecdeb66 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -912,6 +912,15 @@ The current directory is assumed to be the project's root otherwise." (use-package helm-ag :ensure t)) :config (progn + (cl-defun helm-org-in-buffer-headings () + (interactive) + (helm :sources (helm-source-org-headings-for-files + + (list (projectile-completing-read + "File to look at headings from: " + (projectile-all-project-files)))) + :candidate-number-limit 99999 + :buffer "*helm org inbuffer*")) ;; helm zsh source history (defvar helm-c-source-zsh-history '((name . "Zsh History") diff --git a/dotfiles/emacs.d/load.d/mu4e-company.el b/dotfiles/emacs.d/load.d/mu4e-company.el new file mode 100644 index 00000000..1fcf82b6 --- /dev/null +++ b/dotfiles/emacs.d/load.d/mu4e-company.el @@ -0,0 +1,15 @@ +(defun mu4e-company-contacts (command &optional input &rest ignored) + (interactive (list 'interactive)) + (cl-case command + (interactive (company-begin-backend 'mu4e-contacts-company)) + (prefix + (when (eq major-mode 'mu4e-compose-mode) + (save-excursion + (beginning-of-line) + (if (and (eq (line-number-at-pos) 2) + (looking-at "^To: *\\(.*?\\)$")) + (match-string-no-properties 1) + 'stop)))) + (candidates + (--filter (string-match-p (downcase input) (downcase it)) + mu4e~contacts-for-completion))))