0

As this answer explains, the Dired function dired-copy-filename-as-kill (0 w) lets one add the path of the file at point to the kill ring. However, I would like to use this path on Eshell, where characters such as SPC need to be escaped. Is there a way to copy the path to the kill ring with the relevant characters escaped, or to transform a previous kill so as to escape these characters?

Pablo
  • 3
  • 2

1 Answers1

0

You're probably looking for C-hf eshell-quote-argument.

phils
  • 71,335
  • 11
  • 153
  • 198
  • Thanks, this expands on @Ynjxsjmh's comment above. I see that one can customize the variable ```eshell-special-chars-outside-quoting``` to set the characters that need escaping. – Pablo Mar 13 '21 at 13:09
  • `(mapcar #'char-to-string eshell-special-chars-outside-quoting)` if you want to see that list in a friendlier format. – phils Mar 13 '21 at 13:19