From d42dd8e8abd44e016dc1d6a47c7717289d73e868 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 20 Mar 2019 12:00:26 +0100 Subject: [PATCH] Helm/Notmuch: Remove patch-helm-notmuch since it's been merged upstream --- .emacs.d/lisp/init-notmuch.el | 1 - .emacs.d/lisp/patch-helm-notmuch.el | 84 ----------------------------- 2 files changed, 85 deletions(-) delete mode 100644 .emacs.d/lisp/patch-helm-notmuch.el diff --git a/.emacs.d/lisp/init-notmuch.el b/.emacs.d/lisp/init-notmuch.el index e83cd52b..371e72cd 100644 --- a/.emacs.d/lisp/init-notmuch.el +++ b/.emacs.d/lisp/init-notmuch.el @@ -37,7 +37,6 @@ (when (require 'helm-notmuch nil t) (setq helm-notmuch-match-incomplete-words t) - (require 'patch-helm-notmuch) (dolist (map (list notmuch-search-mode-map notmuch-hello-mode-map notmuch-show-mode-map diff --git a/.emacs.d/lisp/patch-helm-notmuch.el b/.emacs.d/lisp/patch-helm-notmuch.el deleted file mode 100644 index 52f0e952..00000000 --- a/.emacs.d/lisp/patch-helm-notmuch.el +++ /dev/null @@ -1,84 +0,0 @@ -;; TODO: Send PR. - -(defun helm-notmuch-candidate-formatter (cand) - "Format the single entry CAND." - (if (not (string-match-p "\\[" cand)) - "" - (let ((text (substring cand (+ 2 helm-notmuch-thread-id-length))) - (id (substring cand 0 helm-notmuch-thread-id-length)) - cstart astart alen tstart tags) - (with-temp-buffer - (insert text) - (goto-char (point-min)) - - ;; Align message counts - (search-forward "[") - (setq cstart (point)) - (search-forward "]") - (save-excursion - (save-restriction - (narrow-to-region cstart (point)) - (goto-char (point-min)) - (when (re-search-forward "\([0-9]\+\)" nil t) - (replace-match "")))) - (forward-char) - (just-one-space (- helm-notmuch-thread-count-width - (- (point) cstart))) - (forward-char) - - ;; Align (and truncate) authors - (setq astart (point)) - (search-forward ";") - (delete-char -1) - (setq alen (- (point) astart)) - (if (> alen helm-notmuch-author-width) - (progn - (delete-region (- (point) (- alen - (- helm-notmuch-author-width 3))) - (point)) - (insert "...")) - (just-one-space (- (+ helm-notmuch-author-width 1) alen))) - - ;; Colour tags - (goto-char (- (point-max) 1)) - (save-excursion - (search-backward "(") - (setq tstart (+ (point) 1))) - (setq tags (split-string (buffer-substring tstart (point)))) - (delete-region tstart (point)) - (insert (notmuch-tag-format-tags tags tags)) - - ;; Colour the whole line according to tags - (notmuch-search-color-line (point-min) (point-max) tags) - (setq text (buffer-string))) - (cons text id)))) - -(defun helm-notmuch-maybe-match-incomplete (pattern) - (if helm-notmuch-match-incomplete-words - (mapconcat #'identity - (mapcar (lambda (term) - (if (string-match-p "^[[:alnum:]]+$" term) - (concat term "*") - term)) - (split-string pattern)) - " ") - pattern)) - -(defun helm-notmuch-show (_candidate) - "Display CANDIDATE using notmuch-show, retaining the query context." - (helm-window-show-buffers - (save-window-excursion - (cl-loop for candidate in (helm-marked-candidates) - collect (progn (notmuch-show candidate nil nil - (helm-notmuch-maybe-match-incomplete - helm-pattern)) - (current-buffer)))))) - -(defun helm-notmuch-search (candidate) - "Display notmuch query in notmuch-search buffer, highlighting CANDIDATE." - (notmuch-search (helm-notmuch-maybe-match-incomplete - (with-helm-buffer helm-input-local)) - nil - (replace-regexp-in-string "^thread:" "" candidate))) - -(provide 'patch-helm-notmuch)