bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53911: 29.0.50; shell-mode: completion doesn't work at first element


From: Dima Kogan
Subject: bug#53911: 29.0.50; shell-mode: completion doesn't work at first element of a continued line
Date: Wed, 09 Feb 2022 21:36:40 -0800

Hi. I see this:

1. emacs -Q

2. M-x shell

3. type "ls \" then C-q j then "/tm"

At this point the buffer should look like

============
user@host:~$ ls \
/tm
============

with the point at the end

4. TAB

On this machine /tmp exists, so when I hit TAB I expect emacs to
autocomplete /tmp, but it doesn't work. Because it thinks the \ + \n is
part of the filename being completed. A patch to fix it:




diff --git a/lisp/comint.el b/lisp/comint.el
index 3decb80ff0b..d5dbfc6bf9d 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -3191,8 +3193,8 @@ comint-word
       (while (not giveup)
        (let ((startpoint (point)))
          (skip-chars-backward (concat "\\\\" word-chars))
-         (if (and comint-file-name-quote-list
-                  (eq (char-before (1- (point))) ?\\))
+         (if (and (eq (char-before (1- (point))) ?\\)
+                   (memq (char-before) comint-file-name-quote-list))
              (forward-char -2))
          ;; FIXME: This isn't consistent with Bash, at least -- not
          ;; all non-ASCII chars should be word constituents.



We were checking for comint-file-name-quote-list existing, but not
actually comparing to the characters in that list. This patch actually
checks the contents of comint-file-name-quote-list.

Thanks





reply via email to

[Prev in Thread] Current Thread [Next in Thread]