* bug#12220: 24.2; [PATCH] completion completely broken in sh-script
@ 2012-08-17 19:31 Leo
2012-08-27 12:36 ` Leo
0 siblings, 1 reply; 2+ messages in thread
From: Leo @ 2012-08-17 19:31 UTC (permalink / raw
To: 12220
[-- Attachment #1: Type: text/plain, Size: 116 bytes --]
As suggested by the subject. The bug is caused by blindly aliasing
comint-dynamic-complete to completion-at-point.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-broken-completion-in-sh-script.patch --]
[-- Type: text/x-patch, Size: 2927 bytes --]
From a986b6d40ccd76e7576cf4de678372c5bdd1713d Mon Sep 17 00:00:00 2001
From: Leo Liu <sdl.web@gmail.com>
Date: Sat, 18 Aug 2012 02:48:15 +0800
Subject: [PATCH] Fix broken completion in sh-script
---
lisp/progmodes/sh-script.el | 27 +++++++++------------------
1 file changed, 9 insertions(+), 18 deletions(-)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 7d38df6a..f0dec93f 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -202,6 +202,11 @@ (eval-when-compile
(require 'comint))
(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-set-defaults)
(defvar font-lock-string-face)
@@ -469,7 +474,6 @@ (defvar sh-mode-map
(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]
'backward-delete-char-untabify)
(define-key map "\C-c:" 'sh-set-shell)
@@ -556,9 +560,9 @@ (defvar sh-skeleton-pair-default-alist '((?( _ ?)) (?\))
"Value to use for `skeleton-pair-default-alist' in Shell-Script mode.")
(defcustom sh-dynamic-complete-functions
- '(shell-dynamic-complete-environment-variable
- shell-dynamic-complete-command
- comint-dynamic-complete-filename)
+ '(shell-environment-variable-completion
+ shell-command-completion
+ comint-filename-completion)
"Functions for doing TAB dynamic completion."
:type '(repeat function)
:group 'sh-script)
@@ -1489,6 +1493,7 @@ (define-derived-mode sh-mode prog-mode "Shell-script"
(set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table)
(set (make-local-variable 'comint-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 `\'
(set (make-local-variable 'comint-prompt-regexp) "^[ \t]*")
(set (make-local-variable 'imenu-case-fold-search) nil)
@@ -3681,20 +3686,6 @@ (defun sh-maybe-here-document (arg)
\f
;; 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 ()
"Move point to successive beginnings of commands."
(interactive)
--
1.7.9.6 (Apple Git-31.1)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#12220: 24.2; [PATCH] completion completely broken in sh-script
2012-08-17 19:31 bug#12220: 24.2; [PATCH] completion completely broken in sh-script Leo
@ 2012-08-27 12:36 ` Leo
0 siblings, 0 replies; 2+ messages in thread
From: Leo @ 2012-08-27 12:36 UTC (permalink / raw
To: 12220-done
Fixed in emacs-24
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-27 12:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17 19:31 bug#12220: 24.2; [PATCH] completion completely broken in sh-script Leo
2012-08-27 12:36 ` Leo
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.