summaryrefslogtreecommitdiff
path: root/lisp/misearch.el
diff options
context:
space:
mode:
authorIvan Shmakov <ivan@siamics.net>2015-01-17 19:15:51 +0000
committerIvan Shmakov <ivan@siamics.net>2015-01-17 19:35:52 +0000
commit0aaa5d699bf95afb152317f0788b8e2d2042f59d (patch)
tree459db84332b073005e92eecfa1d24d705de4ae9a /lisp/misearch.el
parente391d88705efd3897996ed81e1f37b936dc3aa21 (diff)
downloademacs-0aaa5d699bf95afb152317f0788b8e2d2042f59d.tar.gz
Unloading support for misearch.
* lisp/misearch.el (multi-isearch-unload-function): New function. (misearch-unload-function): New alias. Fixes: debbugs:19566
Diffstat (limited to 'lisp/misearch.el')
-rw-r--r--lisp/misearch.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/misearch.el b/lisp/misearch.el
index 6daae243fbb..dcc819564fb 100644
--- a/lisp/misearch.el
+++ b/lisp/misearch.el
@@ -377,6 +377,25 @@ whose file names match the specified wildcard."
(goto-char (if isearch-forward (point-min) (point-max)))
(isearch-forward-regexp nil t)))
+(defun multi-isearch-unload-function ()
+ "Remove autoloaded variables from `unload-function-defs-list'.
+Also prevent the feature from being reloaded via `isearch-mode-hook'."
+ (remove-hook 'isearch-mode-hook 'multi-isearch-setup)
+ (let ((defs (list (car unload-function-defs-list)))
+ (auto '(multi-isearch-next-buffer-function
+ multi-isearch-next-buffer-current-function
+ multi-isearch-current-buffer
+ multi-isearch-buffer-list multi-isearch-file-list)))
+ (dolist (def (cdr unload-function-defs-list))
+ (unless (and (symbolp def)
+ (memq def auto))
+ (push def defs)))
+ (setq unload-function-defs-list (nreverse defs))
+ ;; .
+ nil))
+
+(defalias 'misearch-unload-function 'multi-isearch-unload-function)
+
(provide 'multi-isearch)
(provide 'misearch)