update packages
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
(define-package "swiper" "20231025.2311" "Isearch with an overview. Oh, man!"
|
||||
(define-package "swiper" "20250224.2125" "Isearch with an overview. Oh, man!"
|
||||
'((emacs "24.5")
|
||||
(ivy "0.14.2"))
|
||||
:commit "8c30f4cab5948aa8d942a3b2bbf5fb6a94d9441d" :authors
|
||||
(ivy "0.15.0"))
|
||||
:commit "7a0d554aaf4ebbb2c45f2451d77747df4f7e2742" :authors
|
||||
'(("Oleh Krehel" . "ohwoeowho@gmail.com"))
|
||||
:maintainers
|
||||
'(("Basil L. Contovounesios" . "contovob@tcd.ie"))
|
||||
'(("Basil L. Contovounesios" . "basil@contovou.net"))
|
||||
:maintainer
|
||||
'("Basil L. Contovounesios" . "contovob@tcd.ie")
|
||||
'("Basil L. Contovounesios" . "basil@contovou.net")
|
||||
:keywords
|
||||
'("matching")
|
||||
:url "https://github.com/abo-abo/swiper")
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
;;; swiper.el --- Isearch with an overview. Oh, man! -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2015-2023 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2015-2025 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Oleh Krehel <ohwoeowho@gmail.com>
|
||||
;; Maintainer: Basil L. Contovounesios <contovob@tcd.ie>
|
||||
;; Maintainer: Basil L. Contovounesios <basil@contovou.net>
|
||||
;; URL: https://github.com/abo-abo/swiper
|
||||
;; Version: 0.14.2
|
||||
;; Package-Requires: ((emacs "24.5") (ivy "0.14.2"))
|
||||
;; Version: 0.15.0
|
||||
;; Package-Requires: ((emacs "24.5") (ivy "0.15.0"))
|
||||
;; Keywords: matching
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
@@ -38,6 +38,16 @@
|
||||
(require 'cl-lib)
|
||||
(require 'ivy)
|
||||
|
||||
(eval-when-compile
|
||||
(unless (fboundp 'static-if)
|
||||
(defmacro static-if (condition then-form &rest else-forms)
|
||||
"Expand to THEN-FORM or ELSE-FORMS based on compile-time CONDITION.
|
||||
Polyfill for Emacs 30 `static-if'."
|
||||
(declare (debug (sexp sexp &rest sexp)) (indent 2))
|
||||
(if (eval condition lexical-binding)
|
||||
then-form
|
||||
(macroexp-progn else-forms)))))
|
||||
|
||||
(defgroup swiper nil
|
||||
"`isearch' with an overview."
|
||||
:group 'matching
|
||||
@@ -280,18 +290,19 @@ If the input is empty, select the previous history element instead."
|
||||
(declare-function avy--remove-leading-chars "ext:avy")
|
||||
|
||||
(defun swiper--avy-candidates ()
|
||||
(let* (
|
||||
(let* ((visible-overlays
|
||||
(with-ivy-window (overlays-in (window-start) (window-end))))
|
||||
;; We'll have overlapping overlays, so we sort all the
|
||||
;; overlays in the visible region by their start, and then
|
||||
;; throw out non-Swiper overlays or overlapping Swiper
|
||||
;; overlays.
|
||||
(visible-overlays (cl-sort (with-ivy-window
|
||||
(overlays-in (window-start)
|
||||
(window-end)))
|
||||
#'< :key #'overlay-start))
|
||||
(visible-overlays
|
||||
(static-if (bound-and-true-p ivy--new-sort-p)
|
||||
(sort visible-overlays :key #'overlay-start :in-place t)
|
||||
(cl-sort visible-overlays #'< :key #'overlay-start)))
|
||||
(min-overlay-start 0)
|
||||
(overlays-for-avy
|
||||
(cl-remove-if-not
|
||||
(cl-delete-if-not
|
||||
(lambda (ov)
|
||||
(when (and (>= (overlay-start ov)
|
||||
min-overlay-start)
|
||||
@@ -770,7 +781,7 @@ Add a space after a leading `^' for `swiper', and apply
|
||||
This is the regex used in the minibuffer where candidates have
|
||||
line numbers. For the buffer, use `ivy--regex' instead."
|
||||
(let* ((re-builder (ivy-alist-setting ivy-re-builders-alist))
|
||||
(str (replace-regexp-in-string "\\\\n" "\n" str))
|
||||
(str (ivy--string-replace "\\n" "\n" str))
|
||||
(re (funcall re-builder str)))
|
||||
(if (consp re)
|
||||
(mapcar
|
||||
@@ -937,24 +948,17 @@ the face, window and priority of the overlay."
|
||||
(or (display-graphic-p)
|
||||
(not recenter-redisplay)))
|
||||
|
||||
(defun swiper--positive-regexps ()
|
||||
(if (listp ivy-regex)
|
||||
(mapcar #'car (cl-remove-if-not #'cdr ivy-regex))
|
||||
(list ivy-regex)))
|
||||
|
||||
(defun swiper--update-input-ivy ()
|
||||
"Called when `ivy' input is updated."
|
||||
(with-ivy-window
|
||||
(swiper--cleanup)
|
||||
(when (> (length (ivy-state-current ivy-last)) 0)
|
||||
(let ((regexps (swiper--positive-regexps))
|
||||
(let ((regexps (ivy--positive-regexps))
|
||||
(re-idx -1)
|
||||
(case-fold-search (ivy--case-fold-p ivy-text)))
|
||||
(dolist (re regexps)
|
||||
(setq re-idx (1+ re-idx))
|
||||
(let* ((re (replace-regexp-in-string
|
||||
" " "\t"
|
||||
re))
|
||||
(let* ((re (ivy--string-replace " " "\t" re))
|
||||
(num (swiper--line-number (ivy-state-current ivy-last))))
|
||||
(unless (memq this-command '(ivy-yank-word
|
||||
ivy-yank-symbol
|
||||
@@ -1261,7 +1265,7 @@ otherwise continue prompting for buffers."
|
||||
"Search in all open buffers for STR."
|
||||
(or
|
||||
(ivy-more-chars)
|
||||
(let* ((buffers (cl-remove-if-not #'swiper-all-buffer-p (buffer-list)))
|
||||
(let* ((buffers (cl-delete-if-not #'swiper-all-buffer-p (buffer-list)))
|
||||
(re-full ivy-regex)
|
||||
re re-tail
|
||||
cands match
|
||||
@@ -1483,7 +1487,7 @@ that we search only for one character."
|
||||
(lambda ()
|
||||
(with-ivy-window
|
||||
(swiper--add-overlays (ivy--regex ivy-text))))))
|
||||
(dolist (re (swiper--positive-regexps))
|
||||
(dolist (re (ivy--positive-regexps))
|
||||
(swiper--add-overlays re))))
|
||||
|
||||
(defun swiper--isearch-candidate-pos (cand)
|
||||
|
||||
Reference in New Issue
Block a user