[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu 04ac39641e 143/288: Merge pull request #32 from syohe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu 04ac39641e 143/288: Merge pull request #32 from syohex/fix-at-cursor-beginning-point |
Date: |
Thu, 6 Jan 2022 03:58:47 -0500 (EST) |
branch: elpa/anzu
commit 04ac39641e9b476d5556d83457f52891c44e3fe5
Merge: 2a3d8d76d2 e567375313
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Merge pull request #32 from syohex/fix-at-cursor-beginning-point
Improve case when bounds-og-thing-at-point returns nil
---
anzu.el | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/anzu.el b/anzu.el
index 9a427d16ca..b944fe5adb 100644
--- a/anzu.el
+++ b/anzu.el
@@ -525,15 +525,22 @@
(defun anzu--thing-begin (thing)
(let ((bound (bounds-of-thing-at-point thing)))
- (and bound (car bound))))
-
-(defun anzu--thing-end (thing)
+ (if bound
+ (car bound)
+ (let ((fallback-bound (bounds-of-thing-at-point 'symbol)))
+ (if fallback-bound
+ (car fallback-bound)
+ (point))))))
+
+(defsubst anzu--thing-end (thing)
(let ((bound (bounds-of-thing-at-point thing)))
- (and bound (cdr bound))))
+ (if bound
+ (cdr bound)
+ (point-max))))
(defun anzu--region-begin (use-region thing backward)
(cond (current-prefix-arg (line-beginning-position))
- (thing (or (anzu--thing-begin thing) (point)))
+ (thing (anzu--thing-begin thing))
(use-region (region-beginning))
(backward (point-min))
(t (point))))
@@ -546,7 +553,7 @@
(defun anzu--region-end (use-region thing)
(cond (current-prefix-arg
(anzu--line-end-position (prefix-numeric-value current-prefix-arg)))
- (thing (or (anzu--thing-end thing) (point-max)))
+ (thing (anzu--thing-end thing))
(use-region (region-end))
(t (point-max))))
- [nongnu] elpa/anzu 906287cb5e 104/288: Switch cl-lib.el from cl.el, (continued)
- [nongnu] elpa/anzu 906287cb5e 104/288: Switch cl-lib.el from cl.el, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a0a16ab869 108/288: Merge pull request #19 from syohex/improve-prompt, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu c26de0ecef 112/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 4b9c6479d8 117/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 24a2589f10 119/288: Merge pull request #23 from syohex/fix-replacement-issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 6cad7a027f 123/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu fb003540df 129/288: fix typo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 9fc916b6de 131/288: Fix for symbol search and toggle in isearch-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 0bdbfcb209 138/288: Improve case when input does not match anything in visiable range(#30), ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu af40f91a98 140/288: Merge pull request #31 from syohex/no-match-case, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 04ac39641e 143/288: Merge pull request #32 from syohex/fix-at-cursor-beginning-point,
ELPA Syncer <=
- [nongnu] elpa/anzu c61f6734b1 152/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 3adcdab743 163/288: Correct saving replacement history, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 9064fc7892 169/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 75bd476be1 045/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 8622c1fa93 049/288: Fix typo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b8d328805a 053/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu bb3f7b63ef 059/288: Implement anzu-query-replace-at-cursor, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 7c56f15f72 068/288: add deactivate-region flag when using region, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b6672c9bf2 061/288: Improve overlay replace text, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 0e7873a3e7 075/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06