emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104205: * lisp/shell.el (shell-compl


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104205: * lisp/shell.el (shell-completion-vars): New function.
Date: Thu, 12 May 2011 09:55:10 -0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104205
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2011-05-12 09:55:10 -0300
message:
  * lisp/shell.el (shell-completion-vars): New function.
  (shell-mode):
  * lisp/simple.el (read-shell-command): Use it.
  (blink-matching-open): No need for " [...]" in minibuffer-message.
modified:
  lisp/ChangeLog
  lisp/shell.el
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-05-12 07:56:02 +0000
+++ b/lisp/ChangeLog    2011-05-12 12:55:10 +0000
@@ -1,3 +1,10 @@
+2011-05-12  Stefan Monnier  <address@hidden>
+
+       * shell.el (shell-completion-vars): New function.
+       (shell-mode):
+       * simple.el (read-shell-command): Use it.
+       (blink-matching-open): No need for " [...]" in minibuffer-message.
+
 2011-05-12  Glenn Morris  <address@hidden>
 
        * calendar/appt.el (appt-now-displayed): Remove pointless variable.

=== modified file 'lisp/shell.el'
--- a/lisp/shell.el     2011-04-20 22:31:06 +0000
+++ b/lisp/shell.el     2011-05-12 12:55:10 +0000
@@ -380,6 +380,25 @@
   :group 'shell
   :type '(choice (const nil) regexp))
 
+(defun shell-completion-vars ()
+  "Setup completion vars for `shell-mode' and `read-shell-command'."
+  (set (make-local-variable 'comint-completion-fignore)
+       shell-completion-fignore)
+  (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)
+  (set (make-local-variable 'pcomplete-parse-arguments-function)
+       ;; FIXME: This function should be moved to shell.el.
+       #'pcomplete-parse-comint-arguments)
+  (setq comint-input-autoexpand shell-input-autoexpand)
+  ;; Not needed in shell-mode because it's inherited from comint-mode, but
+  ;; placed here for read-shell-command.
+  (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t))
+
 (put 'shell-mode 'mode-class 'special)
 
 (define-derived-mode shell-mode comint-mode "Shell"
@@ -437,22 +456,12 @@
 control whether input and output cause the window to scroll to the end of the
 buffer."
   (setq comint-prompt-regexp shell-prompt-pattern)
-  (setq comint-completion-fignore shell-completion-fignore)
-  (setq comint-delimiter-argument-list shell-delimiter-argument-list)
-  (setq comint-file-name-chars shell-file-name-chars)
-  (setq comint-file-name-quote-list shell-file-name-quote-list)
-  (set (make-local-variable 'comint-dynamic-complete-functions)
-       shell-dynamic-complete-functions)
+  (shell-completion-vars)
   (set (make-local-variable 'paragraph-separate) "\\'")
-  (make-local-variable 'paragraph-start)
-  (setq paragraph-start comint-prompt-regexp)
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(shell-font-lock-keywords t))
-  (make-local-variable 'shell-dirstack)
-  (setq shell-dirstack nil)
-  (make-local-variable 'shell-last-dir)
-  (setq shell-last-dir nil)
-  (setq comint-input-autoexpand shell-input-autoexpand)
+  (set (make-local-variable 'paragraph-start) comint-prompt-regexp)
+  (set (make-local-variable 'font-lock-defaults) '(shell-font-lock-keywords t))
+  (set (make-local-variable 'shell-dirstack) nil)
+  (set (make-local-variable 'shell-last-dir) nil)
   (shell-dirtrack-mode 1)
   ;; This is not really correct, since the shell buffer does not really
   ;; edit this directory.  But it is useful in the buffer list and menus.

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2011-05-06 01:02:49 +0000
+++ b/lisp/simple.el    2011-05-12 12:55:10 +0000
@@ -36,10 +36,6 @@
 ;;; From compile.el
 (defvar compilation-current-error)
 (defvar compilation-context-lines)
-;;; From comint.el
-(defvar comint-file-name-quote-list)
-(defvar comint-file-name-chars)
-(defvar comint-delimiter-argument-list)
 
 (defcustom idle-update-delay 0.5
   "Idle time delay before updating various things on the screen.
@@ -2167,12 +2163,7 @@
        (append minibuffer-default commands)
       (cons minibuffer-default commands))))
 
-(defvar shell-delimiter-argument-list)
-(defvar shell-file-name-chars)
-(defvar shell-file-name-quote-list)
-(defvar shell-dynamic-complete-functions)
-;; shell requires comint.
-(defvar comint-dynamic-complete-functions)
+(declare-function shell-completion-vars "shell" ())
 
 (defvar minibuffer-local-shell-command-map
   (let ((map (make-sparse-keymap)))
@@ -2189,15 +2180,7 @@
   (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)
+        (shell-completion-vars)
        (set (make-local-variable 'minibuffer-default-add-function)
             'minibuffer-default-add-shell-commands))
     (apply 'read-from-minibuffer prompt initial-contents
@@ -5589,10 +5572,10 @@
        (mismatch
         (if blinkpos
             (if (minibufferp)
-                (minibuffer-message " [Mismatched parentheses]")
+                (minibuffer-message "Mismatched parentheses")
               (message "Mismatched parentheses"))
           (if (minibufferp)
-              (minibuffer-message " [Unmatched parenthesis]")
+              (minibuffer-message "Unmatched parenthesis")
             (message "Unmatched parenthesis"))))
        ((not blinkpos) nil)
        ((pos-visible-in-window-p blinkpos)


reply via email to

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