Browse files

Merge branch 'master' of

  • Loading branch information...
2 parents 30fbfcf + d44b6f1 commit 31d73967fc28f4764200307dc92e2d81fcd3ff6c Tomohiro Matsuyama committed Dec 2, 2012
Showing with 339 additions and 4 deletions.
  1. +2 −0
  2. +11 −4 auto-complete.el
  3. +313 −0 dict/verilog-mode
  4. +13 −0 tests/auto-complete-test.el
@@ -3,6 +3,8 @@ Auto Complete Mode
[![Build Status](](
+**FOR BEST RESULTS, USE AT LEAST EMACS REVISION 110135**. You'll need to build from source, at least until Emacs 24.3 is officially released. Earlier revisions contain a nasty bug that can cause your Emacs to segfault when using auto-complete.
@@ -195,7 +195,8 @@
makefile-mode sh-mode fortran-mode f90-mode ada-mode
xml-mode sgml-mode
- sclang-mode)
+ sclang-mode
+ verilog-mode)
"Major modes `auto-complete-mode' can run on."
:type '(repeat symbol)
:group 'auto-complete)
@@ -1148,7 +1149,10 @@ You can not use it in source definition like (prefix . `NAME')."
"Expand `STRING' into the buffer and update `ac-prefix' to `STRING'.
This function records deletion and insertion sequences by `undo-boundary'.
If `remove-undo-boundary' is non-nil, this function also removes `undo-boundary'
-that have been made before in this function."
+that have been made before in this function. When `buffer-undo-list' is
+`t', `remove-undo-boundary' has no effect."
+ (when (eq buffer-undo-list t)
+ (setq remove-undo-boundary nil))
(when (not (equal string (buffer-substring ac-point (point))))
;; We can't use primitive-undo since it undoes by
@@ -1738,8 +1742,11 @@ completion menu. This workaround stops that annoying behavior."
"Source definition macro. It defines a complete command also."
(declare (indent 1))
- (defvar ,(intern (format "ac-source-%s" name))
- ,source)
+ (defvar ,(intern (format "ac-source-%s" name)))
+ ;; Use `setq' to reset ac-source-NAME every time
+ ;; `ac-define-source' is called. This is useful, for example
+ ;; when evaluating `ac-define-source' using C-M-x (`eval-defun').
+ (setq ,(intern (format "ac-source-%s" name)) ,source)
(defun ,(intern (format "ac-complete-%s" name)) ()
(auto-complete '(,(intern (format "ac-source-%s" name)))))))
@@ -0,0 +1,313 @@
@@ -51,3 +51,16 @@
(should (popup-live-p ac-menu))
(should (equal (popup-list ac-menu) '("FooBar")))
+(ert-deftest ac-test-complete-common-part-when-buffer-undo-list-is-t ()
+ (ac-test-with-common-setup
+ (let ((ac-source-test
+ '((candidates list "Foo" "FooBar" "Bar" "Baz" "LongLongLine")))
+ (ac-sources '(ac-source-test)))
+ (execute-kbd-macro "Fo")
+ (let ((last-command this-command)
+ (buffer-undo-list t))
+ (auto-complete))
+ (ac-stop)
+ (should (string= (buffer-string) "Foo"))
+ )))

0 comments on commit 31d7396

Please sign in to comment.