aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2012-08-27 20:33:05 +0800
committerLeo Liu2012-08-27 20:33:05 +0800
commit806f0cc7302bd1dacfad8366f67a97e9bfbc8fc9 (patch)
tree0ee133c6911fcd97bd3bc3bfa6b33e870a2f77d4
parent3bb213b9fcf46b0e1f97cf830c1a9e2b62c566e7 (diff)
downloademacs-806f0cc7302bd1dacfad8366f67a97e9bfbc8fc9.tar.gz
emacs-806f0cc7302bd1dacfad8366f67a97e9bfbc8fc9.zip
Fix broken completion in sh-mode
See: http://debbugs.gnu.org/12220
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/progmodes/sh-script.el27
2 files changed, 12 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 456eca53a82..4ef437213a0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12012-08-27 Leo Liu <sdl.web@gmail.com> 12012-08-27 Leo Liu <sdl.web@gmail.com>
2 2
3 * progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to
4 completion-at-point. (Bug#12220)
5
3 * skeleton.el (skeleton-untabify): Change to nil (bug#12223). 6 * skeleton.el (skeleton-untabify): Change to nil (bug#12223).
4 7
5 * progmodes/sh-script.el (sh-indent-comment): Change to t (bug#12267). 8 * progmodes/sh-script.el (sh-indent-comment): Change to t (bug#12267).
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 90f9ce3a52f..2d0cdeaeeae 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -202,6 +202,11 @@
202 (require 'comint)) 202 (require 'comint))
203(require 'executable) 203(require 'executable)
204 204
205(autoload 'comint-completion-at-point "comint")
206(autoload 'comint-filename-completion "comint")
207(autoload 'shell-command-completion "shell")
208(autoload 'shell-environment-variable-completion "shell")
209
205(defvar font-lock-comment-face) 210(defvar font-lock-comment-face)
206(defvar font-lock-set-defaults) 211(defvar font-lock-set-defaults)
207(defvar font-lock-string-face) 212(defvar font-lock-string-face)
@@ -469,7 +474,6 @@ This is buffer-local in every such buffer.")
469 (define-key map "`" 'skeleton-pair-insert-maybe) 474 (define-key map "`" 'skeleton-pair-insert-maybe)
470 (define-key map "\"" 'skeleton-pair-insert-maybe) 475 (define-key map "\"" 'skeleton-pair-insert-maybe)
471 476
472 (define-key map [remap complete-tag] 'comint-dynamic-complete)
473 (define-key map [remap delete-backward-char] 477 (define-key map [remap delete-backward-char]
474 'backward-delete-char-untabify) 478 'backward-delete-char-untabify)
475 (define-key map "\C-c:" 'sh-set-shell) 479 (define-key map "\C-c:" 'sh-set-shell)
@@ -556,9 +560,9 @@ This is buffer-local in every such buffer.")
556 "Value to use for `skeleton-pair-default-alist' in Shell-Script mode.") 560 "Value to use for `skeleton-pair-default-alist' in Shell-Script mode.")
557 561
558(defcustom sh-dynamic-complete-functions 562(defcustom sh-dynamic-complete-functions
559 '(shell-dynamic-complete-environment-variable 563 '(shell-environment-variable-completion
560 shell-dynamic-complete-command 564 shell-command-completion
561 comint-dynamic-complete-filename) 565 comint-filename-completion)
562 "Functions for doing TAB dynamic completion." 566 "Functions for doing TAB dynamic completion."
563 :type '(repeat function) 567 :type '(repeat function)
564 :group 'sh-script) 568 :group 'sh-script)
@@ -1490,6 +1494,7 @@ with your script for an edit-interpret-debug cycle."
1490 (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table) 1494 (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table)
1491 (set (make-local-variable 'comint-dynamic-complete-functions) 1495 (set (make-local-variable 'comint-dynamic-complete-functions)
1492 sh-dynamic-complete-functions) 1496 sh-dynamic-complete-functions)
1497 (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t)
1493 ;; we can't look if previous line ended with `\' 1498 ;; we can't look if previous line ended with `\'
1494 (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*") 1499 (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*")
1495 (set (make-local-variable 'imenu-case-fold-search) nil) 1500 (set (make-local-variable 'imenu-case-fold-search) nil)
@@ -3682,20 +3687,6 @@ The document is bounded by `sh-here-document-word'."
3682 3687
3683;; various other commands 3688;; various other commands
3684 3689
3685(autoload 'comint-dynamic-complete "comint"
3686 "Dynamically perform completion at point." t)
3687
3688(autoload 'shell-dynamic-complete-command "shell"
3689 "Dynamically complete the command at point." t)
3690
3691(autoload 'comint-dynamic-complete-filename "comint"
3692 "Dynamically complete the filename at point." t)
3693
3694(autoload 'shell-dynamic-complete-environment-variable "shell"
3695 "Dynamically complete the environment variable at point." t)
3696
3697
3698
3699(defun sh-beginning-of-command () 3690(defun sh-beginning-of-command ()
3700 "Move point to successive beginnings of commands." 3691 "Move point to successive beginnings of commands."
3701 (interactive) 3692 (interactive)