emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104086: * lisp/simple.el (minibuffer


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104086: * lisp/simple.el (minibuffer-local-shell-command-map): Use completion-at-point.
Date: Mon, 02 May 2011 22:52:52 -0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104086
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2011-05-02 22:52:52 -0300
message:
  * lisp/simple.el (minibuffer-local-shell-command-map): Use 
completion-at-point.
  (minibuffer-complete-shell-command): Remove.
  (read-shell-command): Setup completion vars here instead.
  (read-expression-map): Bind TAB to symbol completion.
modified:
  lisp/ChangeLog
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-05-03 01:48:32 +0000
+++ b/lisp/ChangeLog    2011-05-03 01:52:52 +0000
@@ -1,5 +1,10 @@
 2011-05-03  Stefan Monnier  <address@hidden>
 
+       * simple.el (minibuffer-complete-shell-command): Remove.
+       (minibuffer-local-shell-command-map): Use completion-at-point.
+       (read-shell-command): Setup completion vars here instead.
+       (read-expression-map): Bind TAB to symbol completion.
+
        * textmodes/ispell.el (lookup-words): Use with-temp-buffer; signal
        error directly rather via storing it into `results'.
 

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2011-04-19 13:44:55 +0000
+++ b/lisp/simple.el    2011-05-03 01:52:52 +0000
@@ -1154,6 +1154,9 @@
 ;; Initialize read-expression-map.  It is defined at C level.
 (let ((m (make-sparse-keymap)))
   (define-key m "\M-\t" 'lisp-complete-symbol)
+  ;; Might as well bind TAB to completion, since inserting a TAB char is much
+  ;; too rarely useful.
+  (define-key m "\t" 'lisp-complete-symbol)
   (set-keymap-parent m minibuffer-local-map)
   (setq read-expression-map m))
 
@@ -2168,19 +2171,10 @@
 (defvar shell-file-name-chars)
 (defvar shell-file-name-quote-list)
 
-(defun minibuffer-complete-shell-command ()
-  "Dynamically complete shell command at point."
-  (interactive)
-  (require 'shell)
-  (let ((comint-delimiter-argument-list shell-delimiter-argument-list)
-       (comint-file-name-chars shell-file-name-chars)
-       (comint-file-name-quote-list shell-file-name-quote-list))
-    (run-hook-with-args-until-success 'shell-dynamic-complete-functions)))
-
 (defvar minibuffer-local-shell-command-map
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map minibuffer-local-map)
-    (define-key map "\t" 'minibuffer-complete-shell-command)
+    (define-key map "\t" 'completion-at-point)
     map)
   "Keymap used for completing shell commands in minibuffer.")
 
@@ -2189,8 +2183,18 @@
 The arguments are the same as the ones of `read-from-minibuffer',
 except READ and KEYMAP are missing and HIST defaults
 to `shell-command-history'."
+  (require 'shell)
   (minibuffer-with-setup-hook
       (lambda ()
+       (set (make-local-variable 'comint-delimiter-argument-list)
+            shell-delimiter-argument-list)
+       (set (make-local-variable 'comint-file-name-chars) 
shell-file-name-chars)
+       (set (make-local-variable 'comint-file-name-quote-list)
+            shell-file-name-quote-list)
+       (set (make-local-variable 'comint-dynamic-complete-functions)
+            shell-dynamic-complete-functions)
+       (add-hook 'completion-at-point-functions
+                 'comint-completion-at-point nil 'local)
        (set (make-local-variable 'minibuffer-default-add-function)
             'minibuffer-default-add-shell-commands))
     (apply 'read-from-minibuffer prompt initial-contents


reply via email to

[Prev in Thread] Current Thread [Next in Thread]