zsh-users
 help / color / mirror / code / Atom feed
From: DervishD <raul@pleyades.net>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@sunsite.dk>
Subject: Re: delete-word does not delete the entire word...
Date: Sun, 12 Oct 2003 19:05:56 +0200	[thread overview]
Message-ID: <20031012170556.GG23106@DervishD> (raw)
In-Reply-To: <1031012163245.ZM19645@candle.brasslantern.com>

    Hi Bart :)

 * Bart Schaefer <schaefer@brasslantern.com> dixit:
> } > What you're missing is that the documentation nearly always is
> } > expressed in terms of character positions, not semantic buffer
> } > contents.
> } [Zsh doc] doesn't say explicitly (I think, I haven't read the entire
> } documentation) that a word is not a semantic entity but just the
> } buffer contents from the cursor position to the next word boundary.
> You're right, it doesn't. Most of the functions emulate behavior of
> emacs or vi, so the doc assumes the reader is familiar with one of
> those.

    I assume that, at the moment of writing, 99% of UNIX users used
vi or emacs (or both...), so this behaviour was the expected
behaviour. In fact, since I haven't used word commands, this
behaviour is good for me, I can live with it, without writing
wrappers, and I should live with it, since my editor does exactly the
same, and it's very comfortable to have the same keybindings in the
shell and the editor (at least for me, I spend most of my time coding
or doing things in the shell). The problem, IMHO, is not the
behaviour, is the documentation, that should be more precise.

> That was OK when those parts of the docs were written several years
> ago, but is not the best thing now.

    And updating the documentation is several times harder than
updating the code, I have that problem when coding ;)) Anyway, zsh
docs are pretty good on the average. I like them ;)

> Incidentally, a wrapper function to delete the word under the cursor
> is a little tricky to write.

    Writing zle widgets is tricky. I've written a couple of them
lately, just for learning, and it has been a bit tricky. I've written
wrappers for up-line-or-search and down-line-or-search which searchs
$LBUFFER, not the first word. Like up/down-line-or-beginning-search,
that comes with zsh 4.1.x, but without bells and whistles: no NUMERIC
support, no zstyles, and an easy handling of PREBUFFER.

    I have a problem with it, not easy to solve since it has to do
with carrying information from the current execution of the widget to
the next execution of the widget, etc...

> You either need to examine $LBUFFER[-1] to
> determine if it is [not] a word boundary

    But that means dealing with WORDCHARS. I prefer your suggestion
of doing a double movement and testing where the cursor is
afterwards. BTW, thanks ;)))

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


  reply	other threads:[~2003-10-12 17:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-11 12:10 DervishD
2003-10-11 17:36 ` Bart Schaefer
2003-10-11 19:51   ` DervishD
2003-10-11 21:00     ` Bart Schaefer
2003-10-12  8:57       ` DervishD
2003-10-12 16:32         ` Bart Schaefer
2003-10-12 17:05           ` DervishD [this message]
2003-10-12 18:31             ` Peter Stephenson
2003-10-12 20:12               ` Bart Schaefer
2003-10-13 10:04                 ` Peter Stephenson
2003-10-13  9:09               ` DervishD

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=20031012170556.GG23106@DervishD \
    --to=raul@pleyades.net \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /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).