[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e8f2064 117/272: Rename counsel-symbol-at-point to ivy-thi
From: |
Oleh Krehel |
Subject: |
[elpa] master e8f2064 117/272: Rename counsel-symbol-at-point to ivy-thing-at-point |
Date: |
Mon, 25 Apr 2016 10:13:20 +0000 |
branch: master
commit e8f2064296bb368703628a33b26955556c95d090
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Rename counsel-symbol-at-point to ivy-thing-at-point
* ivy.el (ivy-thing-at-point): New defun.
(ivy--reset-state): Set `ivy--default' to `ivy-thing-at-point'.
* counsel.el (counsel-symbol-at-point): Mark obsolete.
(counsel-describe-variable):
(counsel-describe-function): Use `ivy-thing-at-point'.
---
counsel.el | 13 ++++---------
ivy.el | 19 +++++++++++++++----
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/counsel.el b/counsel.el
index d4bc469..57b7a33 100644
--- a/counsel.el
+++ b/counsel.el
@@ -342,13 +342,8 @@ Update the minibuffer with the amount of lines collected
every
(error "Couldn't fild definition of %s"
sym))))))))
-(defun counsel-symbol-at-point ()
- "Return current symbol at point as a string."
- (let ((s (thing-at-point 'symbol)))
- (and (stringp s)
- (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
- (match-string 1 s)
- s))))
+(define-obsolete-function-alias 'counsel-symbol-at-point
+ 'ivy-thing-at-point "0.7.0")
(defun counsel-variable-list ()
"Return the list of all currently bound variables."
@@ -369,7 +364,7 @@ Update the minibuffer with the amount of lines collected
every
"Describe variable: "
(counsel-variable-list)
:keymap counsel-describe-map
- :preselect (counsel-symbol-at-point)
+ :preselect (ivy-thing-at-point)
:history 'counsel-describe-symbol-history
:require-match t
:sort t
@@ -397,7 +392,7 @@ Update the minibuffer with the amount of lines collected
every
(push (symbol-name x) cands))))
cands)
:keymap counsel-describe-map
- :preselect (counsel-symbol-at-point)
+ :preselect (ivy-thing-at-point)
:history 'counsel-describe-symbol-history
:require-match t
:sort t
diff --git a/ivy.el b/ivy.el
index c762a6b..396d589 100644
--- a/ivy.el
+++ b/ivy.el
@@ -280,6 +280,20 @@ This should eventually become a stack so that you could use
(defsubst ivy-set-action (action)
(setf (ivy-state-action ivy-last) action))
+(defun ivy-thing-at-point ()
+ "Return a string that corresponds to the current thing at point."
+ (or
+ (thing-at-point 'url)
+ (let (s)
+ (cond ((stringp (setq s (thing-at-point 'symbol)))
+ (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
+ (match-string 1 s)
+ s))
+ ((looking-at "(+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
+ (match-string-no-properties 1))
+ (t
+ "")))))
+
(defvar ivy-history nil
"History list of candidates entered in the minibuffer.
@@ -1401,10 +1415,7 @@ This is useful for recursive `ivy-read'."
(buffer-substring
(region-beginning)
(region-end))
- (or
- (thing-at-point 'url)
- (thing-at-point 'symbol)
- "")))
+ (ivy-thing-at-point)))
(setq ivy--prompt
(cond ((string-match "%.*d" prompt)
prompt)
- [elpa] master ab795d0 265/272: Don't highlight that match in the file name part, (continued)
- [elpa] master ab795d0 265/272: Don't highlight that match in the file name part, Oleh Krehel, 2016/04/25
- [elpa] master 255457a 177/272: Fixed counsel-list-processes-action-switch to use correct buffer., Oleh Krehel, 2016/04/25
- [elpa] master 48b5638 129/272: ivy.el (ivy-next-history-element): Don't add symbol bounds for file names, Oleh Krehel, 2016/04/25
- [elpa] master 41dfae6 194/272: ivy.el (ivy--format-function-generic): Fix doc, Oleh Krehel, 2016/04/25
- [elpa] master f0de338 198/272: ivy.el (ivy--directory-done): Fix when ivy-text is a dir, Oleh Krehel, 2016/04/25
- [elpa] master 67224c0 171/272: counsel.el (counsel-prompt-function): New defcustom, Oleh Krehel, 2016/04/25
- [elpa] master 0c5f68c 183/272: counsel.el (counsel-pt): Add, Oleh Krehel, 2016/04/25
- [elpa] master 692002d 184/272: counsel.el (counsel-pt): Remove unused args, Oleh Krehel, 2016/04/25
- [elpa] master 0bad922 083/272: Provide the :caller in most calls to ivy-read, Oleh Krehel, 2016/04/25
- [elpa] master dabd1f8 205/272: ivy.el (ivy-avy): Make "C-g" cancel gracefully, Oleh Krehel, 2016/04/25
- [elpa] master e8f2064 117/272: Rename counsel-symbol-at-point to ivy-thing-at-point,
Oleh Krehel <=
- [elpa] master 8d04638 202/272: counsel.el: Fix breakage due to helm-rhythmbox, Oleh Krehel, 2016/04/25
- [elpa] master 6ae91f7 213/272: Make ivy-set-sources work also for sync completion, Oleh Krehel, 2016/04/25
- [elpa] master f7c7114 037/272: ivy-test.el (ivy--regex-ignore-order): New test, Oleh Krehel, 2016/04/25
- [elpa] master 1088078 266/272: When selecting a non-existing key in an alist, return that key, Oleh Krehel, 2016/04/25
- [elpa] master 341b5a2 229/272: counsel-grep should pick candidates closest to point, Oleh Krehel, 2016/04/25
- [elpa] master d71b5c5 081/272: swiper.el (swiper--action): Update regexp-search-ring, Oleh Krehel, 2016/04/25
- [elpa] master e1c156b 074/272: ivy.el (ivy--resize-minibuffer-to-fit): Check frame-root-window-p, Oleh Krehel, 2016/04/25
- [elpa] master ebd3e29 089/272: swiper.el (swiper--update-input-ivy): Fix a bug, Oleh Krehel, 2016/04/25
- [elpa] master de0e541 234/272: Speed up counsel-grep by up to 40 times, Oleh Krehel, 2016/04/25
- [elpa] master 299bc13 097/272: Fix initial-input not set to nil for 'read-file-name-internal, Oleh Krehel, 2016/04/25