Commit 806f0cc7 authored by Leo Liu's avatar Leo Liu
Browse files

Fix broken completion in sh-mode

See: http://debbugs.gnu.org/12220
parent 3bb213b9
2012-08-27 Leo Liu <sdl.web@gmail.com> 2012-08-27 Leo Liu <sdl.web@gmail.com>
* progmodes/sh-script.el (sh-dynamic-complete-functions): Adapt to
completion-at-point. (Bug#12220)
* skeleton.el (skeleton-untabify): Change to nil (bug#12223). * skeleton.el (skeleton-untabify): Change to nil (bug#12223).
* progmodes/sh-script.el (sh-indent-comment): Change to t (bug#12267). * progmodes/sh-script.el (sh-indent-comment): Change to t (bug#12267).
......
...@@ -202,6 +202,11 @@ ...@@ -202,6 +202,11 @@
(require 'comint)) (require 'comint))
(require 'executable) (require 'executable)
(autoload 'comint-completion-at-point "comint")
(autoload 'comint-filename-completion "comint")
(autoload 'shell-command-completion "shell")
(autoload 'shell-environment-variable-completion "shell")
(defvar font-lock-comment-face) (defvar font-lock-comment-face)
(defvar font-lock-set-defaults) (defvar font-lock-set-defaults)
(defvar font-lock-string-face) (defvar font-lock-string-face)
...@@ -469,7 +474,6 @@ This is buffer-local in every such buffer.") ...@@ -469,7 +474,6 @@ This is buffer-local in every such buffer.")
(define-key map "`" 'skeleton-pair-insert-maybe) (define-key map "`" 'skeleton-pair-insert-maybe)
(define-key map "\"" 'skeleton-pair-insert-maybe) (define-key map "\"" 'skeleton-pair-insert-maybe)
(define-key map [remap complete-tag] 'comint-dynamic-complete)
(define-key map [remap delete-backward-char] (define-key map [remap delete-backward-char]
'backward-delete-char-untabify) 'backward-delete-char-untabify)
(define-key map "\C-c:" 'sh-set-shell) (define-key map "\C-c:" 'sh-set-shell)
...@@ -556,9 +560,9 @@ This is buffer-local in every such buffer.") ...@@ -556,9 +560,9 @@ This is buffer-local in every such buffer.")
"Value to use for `skeleton-pair-default-alist' in Shell-Script mode.") "Value to use for `skeleton-pair-default-alist' in Shell-Script mode.")
(defcustom sh-dynamic-complete-functions (defcustom sh-dynamic-complete-functions
'(shell-dynamic-complete-environment-variable '(shell-environment-variable-completion
shell-dynamic-complete-command shell-command-completion
comint-dynamic-complete-filename) comint-filename-completion)
"Functions for doing TAB dynamic completion." "Functions for doing TAB dynamic completion."
:type '(repeat function) :type '(repeat function)
:group 'sh-script) :group 'sh-script)
...@@ -1490,6 +1494,7 @@ with your script for an edit-interpret-debug cycle." ...@@ -1490,6 +1494,7 @@ with your script for an edit-interpret-debug cycle."
(set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table) (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table)
(set (make-local-variable 'comint-dynamic-complete-functions) (set (make-local-variable 'comint-dynamic-complete-functions)
sh-dynamic-complete-functions) sh-dynamic-complete-functions)
(add-hook 'completion-at-point-functions 'comint-completion-at-point nil t)
;; we can't look if previous line ended with `\' ;; we can't look if previous line ended with `\'
(set (make-local-variable 'comint-prompt-regexp) "^[ \t]*") (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*")
(set (make-local-variable 'imenu-case-fold-search) nil) (set (make-local-variable 'imenu-case-fold-search) nil)
...@@ -3682,20 +3687,6 @@ The document is bounded by `sh-here-document-word'." ...@@ -3682,20 +3687,6 @@ The document is bounded by `sh-here-document-word'."
;; various other commands ;; various other commands
(autoload 'comint-dynamic-complete "comint"
"Dynamically perform completion at point." t)
(autoload 'shell-dynamic-complete-command "shell"
"Dynamically complete the command at point." t)
(autoload 'comint-dynamic-complete-filename "comint"
"Dynamically complete the filename at point." t)
(autoload 'shell-dynamic-complete-environment-variable "shell"
"Dynamically complete the environment variable at point." t)
(defun sh-beginning-of-command () (defun sh-beginning-of-command ()
"Move point to successive beginnings of commands." "Move point to successive beginnings of commands."
(interactive) (interactive)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment