Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make completions by trigger key ignore stop words

  • Loading branch information...
commit 455040ab68251747108f55cfee3b79a94d96bddd 1 parent 917bf0e
Tomohiro Matsuyama authored
Showing with 10 additions and 7 deletions.
  1. +10 −7 auto-complete.el
View
17 auto-complete.el
@@ -1381,10 +1381,7 @@ that have been made before in this function."
;;;; Auto completion commands
-;;;###autoload
-(defun auto-complete (&optional sources)
- "Start auto-completion at current point."
- (interactive)
+(defun* auto-complete-1 (&key sources (triggered 'command))
(let ((menu-live (ac-menu-live-p))
(inline-live (ac-inline-live-p)))
(ac-abort)
@@ -1392,7 +1389,7 @@ that have been made before in this function."
(if (or ac-show-menu-immediately-on-auto-complete
inline-live)
(setq ac-show-menu t))
- (ac-start :triggered 'manual))
+ (ac-start :triggered triggered))
(when (ac-update-greedy t)
;; TODO Not to cause inline completion to be disrupted.
(if (ac-inline-live-p)
@@ -1407,6 +1404,12 @@ that have been made before in this function."
(null ac-candidates))
(ac-fuzzy-complete)))))
+;;;###autoload
+(defun auto-complete (&optional sources)
+ "Start auto-completion at current point."
+ (interactive)
+ (auto-complete-1 :sources sources))
+
(defun ac-fuzzy-complete ()
"Start fuzzy completion at current point."
(interactive)
@@ -1513,7 +1516,7 @@ that have been made before in this function."
(if (or (null point)
(progn
(setq prefix (buffer-substring-no-properties point (point)))
- (and (not (eq triggered 'manual))
+ (and (not (eq triggered 'command))
(ac-stop-word-p prefix))))
(prog1 nil
(ac-abort))
@@ -1560,7 +1563,7 @@ that have been made before in this function."
(defun ac-trigger-key-command (&optional force)
(interactive "P")
(if (or force (ac-trigger-command-p last-command))
- (auto-complete)
+ (auto-complete-1 :triggered 'trigger-key)
(ac-fallback-command 'ac-trigger-key-command)))
Please sign in to comment.
Something went wrong with that request. Please try again.