summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2013-12-29 08:13:58 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2013-12-29 08:13:58 +0100
commit37181f053c98a621f75868d9e14b60a85d35f927 (patch)
treef1f6628e85c17bc85ab04254aa89a90fbe74bb5d
parent307f7e6730f283903c767d0b9da4675dd42976f2 (diff)
* helm-imenu.el (helm-imenu): use new default behavior.
* helm-semantic.el (helm-semantic, helm-semantic-or-imenu): same. * helm.el (helm-sources-using-default-as-input): Add semantic.
-rw-r--r--helm-imenu.el2
-rw-r--r--helm-semantic.el8
-rw-r--r--helm.el1
3 files changed, 9 insertions, 2 deletions
diff --git a/helm-imenu.el b/helm-imenu.el
index a52ccc45..c5084d79 100644
--- a/helm-imenu.el
+++ b/helm-imenu.el
@@ -111,9 +111,11 @@
"Preconfigured `helm' for `imenu'."
(interactive)
(let ((imenu-auto-rescan t)
+ (str (thing-at-point 'symbol))
(helm-execute-action-at-once-if-one
helm-imenu-execute-action-at-once-if-one))
(helm :sources 'helm-source-imenu
+ :default (list (concat "\\_<" str "\\_>") str)
:buffer "*helm imenu*")))
(provide 'helm-imenu)
diff --git a/helm-semantic.el b/helm-semantic.el
index c65b7514..2e49d7bb 100644
--- a/helm-semantic.el
+++ b/helm-semantic.el
@@ -89,8 +89,10 @@
(defun helm-semantic ()
"Preconfigured `helm' for `semantic'."
(interactive)
- (helm :sources 'helm-source-semantic
- :buffer "*helm semantic*"))
+ (let ((str (thing-at-point 'symbol)))
+ (helm :sources 'helm-source-semantic
+ :default (list (concat "\\_<" str "\\_>") str)
+ :buffer "*helm semantic*")))
;;;###autoload
(defun helm-semantic-or-imenu ()
@@ -104,11 +106,13 @@ Fill in the symbol at point by default."
'helm-source-semantic
'helm-source-imenu))
(imenu-p (eq source 'helm-source-imenu))
+ (str (thing-at-point 'symbol))
(imenu-auto-rescan imenu-p)
(helm-execute-action-at-once-if-one
(and imenu-p
helm-imenu-execute-action-at-once-if-one)))
(helm :sources source
+ :default (list (concat "\\_<" str "\\_>") str)
:buffer "*helm semantic/imenu*"
:preselect (unless imenu-p (thing-at-point 'symbol)))))
diff --git a/helm.el b/helm.el
index 9b583f72..b437689b 100644
--- a/helm.el
+++ b/helm.el
@@ -376,6 +376,7 @@ or when `helm-split-window-default-side' is set to 'same."
:type 'boolean)
(defcustom helm-sources-using-default-as-input '(helm-source-imenu
+ helm-source-semantic
helm-source-info-elisp
helm-source-etags-select)
"List of helm sources that need to use `helm-maybe-use-default-as-input'.