[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu 09cc87ad9b 228/288: Merge pull request #66 from syohe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu 09cc87ad9b 228/288: Merge pull request #66 from syohex/replace-threshold |
Date: |
Thu, 6 Jan 2022 03:58:55 -0500 (EST) |
branch: elpa/anzu
commit 09cc87ad9bcaceb4665d7162990aa8d4053d4951
Merge: 6fded24b36 f2aad769c1
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Merge pull request #66 from syohex/replace-threshold
Add replacement overlay threshold customize variable
---
README.md | 22 +++++++++++++---------
anzu.el | 15 +++++++++++++--
2 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/README.md b/README.md
index 7abf3912ed..8f6be8f448 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,13 @@ information in the mode-line in various search modes.
## Requirements
-* Emacs 24 or higher
-* `cl-lib` 0.5 or higher (you don't need to install `cl-lib` if you use Emacs
24.3 or higher)
+- Emacs 24 or higher
+- `cl-lib` 0.5 or higher (you don't need to install `cl-lib` if you use Emacs
24.3 or higher)
## Installation
-You can install `anzu.el` from [MELPA](http://melpa.org/) with `package.el`
+You can install `anzu.el` from [MELPA](https://melpa.org/) with `package.el`
```
M-x package-install anzu
@@ -29,20 +29,20 @@ You can install `anzu.el` from [MELPA](http://melpa.org/)
with `package.el`
## Basic Usage
-#### `anzu-mode`
+#### `global-anzu-mode`
-Enable anzu minor mode:
+Enable global anzu mode:
```lisp
-(anzu-mode +1)
+(global-anzu-mode +1)
```
-#### `global-anzu-mode`
+#### `anzu-mode`
-Enable global anzu mode:
+Enable anzu minor mode:
```lisp
-(global-anzu-mode +1)
+(anzu-mode +1)
```
#### `anzu-query-replace`
@@ -160,6 +160,9 @@ If this value is `nil`, `anzu.el` counts all words.
![anzu-threshold](image/anzu-threshold.png)
+#### `anzu-replace-threshold`(Default is `nil`)
+
+Threshold of replacement overlay. If this value is `nil`,
#### `anzu-minimum-input-length`(Default is 1)
@@ -196,6 +199,7 @@ Separator of `to` string.
'(anzu-mode-lighter "")
'(anzu-deactivate-region t)
'(anzu-search-threshold 1000)
+ '(anzu-replace-threshold 50)
'(anzu-replace-to-string-separator " => "))
```
diff --git a/anzu.el b/anzu.el
index f091ce4355..6b6641f84e 100644
--- a/anzu.el
+++ b/anzu.el
@@ -1,6 +1,6 @@
;;; anzu.el --- Show number of matches in mode-line while searching -*-
lexical-binding: t; -*-
-;; Copyright (C) 2015 by Syohei YOSHIDA
+;; Copyright (C) 2016 by Syohei YOSHIDA
;; Author: Syohei YOSHIDA <syohex@gmail.com>
;; URL: https://github.com/syohex/emacs-anzu
@@ -66,6 +66,12 @@
(boolean :tag "No threshold" nil))
:group 'anzu)
+(defcustom anzu-replace-threshold nil
+ "Limit of replacement overlays."
+ :type '(choice (integer :tag "Threshold of replacement overlays")
+ (boolean :tag "No threshold" nil))
+ :group 'anzu)
+
(defcustom anzu-use-migemo nil
"Flag of using migemo"
:type 'boolean
@@ -555,7 +561,12 @@
(cl-loop for ov in (overlays-in beg end)
when (overlay-get ov 'anzu-replace)
collect ov into anzu-overlays
- finally return (sort anzu-overlays 'anzu--overlay-sort)))
+ finally
+ return
+ (let ((sorted (sort anzu-overlays 'anzu--overlay-sort)))
+ (if anzu-replace-threshold
+ (cl-subseq sorted 0 (min (length sorted)
anzu-replace-threshold))
+ sorted))))
(defsubst anzu--propertize-to-string (str)
(let ((separator (or anzu-replace-to-string-separator "")))
- [nongnu] elpa/anzu 0e7873a3e7 075/288: Bump up version and update Changes, (continued)
- [nongnu] elpa/anzu 0e7873a3e7 075/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 68300bc949 078/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 264c36d135 076/288: Fix overlay is not put if match-string is 0 length, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 8bde8ee114 088/288: Update comment, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 29a07403a6 091/288: Merge pull request #12 from syohex/support-backward-replace, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 368a4ebe8c 096/288: Fix no prefix number case, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a36458386d 107/288: Don't show default replacement in prompt, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ef489aadb2 118/288: Fix replacement issue(#22), ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 497864542b 120/288: Bumpup version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu cf07d6a0ec 125/288: Implement specified lines replacement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 09cc87ad9b 228/288: Merge pull request #66 from syohex/replace-threshold,
ELPA Syncer <=
- [nongnu] elpa/anzu b3b912013d 225/288: Add custom variable of replacement threshold, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 380f5fd232 198/288: Merge pull request #53 from kosh04/fix-literal-match, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 38d49e3664 276/288: Revert "Fix issue #93", ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 799f26ee0e 260/288: Merge pull request #86 from syohex/no-match-face, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5bd8f5511d 273/288: Fix backward replace issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu abb129c5f8 148/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu c4a440af86 175/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 05eda5f709 191/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu dcd8eac2e5 165/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 57bad64f1e 185/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06