From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2024 invoked from network); 12 Oct 2003 16:33:10 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Oct 2003 16:33:10 -0000 Received: (qmail 4492 invoked by alias); 12 Oct 2003 16:32:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6692 Received: (qmail 4446 invoked from network); 12 Oct 2003 16:32:47 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 12 Oct 2003 16:32:47 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.3.58.249] by sunsite.dk (MessageWall 1.0.8) with SMTP; 12 Oct 2003 16:32:47 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h9CGWjF19646 for zsh-users@sunsite.dk; Sun, 12 Oct 2003 09:32:45 -0700 From: Bart Schaefer Message-Id: <1031012163245.ZM19645@candle.brasslantern.com> Date: Sun, 12 Oct 2003 16:32:45 +0000 In-Reply-To: <20031012085732.GA22968@DervishD> Comments: In reply to DervishD "Re: delete-word does not delete the entire word..." (Oct 12, 10:57am) References: <20031011121052.GA5092@DervishD> <1031011173654.ZM13301@candle.brasslantern.com> <20031011195149.GA22610@DervishD> <1031011210014.ZM13588@candle.brasslantern.com> <20031012085732.GA22968@DervishD> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh Users Subject: Re: delete-word does not delete the entire word... MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 12, 10:57am, DervishD wrote: } } * Bart Schaefer 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