zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: PATCH: remove work of art in _umount
Date: Sun, 14 Dec 2014 16:18:34 +0100	[thread overview]
Message-ID: <1418570314-26371-1-git-send-email-mikachu@gmail.com> (raw)

dpath_tmp could actually also have \040 in it, so also handle
that. (for example if you bindmount /tmp/foo\ bar to /tmp/foo\ foo,
both would). dev_tmp hopefully never will, but why not handle it anyway
(if it should even be completed at this point at all).

---

This doesn't in any way affect Silas' issue, but I spotted it while
looking at the completer.

---
 Completion/Unix/Command/_mount | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)

diff --git a/Completion/Unix/Command/_mount b/Completion/Unix/Command/_mount
index 0428222..a3b58bb 100644
--- a/Completion/Unix/Command/_mount
+++ b/Completion/Unix/Command/_mount
@@ -959,27 +959,9 @@ udevordir)
   esac
 
   local MATCH MBEGIN MEND
-  # "Mummy, why is mount point matching full of squiggles?"
-  #
-  # "Well, dear, the clever people who wrote Linux decided that some
-  # funny characters that might confuse programmes looking at the names
-  # would be encoded as octal escapes, like for example \040 for space.
-  # The clever people who wrote zsh decided that nothing would
-  # ever be quite as simple as it should be, so to substitute octal
-  # escapes everywhere in a string, even though the shell understands
-  # them natively in print escapes, needs some hackery where you match
-  # the octal number using the numeric closure syntax introduced after
-  # 4.3.4, then reinput the number in a standard math mode format as 8#OOO,
-  # and turn that into a character using the (#) parameter flag."
-  #
-  # "Mummy, why is nothing ever quite as simple as it should be?"
-  #
-  # "Well, dear, if it was then the clever people who write programmes would
-  # have been replaced by intelligent monkeys and then they'd be out
-  # of working roaming the streets, and we wouldn't want that, would we?"
-  mp_tmp=("${(@q)mp_tmp//(#m)\\[0-7](#c3)/${(#)$(( 8#${MATCH[2,-1]} ))}}")
-  dpath_tmp=( "${(@Mq)dev_tmp:#/*}" )
-  dev_tmp=( "${(@q)dev_tmp:#/*}" )
+  mp_tmp=("${(@qg::)mp_tmp}")
+  dpath_tmp=( "${(@Mqg::)dev_tmp:#/*}" )
+  dev_tmp=( "${(@qg::)dev_tmp:#/*}" )
 
   _alternative \
     'device-labels:device label:compadd -a dev_tmp' \
-- 
2.2.0.GIT


             reply	other threads:[~2014-12-14 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-14 15:18 Mikael Magnusson [this message]
2014-12-14 17:16 ` Ray Andrews
2014-12-14 18:44   ` Mikael Magnusson
2014-12-14 18:56     ` Bart Schaefer
2014-12-14 20:20       ` Ray Andrews
2014-12-14 20:07     ` Ray Andrews
2014-12-14 21:55       ` Mikael Magnusson

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=1418570314-26371-1-git-send-email-mikachu@gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).