From ffcd852d7d11f89de81857712633538040638f53 Mon Sep 17 00:00:00 2001 From: rubikitch Date: Thu, 9 Dec 2010 19:56:15 +0900 Subject: [PATCH] anything-complete.el (tap-symbol): replace with symbol-at-point (alcs-initial-input, alcs-init) --- extensions/anything-complete.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/extensions/anything-complete.el b/extensions/anything-complete.el index 22007ad..c0f666c 100644 --- a/extensions/anything-complete.el +++ b/extensions/anything-complete.el @@ -234,7 +234,7 @@ used by `anything-lisp-complete-symbol-set-timer' and `anything-apropos'" (if (loop for src in (anything-get-sources) thereis (string-match "^dabbrev" (assoc-default 'name src))) anything-dabbrev-last-target - (anything-aif (symbol-at-point) (symbol-name it) ""))) + (anything-aif (tap-symbol) (symbol-name it) ""))) (anything-candidate-buffer (get-buffer bufname))) (defcustom anything-complete-sort-candidates nil @@ -442,8 +442,15 @@ used by `anything-lisp-complete-symbol-set-timer' and `anything-apropos'" (alcs-make-candidates) (anything-update)) +(defun tap-symbol () + "Get symbol before point." + (save-excursion + (let ((beg (point))) + (when (re-search-backward "\(\\|\\s-\\|^\\|\r\\|'\\|#'" (point-at-bol)) + (intern (buffer-substring-no-properties beg (match-end 0))))))) + (defun alcs-initial-input (partial-match) - (anything-aif (symbol-at-point) + (anything-aif (tap-symbol) (format "%s%s%s" (if partial-match "" "^") it -- 2.11.4.GIT