Commit 26e1d854 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/misearch.el: Use lexical-binding

(multi-isearch-read-buffers, multi-isearch-read-files):
Replace `add-to-list` with `cl-pushnew` for use on a local variable.
parent 2db03e3e
Pipeline #10240 passed with stages
in 16 minutes and 49 seconds
;;; misearch.el --- isearch extensions for multi-buffer search
;;; misearch.el --- isearch extensions for multi-buffer search -*- lexical-binding: t; -*-
;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
......@@ -28,6 +28,8 @@
;;; Code:
(require 'cl-lib)
;;; Search multiple buffers
;;;###autoload (add-hook 'isearch-mode-hook 'multi-isearch-setup)
......@@ -40,8 +42,7 @@
(defcustom multi-isearch-search t
"Non-nil enables searching multiple related buffers, in certain modes."
:type 'boolean
:version "23.1"
:group 'multi-isearch)
:version "23.1")
(defcustom multi-isearch-pause t
"A choice defining where to pause the search.
......@@ -53,8 +54,7 @@ If t, pause in all buffers that contain the search string."
(const :tag "Don't pause" nil)
(const :tag "Only in initial buffer" initial)
(const :tag "All buffers" t))
:version "23.1"
:group 'multi-isearch)
:version "23.1")
(defvar multi-isearch-next-buffer-function nil
......@@ -119,10 +119,10 @@ Intended to be added to `isearch-mode-hook'."
(default-value 'isearch-wrap-function)
(default-value 'isearch-push-state-function))
(setq-default isearch-search-fun-function 'multi-isearch-search-fun
isearch-wrap-function 'multi-isearch-wrap
isearch-push-state-function 'multi-isearch-push-state)
(add-hook 'isearch-mode-end-hook 'multi-isearch-end)))
(setq-default isearch-search-fun-function #'multi-isearch-search-fun
isearch-wrap-function #'multi-isearch-wrap
isearch-push-state-function #'multi-isearch-push-state)
(add-hook 'isearch-mode-end-hook #'multi-isearch-end)))
(defun multi-isearch-end ()
"Clean up the multi-buffer search after terminating isearch."
......@@ -133,7 +133,7 @@ Intended to be added to `isearch-mode-hook'."
(setq-default isearch-search-fun-function multi-isearch-orig-search-fun
isearch-wrap-function multi-isearch-orig-wrap
isearch-push-state-function multi-isearch-orig-push-state)
(remove-hook 'isearch-mode-end-hook 'multi-isearch-end))
(remove-hook 'isearch-mode-end-hook #'multi-isearch-end))
(defun multi-isearch-search-fun ()
"Return the proper search function, for isearch in multiple buffers."
......@@ -238,7 +238,7 @@ set in `multi-isearch-buffers' or `multi-isearch-buffers-regexp'."
(while (not (string-equal
(setq buf (read-buffer (multi-occur--prompt) nil t))
(add-to-list 'bufs buf)
(cl-pushnew buf bufs)
(setq ido-ignore-item-temp-list bufs))
(nreverse bufs)))
......@@ -322,7 +322,7 @@ Every next/previous file in the defined sequence is visited by
(add-to-list 'files file))
(cl-pushnew file files :test #'equal))
(nreverse files)))
;; A regexp is not the same thing as a file glob - does this matter?
......@@ -381,7 +381,7 @@ whose file names match the specified wildcard."
(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)
(remove-hook 'isearch-mode-hook #'multi-isearch-setup)
(let ((defs (list (car unload-function-defs-list)))
(auto '(multi-isearch-next-buffer-function
......@@ -395,7 +395,7 @@ Also prevent the feature from being reloaded via `isearch-mode-hook'."
;; .
(defalias 'misearch-unload-function 'multi-isearch-unload-function)
(defalias 'misearch-unload-function #'multi-isearch-unload-function)
(provide 'multi-isearch)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment