zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: Re: delete-word does not delete the entire word...
Date: Sun, 12 Oct 2003 16:32:45 +0000	[thread overview]
Message-ID: <1031012163245.ZM19645@candle.brasslantern.com> (raw)
In-Reply-To: <20031012085732.GA22968@DervishD>

On Oct 12, 10:57am, DervishD wrote:
}
}  * 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.  It also doesn't clearly explain what it means to "kill" vs.
"delete" a part of the buffer.  That was OK when those parts of the
docs were written several years ago, but is not the best thing now.

Incidentally, a wrapper function to delete the word under the cursor
is a little tricky to write.  You can't just do

	zle backward-word
	zle delete-word

because if the cursor is on the very first letter this is equivalent
to backward-delete-word.  You either need to examine $LBUFFER[-1] to
determine if it is [not] a word boundary, or do something like

	local cursor=$CURSOR
	zle backward-word
	zle forward-word
	if ((cursor >= CURSOR))
	then
	    zle delete-word
	else
	    zle backward-delete-word
	fi


  reply	other threads:[~2003-10-12 16:33 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 [this message]
2003-10-12 17:05           ` DervishD
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=1031012163245.ZM19645@candle.brasslantern.com \
    --to=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).