zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@math.gatech.edu
Subject: Re: another bug in suffix removal 3.1.5
Date: Sat, 7 Nov 1998 10:32:11 -0800	[thread overview]
Message-ID: <981107103211.ZM7932@candle.brasslantern.com> (raw)
In-Reply-To: <199811060750.IAA04335@beta.informatik.hu-berlin.de>

On Nov 6,  8:50am, Sven Wischnowsky wrote:
} Subject: Re: another bug in suffix removal 3.1.5
}
} Peter Stephenson wrote:
} > 
} > Sven Wischnowsky wrote:
} > > greg@alphatech.com wrote:
} > > 
} > > > % bar <Control-a> <Control-k>   # IE, get "bar" in the kill ring
} > > > % ls f <tab>
} > > >   -> foo/ <Control-y>
} > > >   -> foobar                     # the slash got removed
} > > 
} > > another missing fixsuffix() problem.
} > 
} > Isn't it just a case of adding ZLE_KEEPSUFFIX to the flags for yank?
} 
} Personally I would prefer zsh to leave the suffix on the line and
} automatically removable in whenever a zle widget doesn't change the
} line and cursor position. But maybe I'm the only one who would prefer
} that.

Philosophical aside:

The 3.0.5 completion mechanism decides whether to autoremove almost
entirely based on what zle-command is next invoked.  3.1.5 is trying to
get away from that in order to make the widget set extensible, which is
why we have so many of these fixsuffix() problems.  ZLE_KEEPSUFFIX is
the standard escape back into the 3.0.5 style for widgets that haven't
been taught the new requirements yet, but it's a lot more reliable and
maintainable than sprinkling fixsuffix() around has been.

Back to the topic at hand:

This brings up a general question of what should happen on a widget
failure (either a feep, or when it simply can't do anything).  For
example,

zsh% mkdir /tmp/bar
zsh% ls /tmp/b<TAB>
zsh% ls /tmp/bar/<C-f>
zsh% ls /tmp/bar

Note that when I *tried* to move the cursor, the slash got removed,
even though the cursor couldn't actually move.  Similarly (with ^X^A
not bound to anything):

zsh% ls /tmp/b<TAB>
zsh% ls /tmp/bar/<C-xC-a>
(feep)
zsh% ls /tmp/bar

I think this argues (again) for some kind of return code from widget
functions (propagated via the standard "return" builtin for user-
defined widgets) so that they can notify the line editor when they do
nothing.  This could then be handled by zleread() in the same way that
not finding any binding at all is handled (except for the feep), which
we could then fix to match Sven's preference (which is a sensible one).

Until such time as all that has happened, I think PWS's fix is fine.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1998-11-07 18:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-06  7:50 Sven Wischnowsky
1998-11-07 18:32 ` Bart Schaefer [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-11-05 16:38 Sven Wischnowsky
1998-11-05 16:52 ` Peter Stephenson
1998-11-05 16:18 Greg Klanderman

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=981107103211.ZM7932@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@math.gatech.edu \
    /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).