[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-anzu 911c43022e 01/27: init repos
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-anzu 911c43022e 01/27: init repos |
Date: |
Thu, 6 Jan 2022 03:59:29 -0500 (EST) |
branch: elpa/evil-anzu
commit 911c43022ef7c2b2ab146249c2e40f31d5755ff9
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
init repos
---
.gitignore | 2 ++
Cask | 5 +++
README.md | 5 +++
evil-anzu.el | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 120 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..e15865d013
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/.cask/
+*.elc
diff --git a/Cask b/Cask
new file mode 100644
index 0000000000..8bf91616c4
--- /dev/null
+++ b/Cask
@@ -0,0 +1,5 @@
+(source melpa)
+
+(package-file "evil-anzu.el")
+(depends-on "anzu")
+(depends-on "evil")
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..c4e7538b90
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# evil-anzu
+
+[anzu](https://github.com/syohex/emacs-anzu) for
[evil-mode](https://gitorious.org/evil)
+
+evil-anzu is currently under development.
diff --git a/evil-anzu.el b/evil-anzu.el
new file mode 100644
index 0000000000..0d653ccab2
--- /dev/null
+++ b/evil-anzu.el
@@ -0,0 +1,108 @@
+;;; evil-anzu.el --- anzu for evil-mode
+
+;; Copyright (C) 2015 by Syohei YOSHIDA
+
+;; Author: Syohei YOSHIDA <syohex@gmail.com>
+;; Version: 0.01
+;; Package-Requires: ((anzu "0.46"))
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'evil)
+(require 'anzu)
+
+(defgroup evil-anzu nil
+ "anzu for evil-mode"
+ :group 'anzu)
+
+(defvar evil-anzu--displayed nil)
+
+(defconst evil-anzu--search-commands
+ '(evil-anzu-search-next evil-anzu-search-previous))
+
+(defun evil-anzu--update ()
+ (anzu--cons-mode-line 'search)
+ (let ((query (if evil-regexp-search
+ (car-safe regexp-search-ring)
+ (car-safe search-ring))))
+ (anzu--update query))
+ (setq evil-anzu--displayed t))
+
+(evil-define-motion evil-anzu-search-next (count)
+ "Repeat the last search."
+ :jump t
+ :type exclusive
+ (dotimes (var (or count 1))
+ (evil-search (if evil-regexp-search
+ (car-safe regexp-search-ring)
+ (car-safe search-ring))
+ isearch-forward evil-regexp-search))
+ (evil-anzu--update))
+
+(evil-define-motion evil-anzu-search-previous (count)
+ "Repeat the last search in the opposite direction."
+ :jump t
+ :type exclusive
+ (dotimes (var (or count 1))
+ (evil-search (if evil-regexp-search
+ (car-safe regexp-search-ring)
+ (car-safe search-ring))
+ (not isearch-forward) evil-regexp-search))
+ (evil-anzu--update))
+
+(defun evil-anzu--pre-command-hook ()
+ (when (and evil-anzu--displayed (not (memq this-command
evil-anzu--search-commands)))
+ (anzu--reset-mode-line)
+ (setq evil-anzu--displayed nil)))
+
+(defun evil-anzu--reset-mode-line ()
+ (when (and anzu-cons-mode-line-p (anzu--mode-line-not-set-p))
+ (setq mode-line-format (delete anzu--mode-line-format mode-line-format))))
+
+(define-minor-mode evil-anzu-mode
+ "anzu for evil-mode."
+ :group 'evil-anzu
+ :init-value nil
+ :global nil
+ :lighter anzu-mode-lighter
+ (if evil-anzu-mode
+ (progn
+ (add-hook 'isearch-update-post-hook 'anzu--update-post-hook nil t)
+ (add-hook 'isearch-mode-hook 'anzu--cons-mode-line-search nil t)
+ (add-hook 'isearch-mode-end-hook 'evil-anzu--reset-mode-line nil t)
+ (add-hook 'pre-command-hook 'evil-anzu--pre-command-hook nil t))
+ (remove-hook 'isearch-update-post-hook 'anzu--update-post-hook t)
+ (remove-hook 'isearch-mode-hook 'anzu--cons-mode-line t)
+ (remove-hook 'isearch-mode-end-hook 'anzu--reset-mode-line t)
+ (remove-hook 'pre-command-hook 'evil-anzu--pre-command-hook t)
+ (anzu--reset-mode-line)))
+
+(defun evil-anzu--turn-on ()
+ (unless (minibufferp)
+ (evil-anzu-mode +1)))
+
+;;;###autoload
+(define-globalized-minor-mode global-evil-anzu-mode evil-anzu-mode
evil-anzu--turn-on
+ :group 'evil-anzu)
+
+(defadvice evil-search (before reset-anzu-information activate)
+ (anzu--reset-status))
+
+(provide 'evil-anzu)
+
+;;; evil-anzu.el ends here
- [nongnu] branch elpa/evil-anzu created (now d3f6ed4773), ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu 911c43022e 01/27: init repos,
ELPA Syncer <=
- [nongnu] elpa/evil-anzu c2318e6aad 04/27: Merge pull request #1 from syohex/disable-highlight-when-flash, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu 374bea49a3 14/27: Add configuration example, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu 6cac9c1fef 16/27: Make anzu work with the 'evil-search search module, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu 995141132b 17/27: Merge pull request #6 from GordonGustafson/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu fbf975f676 26/27: Merge pull request #10 from CeleritasCelery/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu 012bbb192f 25/27: add unload feature function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu c5f8dd4aa0 05/27: add evil dependency, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu 47624e12ca 11/27: Update readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu a041db15bd 20/27: Fix melpa stable link, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-anzu 183e42a7e4 21/27: Update README, ELPA Syncer, 2022/01/06