(flyspell-post-command-hook): Do nothing unless flyspell-mode is enabled.
[bpt/emacs.git] / lisp / complete.el
index f60763e..207b7f5 100644 (file)
@@ -1,7 +1,7 @@
 ;;; complete.el --- partial completion mechanism plus other goodies
 
 ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Keywords: abbrev convenience
@@ -290,7 +290,7 @@ See `PC-complete' for details.
 This can be bound to other keys, like `-' and `.', if you wish."
   (interactive)
   (if (eq (PC-was-meta-key) PC-meta-flag)
-      (if (eq last-command-char ? )
+      (if (eq last-command-event ? )
          (minibuffer-complete-word)
        (self-insert-command 1))
     (self-insert-command 1)
@@ -340,7 +340,7 @@ See `PC-complete' for details."
    ((eq minibuffer-completion-confirm 'confirm-after-completion)
     ;; Similar to the above, but only if trying to exit immediately
     ;; after typing TAB (this catches most minibuffer typos).
-    (if (and (memq last-command '(PC-complete minibuffer-complete))
+    (if (and (memq last-command minibuffer-confirm-exit-commands)
             (not (test-completion (field-string)
                                   minibuffer-completion-table
                                   minibuffer-completion-predicate)))
@@ -799,7 +799,8 @@ GOTO-END is non-nil, however, it instead replaces up to END."
                (if improved
 
                    ;; We changed it... would it be complete without the space?
-                   (if (test-completion (buffer-substring 1 (1- end))
+                   (if (test-completion (buffer-substring
+                                          (field-beginning) (1- end))
                                          table pred)
                        (delete-region (1- end) end)))