zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: brace in alias name and compsys
Date: Sun, 15 Dec 2013 11:52:36 -0800	[thread overview]
Message-ID: <131215115236.ZM20467@torch.brasslantern.com> (raw)
In-Reply-To: <20131215073603.GA97197@redoubt.spodhuis.org>

On Dec 15,  2:36am, Phil Pennock wrote:
}
} Given this:
} 
}     % alias ztrace{='() { setopt localoptions xtrace; '
} 
} However, tab-completing 'ztrace{' yields 'ztrace\{'.

This is coming directly from "compadd -k aliases" which in turn is
hardwired in the "defs" array in _command_names.

There's a similar problem with e.g. completing the builtin "!" "command".
It always gets turned into "\!" instead.

Can anyone think of a situation in which the following is wrong?

diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 24933c2..d9fc62d 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -27,11 +27,11 @@ else
   [[ "$1" = - ]] && shift
 
   defs=( "$defs[@]"
-    'builtins:builtin command:compadd -k builtins'
+    'builtins:builtin command:compadd -Qk builtins'
     "functions:shell function:compadd -k 'functions$ffilt'"
-    'aliases:alias:compadd -k aliases'
+    'aliases:alias:compadd -Qk aliases'
     'suffix-aliases:suffix alias:_suffix_alias_files'
-    'reserved-words:reserved word:compadd -k reswords'
+    'reserved-words:reserved word:compadd -Qk reswords'
     'jobs:: _jobs -t'
     'parameters:: _parameters -g "^*readonly*" -qS= -r "\n\t\- =["'
   )


While we're on the subject, completing after "[" or "[[" in command
position (no intervening whitespace) incorrectly attempts subscript
completion.  This appears to be a bug somewhere in the internals,
because compstate[context] has been set to 'subscript' and there's no
assignment to that in _complete_debug output.

Aside:  Zsh is unique, I think, in allowing alias names to contain
characters that are not legal in identifiers.


      reply	other threads:[~2013-12-15 19:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-15  7:36 Phil Pennock
2013-12-15 19:52 ` Bart Schaefer [this message]

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=131215115236.ZM20467@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).