GNU bug report logs - #12220
24.2; [PATCH] completion completely broken in sh-script

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Fri, 17 Aug 2012 19:41:02 UTC

Severity: normal

Tags: patch

Found in version 24.2

Done: Leo <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Leo <sdl.web <at> gmail.com>
Subject: bug#12220: closed (Re: bug#12220: 24.2; [PATCH] completion
 completely broken in sh-script)
Date: Mon, 27 Aug 2012 12:38:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#12220: 24.2; [PATCH] completion completely broken in sh-script

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 12220 <at> debbugs.gnu.org.

-- 
12220: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12220
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Leo <sdl.web <at> gmail.com>
To: 12220-done <at> debbugs.gnu.org
Subject: Re: bug#12220: 24.2; [PATCH] completion completely broken in sh-script
Date: Mon, 27 Aug 2012 20:36:26 +0800
Fixed in emacs-24

[Message part 3 (message/rfc822, inline)]
From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; [PATCH] completion completely broken in sh-script
Date: Sat, 18 Aug 2012 03:31:18 +0800
[Message part 4 (text/plain, inline)]
As suggested by the subject. The bug is caused by blindly aliasing
comint-dynamic-complete to completion-at-point.

[0001-Fix-broken-completion-in-sh-script.patch (text/x-patch, inline)]
From a986b6d40ccd76e7576cf4de678372c5bdd1713d Mon Sep 17 00:00:00 2001
From: Leo Liu <sdl.web <at> 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)
 
 ;; 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)


This bug report was last modified 12 years and 266 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.