zsh-users
 help / color / mirror / code / Atom feed
From: m0viefreak <m0viefreak.cm@googlemail.com>
To: zsh-users@zsh.org
Subject: Re: [PATCH] _git: auto-removable '..' suffix: remove at the end of lines
Date: Sun, 23 Mar 2014 04:41:29 +0100	[thread overview]
Message-ID: <532E57E9.7000807@googlemail.com> (raw)
In-Reply-To: <140322103747.ZM9034@torch.brasslantern.com>



On 22.03.2014 18:37, Bart Schaefer wrote:
> The presence or absence of \n in the -r string doesn't seem to make any
> difference for me.  The suffix is auto-removed on accept-line whether
> invoked as ctrl+m or ctrl+j or enter/return, with or without \n there.
> 
> And of course the \t only matters if you type ctrl+v tab, because in
> other cases complete-word is invoked and no character is inserted.

Right, I basically added them for completeness, because according to the
man page the default behavior (-q) includes them:

   Thus `-S "=" -q' is the same as `-S "=" -r "= \t\n\-"'.

Giving -q AND -r is superfluous, so I removed -q.

And there actually is use for \n: When entering multiple commands on
multiple lines (ALT+Return) without calling accept-line.

This way we get the default behavior, just as if only -q was given, PLUS
the additional . @ ~ ^ characters.


> Hmm.  However, here's something really strange.  Starting from zsh -f
> with compinit loaded and tab bound to complete-word ...
> 
> With the original code:
> 
>     compset -S '..*' || suf=( -qS .. -r '.@~ ^:' )
> 
> the trailing ".." is not boldfaced like an autoremovable suffix is by
> default, and indeed it is not removed upon accept-line, though it is
> auto-removed by e.g. a space.
> 
> With this:
> 
>     compset -S '..*' || suf=( -qS .. -r '.@~ ^:\-' )
> 
> (note that the only change is to add '\-' to the -r string), the ".." IS
> shown in boldface and is auto-removed by accept-line.
> 
> I have no idea why that would make a difference.

I noticed that too. The part that makes the boldface work seems to be
the '\-'.
Accoding to the man-page the only thing it does is

  `\-' stands for all characters that insert nothing.

which is exactly what is needed to make it work with accept-line, but I
can't see how this is related to the boldface.


  reply	other threads:[~2014-03-23  4:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14 21:42 Remove space added by completion zzapper
2014-02-14 22:11 ` Oliver Kiddle
2014-02-15  0:49   ` Aaron Schrab
2014-02-15  2:33     ` Bart Schaefer
2014-02-15  4:45       ` Aaron Schrab
2014-02-18 16:54         ` Oliver Kiddle
2014-02-20  1:33           ` Aaron Schrab
2014-03-22 14:10           ` m0viefreak
2014-03-22 16:43             ` [PATCH] _git: auto-removable '..' suffix: remove at the end of lines m0viefreak
2014-03-22 17:37               ` Bart Schaefer
2014-03-23  3:41                 ` m0viefreak [this message]
2014-03-23  6:45                   ` Bart Schaefer
2014-03-23 18:38                     ` [PATCH] zle/completion: fix auto-removable suffix highlighting m0viefreak
2014-02-15 12:45   ` Remove space added by completion zzapper
2014-02-20 10:05     ` Oliver Kiddle

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=532E57E9.7000807@googlemail.com \
    --to=m0viefreak.cm@googlemail.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).