all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Noam Postavsky <npostavs@gmail.com>
Cc: xristos <xristos@sdf.lonestar.org>, xristos <xristos@sdf.org>,
	28096@debbugs.gnu.org, Eric Skoglund <eric@pagefault.se>
Subject: bug#28096: 25.2; c-a-p/shell/ielm: Broken directory completion for directories that contain spaces
Date: Wed, 30 May 2018 13:13:02 +0100	[thread overview]
Message-ID: <87y3g1qr3l.fsf@tcd.ie> (raw)
In-Reply-To: <87y3g1best.fsf@gmail.com> (Noam Postavsky's message of "Wed, 30 May 2018 06:47:46 -0400")

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

Noam Postavsky <npostavs@gmail.com> writes:

> One minor question, what does the "C-a-k" mean
> in your original report?

I think Xristos meant C-a C-k.

The only thing needed to make ielm file name completion work on my
system (see signature for its details) is to add ?\s to
comint-file-name-chars, e.g.:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ielm.diff --]
[-- Type: text/x-diff, Size: 608 bytes --]

diff --git a/lisp/ielm.el b/lisp/ielm.el
index b4ad69e4c7..4bb6e752e8 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -546,6 +546,8 @@ inferior-emacs-lisp-mode
   (set (make-local-variable 'paragraph-start) comint-prompt-regexp)
   (setq comint-input-sender 'ielm-input-sender)
   (setq comint-process-echoes nil)
+  (unless (string-match-p " " comint-file-name-chars)
+    (setq comint-file-name-chars (concat " " comint-file-name-chars)))
   (set (make-local-variable 'completion-at-point-functions)
        '(comint-replace-by-expanded-history
          ielm-complete-filename elisp-completion-at-point))

[-- Attachment #3: Type: text/plain, Size: 1446 bytes --]


As for shell, file name completion only seems to breaks down for me when
completing a relative file name argument to the cd command in
particular:

0. emacs -Q
1. M-x shell RET
2. cd /tmp/
   [shell doesn't seem to support dynamic cd arguments such as
    "$(mktemp -d)".]
3. mkdir dir\ one dir\ two RET
4. cd /tmp/dir TAB
   [Completes to "/tmp/dir\ ".]
5. TAB
   [Offers "dir\ one/" and "dir\ two/" as completion candidates.]
6. o TAB
   [Completes to "/tmp/dir\ one/".]

Replacing cd with ls (or pretty much any other string, let alone valid
command) in step 4 exhibits the same correct behaviour.  Doing so in
OP's recipe (which tries to complete relative file names), however, does
not seem to struggle in the same way as cd completion:

Steps 0-3 as before.
4. ls dir TAB
   [Completes to "dir\ ".]
5. TAB
   [Offers "dir\ one/" and "dir\ two/" as completion candidates.]
5. o TAB
   [Completes to "/tmp/dir\ one/".]

I'm not familiar with the workings of shell, but it seems like it's
trying to be smart about cd completion and falling a bit short.

-- 
Basil

In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-05-27 built on thunk
Repository revision: 0f48d18fd2a30f29cc3592a835d2a2254c9b0afb
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Debian GNU/Linux buster/sid

"${SHELL}" --version
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)

  reply	other threads:[~2018-05-30 12:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15 12:42 bug#28096: 25.2; c-a-p/shell/ielm: Broken directory completion for directories that contain spaces xristos
2018-04-02  8:37 ` Eric Skoglund
2018-05-30  0:08   ` xristos
2018-05-30 10:47     ` Noam Postavsky
2018-05-30 12:13       ` Basil L. Contovounesios [this message]
2018-05-30 13:44         ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y3g1qr3l.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=28096@debbugs.gnu.org \
    --cc=eric@pagefault.se \
    --cc=npostavs@gmail.com \
    --cc=xristos@sdf.lonestar.org \
    --cc=xristos@sdf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.