[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/easy-kill 3ca8018 05/14: Check boundary in easy-kill-bo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/easy-kill 3ca8018 05/14: Check boundary in easy-kill-bounds-of-thing-at-point |
Date: |
Mon, 15 Mar 2021 22:20:16 -0400 (EDT) |
branch: externals/easy-kill
commit 3ca8018878e24b3a9066747eb07e570747c036e9
Author: Leo Liu <sdl.web@gmail.com>
Commit: Leo Liu <sdl.web@gmail.com>
Check boundary in easy-kill-bounds-of-thing-at-point
---
easy-kill.el | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index e063139..40d537a 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -1,6 +1,6 @@
;;; easy-kill.el --- kill & mark things easily -*- lexical-binding: t;
-*-
-;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015 Free Software Foundation, Inc.
;; Author: Leo Liu <sdl.web@gmail.com>
;; Version: 0.9.4
@@ -413,11 +413,17 @@ checked."
(defun easy-kill-bounds-of-thing-at-point (thing)
"Easy Kill wrapper for `bounds-of-thing-at-point'."
- (pcase (easy-kill-thing-handler
- (format "easy-kill-bounds-of-%s-at-point" thing)
- major-mode)
- ((and (pred functionp) fn) (funcall fn))
- (_ (bounds-of-thing-at-point thing))))
+ ;; Work around a bug (fixed in 25.1, commit: 7a94f28a) in
+ ;; `thing-at-point-bounds-of-url-at-point' that could return a
+ ;; boundary not containing current point.
+ (cl-flet ((chk (bound)
+ (pcase-let ((`(,b . ,e) bound))
+ (and b e (<= b (point) e) (cons b e)))))
+ (pcase (easy-kill-thing-handler
+ (format "easy-kill-bounds-of-%s-at-point" thing)
+ major-mode)
+ ((and (pred functionp) fn) (chk (funcall fn)))
+ (_ (chk (bounds-of-thing-at-point thing))))))
(defun easy-kill-thing-forward-1 (thing &optional n)
"Easy Kill wrapper for `forward-thing'."
- [elpa] externals/easy-kill updated (e3b2442 -> 2a6309d), Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 02dcebc 02/14: Implement easy-kill-delete-region., Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 288f309 03/14: Fix a compiler warning on 24.4+, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill bf28f77 04/14: Add `D' for selecting current defun name, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 5060d01 11/14: Fix #29: New command easy-kill-cycle, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 3ca8018 05/14: Check boundary in easy-kill-bounds-of-thing-at-point,
Stefan Monnier <=
- [elpa] externals/easy-kill e2b667f 10/14: Merge pull request #27 from syohex/fix-doc, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill c73aa3b 12/14: New macro easy-kill-defun to simplify defining some commands, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 7056376 07/14: Fix #25: Avoid using `<=' feature from 24.4, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 2a6309d 14/14: Limit easy-kill-exchange-point-and-mark to easy-mark only, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill af56568 08/14: Fix #26: Make easy-kill-unhighlight save selection candidate, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 5226660 01/14: Fix #16: New user variable easy-kill-unhighlight-key, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 17994a0 09/14: Fix document, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill 5b4ae1e 13/14: Introduce easy-kill-cycle-ignored to opt out of cycling, Stefan Monnier, 2021/03/15
- [elpa] externals/easy-kill cf5488a 06/14: Merge pull request #20 from knu/delete-region, Stefan Monnier, 2021/03/15