diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2017-08-27 20:15:20 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2017-08-27 20:15:20 +0200 |
commit | 94a032e2b398f7c6b20c6b9157917114520eeda9 (patch) | |
tree | 1bcb5b58a11667641e69de26cc56e85a7bfe1b92 /helm-regexp.el | |
parent | e29fba7c7797ec47c65d35ba759207c103cef662 (diff) |
Allow overriding helm-moccur-show-buffer-fontification
for specific modes.
* helm-regexp.el (helm-moccur-buffer-substring-fn-for-modes): New user
var.
(helm-moccur-init): Use it.
Diffstat (limited to 'helm-regexp.el')
-rw-r--r-- | helm-regexp.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/helm-regexp.el b/helm-regexp.el index 6ba1106a..215736dc 100644 --- a/helm-regexp.el +++ b/helm-regexp.el @@ -72,6 +72,15 @@ Any other non--nil value update after confirmation." (const :tag "Don't preserve buffer fontification" nil) (const :tag "Preserve buffer fontification" t))) +(defcustom helm-moccur-buffer-substring-fn-for-modes + '((mu4e-headers-mode . buffer-substring)) + "Alist that allow configuring the function to use for storing a buffer. + +Allow overriding the global effect of `helm-moccur-show-buffer-fontification' +for a specific mode." + :group 'helm-regexp + :type '(alist :key-type symbol :value-type function)) + (defcustom helm-occur-show-buffer-name nil "Show buffer name in `helm-occur' results when non-nil. @@ -213,6 +222,9 @@ Should be a local var to helm-buffer to allow resuming.") #'buffer-substring #'buffer-substring-no-properties) for buf in buffers for bufstr = (with-current-buffer buf + (helm-aif (assq major-mode + helm-moccur-buffer-substring-fn-for-modes) + (setq bsubstring (cdr it))) ;; A leading space is needed to allow helm ;; searching the first line of buffer ;; (#1725). |