[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu a81c99b146 105/288: Merge pull request #18 from syohe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu a81c99b146 105/288: Merge pull request #18 from syohex/switch-to-cl-lib |
Date: |
Thu, 6 Jan 2022 03:58:44 -0500 (EST) |
branch: elpa/anzu
commit a81c99b146c43da3d1c3f0400f89dd277c092bbb
Merge: 0b3cf4b0a6 906287cb5e
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Merge pull request #18 from syohex/switch-to-cl-lib
Switch cl-lib.el from cl.el
---
README.md | 1 +
anzu.el | 31 ++++++++++++++++---------------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index 15239bbb57..cc98e8be4c 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ information in the mode-line in various search mode.
## Requirements
* Emacs 24 or higher
+* cl-lib 0.3 or higher
## Installation
diff --git a/anzu.el b/anzu.el
index 3db5c7e7c0..16c4946572 100644
--- a/anzu.el
+++ b/anzu.el
@@ -5,6 +5,7 @@
;; Author: Syohei YOSHIDA <syohex@gmail.com>
;; URL: https://github.com/syohex/emacs-anzu
;; Version: 0.28
+;; Package-Requires: ((cl-lib "0.3"))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -36,9 +37,9 @@
;;; Code:
(eval-when-compile
- (require 'cl)
(defvar migemo-isearch-enable-p))
+(require 'cl-lib)
(require 'thingatpt)
(defgroup anzu nil
@@ -164,7 +165,7 @@
(case-fold-search (anzu--case-fold-search str)))
(while (and (not finish) (funcall search-func str nil t))
(push (cons (match-beginning 0) (match-end 0)) positions)
- (incf count)
+ (cl-incf count)
(when (= (match-beginning 0) (match-end 0)) ;; Case of anchor such
as "^"
(if (eobp)
(setq finish t)
@@ -176,11 +177,11 @@
result)))))
(defun anzu--where-is-here (positions here)
- (loop for (start . end) in positions
- for i = 1 then (1+ i)
- when (and (>= here start) (<= here end))
- return i
- finally return 0))
+ (cl-loop for (start . end) in positions
+ for i = 1 then (1+ i)
+ when (and (>= here start) (<= here end))
+ return i
+ finally return 0))
(defun anzu--update ()
(when (>= (length isearch-string) anzu-minimum-input-length)
@@ -226,7 +227,7 @@
here))
(defun anzu--update-mode-line-default (here total)
- (case anzu--state
+ (cl-case anzu--state
(search (propertize (format "(%s/%d%s)"
(anzu--format-here-position here total)
total (if anzu--overflow-p "+" ""))
@@ -300,7 +301,7 @@
(finish nil)
(case-fold-search (anzu--case-fold-search str)))
(while (and (not finish) (re-search-forward str replace-end t))
- (incf count)
+ (cl-incf count)
(let ((beg (match-beginning 0))
(end (match-end 0)))
(when (= beg end)
@@ -394,10 +395,10 @@
(< (overlay-start a) (overlay-start b)))
(defsubst anzu--overlays-in-range (beg end)
- (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)))
+ (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)))
(defsubst anzu--propertize-to-string (str)
(let ((separator (or anzu-replace-to-string-separator "")))
@@ -413,7 +414,7 @@
(let ((replace-evaled (and use-regexp (anzu--evaluate-occurrence
ov content replace-count))))
(if replace-evaled
- (incf replace-count)
+ (cl-incf replace-count)
(setq replace-evaled content))
(overlay-put ov 'after-string (anzu--propertize-to-string
replace-evaled))))))))
@@ -511,7 +512,7 @@
(list from to delimited beg end backward)
(list from to delimited beg end)))
-(defun* anzu--query-replace-common (use-regexp &key at-cursor thing prefix-arg
(query t))
+(cl-defun anzu--query-replace-common (use-regexp &key at-cursor thing
prefix-arg (query t))
(anzu--cons-mode-line 'replace)
(let* ((use-region (use-region-p))
(backward (anzu--replace-backward-p prefix-arg))
- [nongnu] elpa/anzu 168d8c7f73 043/288: Bump up version and update Changes, (continued)
- [nongnu] elpa/anzu 168d8c7f73 043/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ff4393fac5 050/288: Add feature that highlight replaced texts, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e2e8d12905 058/288: Update face documentation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ebfbfe7e01 060/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a8f75879a8 063/288: Don't evaluate not regexp replacement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu f503b785ef 065/288: Update about anzu-query-replace-at-cursor, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 71fb782b38 064/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 3dbd22ff44 086/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5c59c252d5 099/288: Fix ignore case problem, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu bac9660b47 102/288: Add non query replace command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a81c99b146 105/288: Merge pull request #18 from syohex/switch-to-cl-lib,
ELPA Syncer <=
- [nongnu] elpa/anzu e26f29af37 109/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a06fb937b5 110/288: Enable lexical-binding, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e817db8532 115/288: Fix byte compile warning for Emacs 24.3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu f3c83f3109 116/288: Merge pull request #21 from syohex/fix-byte-compile-warning, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b7185acafc 122/288: Use original function name instead of alias, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a77aa41dbc 121/288: Update Git animation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 59fec57b13 124/288: Add Cask file for testing, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 43cb178b16 133/288: Update mode line like searching in replacing command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e53fe6d0fc 135/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 48eb310d24 139/288: Improve restoring point when canceling, ELPA Syncer, 2022/01/06