From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.bugs Subject: bug#50125: completion-in-region in shell.el Date: Thu, 19 Aug 2021 21:22:06 +0530 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2325"; mail-complaints-to="usenet@ciao.gmane.io" To: 50125@debbugs.gnu.org Cancel-Lock: sha1:aOWeRCNRw45EJaW2ucKhzOSQM5A= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 19 17:52:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGkKu-0000RR-Ny for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Aug 2021 17:52:08 +0200 Original-Received: from localhost ([::1]:48892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGkKt-00075a-Kn for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Aug 2021 11:52:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGkKo-00075S-9E for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 11:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49179) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGkKo-00013L-1k for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 11:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGkKo-0002M4-0J for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 11:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Madhu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Aug 2021 15:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50125 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16293883199042 (code B ref -1); Thu, 19 Aug 2021 15:52:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Aug 2021 15:51:59 +0000 Original-Received: from localhost ([127.0.0.1]:60725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGkKl-0002Lm-1a for submit@debbugs.gnu.org; Thu, 19 Aug 2021 11:51:59 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGkKj-0002Lf-Pi for submit@debbugs.gnu.org; Thu, 19 Aug 2021 11:51:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGkKj-00075L-Hn for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 11:51:57 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:51700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGkKh-0000wE-4O for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 11:51:57 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mGkKe-000Aar-MU for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 17:51:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212231 Archived-At: --=-=-= Content-Type: text/plain In a *shell* buffer, if I position the cursor after typing "pass" and invoke M-: (shell-dynamic-completion-command), this should yield a completion "passwd" if /bin is in exec-path. However it errors out with error: (wrong-number-of-arguments (3 . 4) 5) completion-in-region(484 486 #f(compiled-function (string pred action) #) :exit-function #f(compiled-function (string finished) #)) apply(completion-in-region (484 486 #f(compiled-function (string pred action) #) :exit-function #f(compiled-function (string finished) #))) shell-dynamic-complete-command() eval((shell-dynamic-complete-command) t) eval-expression((shell-dynamic-complete-command) nil nil 127) funcall-interactively(eval-expression (shell-dynamic-complete-command) nil nil 127) call-interactively(eval-expression nil nil) command-execute(eval-expression) The completion data functions shell-environment-variable-completion and shell-command-completion include an :exit-function keyword value pair in the result. But this cannot be passed on to completion-in-region. (How is this exit-function to be used at all?) Commit e71564921ec760638105c910fdfae8b648724130 fixed similar issues in comint.el, and probably missed shell.el during that pass * lisp/shell.el (shell-dynamic-complete-command) (shell-dynamic-complete-environment-variable): Correctly call completion-in-region. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=shell-dynamic-complete-fix.patch >From 913b77f13b5d2a7cb3e91d0c057ea3321740f845 Mon Sep 17 00:00:00 2001 From: Madhu Date: Thu, 19 Aug 2021 20:57:48 +0530 Subject: [PATCH] * lisp/shell.el (shell-dynamic-complete-command) (shell-dynamic-complete-environment-variable): Correctly call completion-in-region. --- lisp/shell.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/shell.el b/lisp/shell.el index 292f267d2e..5cdc0385a6 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -1199,7 +1199,7 @@ shell-dynamic-complete-command (if data (prog2 (unless (window-minibuffer-p) (message "Completing command name...")) - (apply #'completion-in-region data))))) + (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)))))) (defun shell-command-completion () "Return the completion data for the command at point, if any." @@ -1314,7 +1314,7 @@ shell-dynamic-complete-environment-variable (if data (prog2 (unless (window-minibuffer-p) (message "Completing variable name...")) - (apply #'completion-in-region data))))) + (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)))))) (defun shell-environment-variable-completion () -- 2.31.0 --=-=-=--