(shell-mode-map): Inherit comint-mode-map, but copy the completion menu.
[bpt/emacs.git] / lisp / completion.el
index 183a39f..8964556 100644 (file)
@@ -2212,7 +2212,7 @@ If file name is not specified, use `save-completions-file-name'."
        (initialize-completions));; make sure everything's loaded
     (message "Saving completions to file %s" filename)
 
-    (let* ((trim-versions-without-asking t)
+    (let* ((delete-old-versions t)
           (kept-old-versions 0)
           (kept-new-versions completions-file-versions-kept)
           last-use-time
@@ -2540,9 +2540,10 @@ TYPE is the type of the wrapper to be added.  Can be :before or :under."
       (cmpl-statistics-block (record-complete-failed))))
 
 (defun completion-before-command ()
-  (funcall (or (get this-command 'completion-function)
+  (funcall (or (and (symbolp this-command)
+                   (get this-command 'completion-function))
               'use-completion-under-or-before-point)))
-(add-hook 'before-command-hook 'completion-before-command)
+(add-hook 'pre-command-hook 'completion-before-command)
 
 
 ;;;---------------------------------------------------------------------------