GNU bug report logs -
#50125
completion-in-region in shell.el
Previous Next
Reported by: Madhu <enometh <at> meer.net>
Date: Thu, 19 Aug 2021 15:52:01 UTC
Severity: normal
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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) #<bytecode -0x6e453bfcd314ab>) :exit-function #f(compiled-function (string finished) #<bytecode -0x9a98b1a3de78800>))
apply(completion-in-region (484 486 #f(compiled-function (string pred action) #<bytecode -0x6e453bfcd314ab>) :exit-function #f(compiled-function (string finished) #<bytecode -0x9a98b1a3de78800>)))
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.
[shell-dynamic-complete-fix.patch (text/x-diff, inline)]
From 913b77f13b5d2a7cb3e91d0c057ea3321740f845 Mon Sep 17 00:00:00 2001
From: Madhu <enometh <at> net.meer>
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
This bug report was last modified 3 years and 278 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.