[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu e567375313 142/288: Improve case when bounds-og-thing
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu e567375313 142/288: Improve case when bounds-og-thing-at-point returns nil |
Date: |
Thu, 6 Jan 2022 03:58:47 -0500 (EST) |
branch: elpa/anzu
commit e56737531365f3d686d0cbeeb825778663dcb2ff
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
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 a06fb937b5 110/288: Enable lexical-binding, (continued)
- [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
- [nongnu] elpa/anzu 2a3d8d76d2 141/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e567375313 142/288: Improve case when bounds-og-thing-at-point returns nil,
ELPA Syncer <=
- [nongnu] elpa/anzu 67b98d6103 146/288: Improve calculation of current replacement position, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu c8f3e7b651 150/288: Merge pull request #35 from syohex/better-migemo-checking, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 962c425d39 149/288: Better checking whether using migemo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ffaf6b3c10 153/288: Add MELPA badges, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5b2ce629b7 154/288: Update MELPA links, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu d3650160d7 161/288: Don't search if input regexp is not valid yet., ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu dcae136088 173/288: Fix displaying current replaced point, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e3aab048b4 168/288: Disable blink-matching-paren in read 'to' string, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b9bac0e2f8 178/288: Merge pull request #43 from syohex/fix-compile-regexp-error-case, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 1f7ac26191 189/288: Just call isearch-symbol-regexp instead of constructing own regexp, ELPA Syncer, 2022/01/06