[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil 59158b3df1 2/2: Restore `evil-select-an-object` API
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil 59158b3df1 2/2: Restore `evil-select-an-object` API |
Date: |
Fri, 1 Jul 2022 11:58:15 -0400 (EDT) |
branch: elpa/evil
commit 59158b3df13681c42edf5ba73e307adef503777a
Author: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>
Restore `evil-select-an-object` API
Before commit
b799fca7 Add `evil-select-an-unrestricted-object`
evil-select-an-object was used for unrestricted selection. b799fca7
made this function restrict selection to a line, and introduced a new
function evil-select-an-unrestricted-object that works same way as
evil-select-an-object before.
But evil-select-an-object is an API that might be used by people in
custom configuration, and changing behavior of the function would result
in silent breakage.
It is also worth noting that documentation at doc/source/extension.rst
and doc/build/texinfo/evil.texi still mentions the older unrestricted
behavior.
So let's restore the original behavior of evil-select-an-object by:
1. Renaming evil-select-an-object → evil-select-a-restricted-object
2. Renaming evil-select-an-unrestricted-object → evil-select-an-object
---
evil-commands.el | 10 +++++-----
evil-common.el | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/evil-commands.el b/evil-commands.el
index f1ba7aa573..44675aa1aa 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -1276,7 +1276,7 @@ or line COUNT to the top of the window."
(evil-define-text-object evil-a-word (count &optional beg end type)
"Select a word."
- (evil-select-an-object 'evil-word beg end type count))
+ (evil-select-a-restricted-object 'evil-word beg end type count))
(evil-define-text-object evil-inner-word (count &optional beg end type)
"Select inner word."
@@ -1284,7 +1284,7 @@ or line COUNT to the top of the window."
(evil-define-text-object evil-a-WORD (count &optional beg end type)
"Select a WORD."
- (evil-select-an-object 'evil-WORD beg end type count))
+ (evil-select-a-restricted-object 'evil-WORD beg end type count))
(evil-define-text-object evil-inner-WORD (count &optional beg end type)
"Select inner WORD."
@@ -1292,7 +1292,7 @@ or line COUNT to the top of the window."
(evil-define-text-object evil-a-symbol (count &optional beg end type)
"Select a symbol."
- (evil-select-an-unrestricted-object 'evil-symbol beg end type count))
+ (evil-select-an-object 'evil-symbol beg end type count))
(evil-define-text-object evil-inner-symbol (count &optional beg end type)
"Select inner symbol."
@@ -1300,7 +1300,7 @@ or line COUNT to the top of the window."
(evil-define-text-object evil-a-sentence (count &optional beg end type)
"Select a sentence."
- (evil-select-an-unrestricted-object 'evil-sentence beg end type count))
+ (evil-select-an-object 'evil-sentence beg end type count))
(evil-define-text-object evil-inner-sentence (count &optional beg end type)
"Select inner sentence."
@@ -1309,7 +1309,7 @@ or line COUNT to the top of the window."
(evil-define-text-object evil-a-paragraph (count &optional beg end type)
"Select a paragraph."
:type line
- (evil-select-an-unrestricted-object 'evil-paragraph beg end type count t))
+ (evil-select-an-object 'evil-paragraph beg end type count t))
(evil-define-text-object evil-inner-paragraph (count &optional beg end type)
"Select inner paragraph."
diff --git a/evil-common.el b/evil-common.el
index 8a2a5b929c..00e0d020ce 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -3153,7 +3153,7 @@ linewise, otherwise it is character wise."
(save-excursion (end-of-line) (point)))
(evil-select-inner-object thing beg end type count line)))
-(defun evil-select-an-unrestricted-object (thing beg end type count &optional
line)
+(defun evil-select-an-object (thing beg end type count &optional line)
"Return an outer text object range of COUNT objects.
If COUNT is positive, return objects following point; if COUNT is
negative, return objects preceding point. If one is unspecified,
@@ -3229,7 +3229,7 @@ linewise, otherwise it is character wise."
(if line 'line type)
:expanded t)))
-(defun evil-select-an-object (thing beg end type &optional count line)
+(defun evil-select-a-restricted-object (thing beg end type &optional count
line)
"Return an outer text object range of COUNT objects.
Selection is restricted to the current line.
If COUNT is positive, return objects following point; if COUNT is
@@ -3241,7 +3241,7 @@ linewise, otherwise it is character wise."
(save-restriction
(narrow-to-region (save-excursion (beginning-of-line) (point))
(save-excursion (end-of-line) (point)))
- (evil-select-an-unrestricted-object thing beg end type count line)))
+ (evil-select-an-object thing beg end type count line)))
(defun evil--get-block-range (op cl selection-type)
"Return the exclusive range of a visual selection.