summaryrefslogtreecommitdiff
path: root/helm-semantic.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2014-12-24 08:52:36 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2014-12-24 08:52:36 +0100
commit9ea601ec45210fb1a20309b710afc74a0a301353 (patch)
tree6ee16fcaba934d3ca9cd1133b152471ed53ede86 /helm-semantic.el
parenta41be7b39a47389e666f58735340d5971714bec9 (diff)
Get all infos of major-mode in helm-semantic and simplify (#777).
* helm-semantic.el (helm-semantic-source): Use helm-source-in-buffer. (helm-semantic-get-candidates): Removed.
Diffstat (limited to 'helm-semantic.el')
-rw-r--r--helm-semantic.el13
1 files changed, 4 insertions, 9 deletions
diff --git a/helm-semantic.el b/helm-semantic.el
index fc3b4e05..05b8880c 100644
--- a/helm-semantic.el
+++ b/helm-semantic.el
@@ -98,12 +98,6 @@
(unless persistent
(pulse-momentary-highlight-one-line (point))))))
-(defun helm-semantic-get-candidates ()
- "Get a list of candidates in the current buffer."
- (split-string (with-temp-buffer
- (helm-semantic--fetch-candidates helm-semantic--tags-cache 0)
- (buffer-string)) "\n"))
-
(defun helm-semantic--maybe-set-needs-update ()
(with-helm-current-buffer
(let ((tick (buffer-modified-tick)))
@@ -113,13 +107,14 @@
(defvar helm-source-semantic nil)
-(defclass helm-semantic-source (helm-source-sync)
+(defclass helm-semantic-source (helm-source-in-buffer)
((init :initform (lambda ()
(helm-semantic--maybe-set-needs-update)
(setq helm-semantic--tags-cache (semantic-fetch-tags))
(with-current-buffer (helm-candidate-buffer 'global)
- (helm-semantic--fetch-candidates helm-semantic--tags-cache 0))))
- (candidates :initform 'helm-semantic-get-candidates)
+ (let ((major-mode (with-helm-current-buffer major-mode)))
+ (helm-semantic--fetch-candidates helm-semantic--tags-cache 0)))))
+ (get-line :initform 'buffer-substring)
(persistent-help :initform "Show this entry")
(keymap :initform 'helm-semantic-map)
(mode-line :initform helm-semantic-mode-line)