Skip to content

Commit

Permalink
* helm-dabbrev.el: Allow usage in minibuffer, delay action and allow-…
Browse files Browse the repository at this point in the history
…nesting.

* helm-elisp.el: Same for lisp completion.
* helm-eval.el: Get rid of emacs completion in minibuffer.
  • Loading branch information
thierryvolpiatto committed Jul 2, 2013
1 parent 120fae7 commit 8e72c21
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
14 changes: 9 additions & 5 deletions helm-dabbrev.el
Expand Up @@ -153,10 +153,13 @@ no need to provide \(lisp-interaction-mode . emacs-lisp-mode\) association."
(candidates-in-buffer)
(keymap . ,helm-dabbrev-map)
(action . (lambda (candidate)
(let ((limits (with-helm-current-buffer
(bounds-of-thing-at-point 'symbol))))
(delete-region (car limits) (cdr limits))
(insert candidate))))))
(with-helm-current-buffer
(let* ((limits (bounds-of-thing-at-point 'symbol))
(beg (car limits))
(end (cdr limits)))
(run-with-timer 0.01 nil `(lambda ()
(delete-region ,beg ,end)
(insert ,candidate)))))))))

;;;###autoload
(defun helm-dabbrev ()
Expand All @@ -170,7 +173,8 @@ no need to provide \(lisp-interaction-mode . emacs-lisp-mode\) association."
(helm :sources 'helm-source-dabbrev
:buffer "*helm dabbrev*"
:input (concat "^" dabbrev " ")
:resume 'noresume))))
:resume 'noresume
:allow-nest t))))

(provide 'helm-dabbrev)

Expand Down
9 changes: 6 additions & 3 deletions helm-elisp.el
Expand Up @@ -173,10 +173,13 @@ If `helm-turn-on-show-completion' is nil just do nothing."
(persistent-help . "Show brief doc in mode-line")
(filtered-candidate-transformer helm-lisp-completion-transformer)
(action . (lambda (candidate)
(delete-region beg end)
(insert candidate))))
(with-helm-current-buffer
(run-with-timer 0.01 nil `(lambda ()
(delete-region ,beg ,end)
(insert ,candidate)))))))
:input (if helm-match-plugin-enabled (concat target " ") target)
:resume 'noresume))
:resume 'noresume
:allow-nest t))
(message "[No Match]"))))

(defun helm-lisp-completion-persistent-action (candidate)
Expand Down
9 changes: 4 additions & 5 deletions helm-eval.el
Expand Up @@ -54,7 +54,7 @@ Should take one arg: the string to display."
(set-keymap-parent map helm-map)
(define-key map (kbd "<C-return>") 'helm-eval-new-line-and-indent)
(define-key map (kbd "<tab>") 'lisp-indent-line)
(define-key map (kbd "<C-tab>") 'lisp-complete-symbol)
(define-key map (kbd "<C-tab>") 'helm-lisp-completion-at-point)
(define-key map (kbd "C-p") 'previous-line)
(define-key map (kbd "C-n") 'next-line)
(define-key map (kbd "<up>") 'previous-line)
Expand Down Expand Up @@ -151,10 +151,9 @@ Should take one arg: the string to display."
"Preconfigured helm for `helm-source-evaluation-result' with `eldoc' support. "
(interactive)
(declare (special eldoc-idle-delay))
(let ((timer (run-with-idle-timer eldoc-idle-delay
'repeat 'helm-eldoc-show-in-eval))
(minibuffer-completing-symbol t) ; Enable lisp completion.
(completion-cycle-threshold t)) ; Always cycle, (emacs24* only).
(let ((timer (run-with-idle-timer
eldoc-idle-delay 'repeat
'helm-eldoc-show-in-eval)))
(unwind-protect
(minibuffer-with-setup-hook
'helm-eldoc-store-minibuffer
Expand Down

0 comments on commit 8e72c21

Please sign in to comment.