From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "David Lam" Newsgroups: gmane.emacs.help Subject: Re: anyone got a function for backward-to-end-of-word?? ('ge' in vim) Date: Mon, 10 Nov 2008 18:37:45 -0800 Message-ID: <4f6ab4670811101837j2681f148le38cfa000fcd6c8b@mail.gmail.com> References: <4f6ab4670811101420o71958b75idb865b957d6964cb@mail.gmail.com> <1264D6F8-0EFD-4B13-A120-A86DFC8375D1@Web.DE> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_44214_8561534.1226371065522" X-Trace: ger.gmane.org 1226371106 23209 80.91.229.12 (11 Nov 2008 02:38:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Nov 2008 02:38:26 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Peter Dyballa" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 11 03:39:27 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KzjA6-00005L-6C for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Nov 2008 03:39:27 +0100 Original-Received: from localhost ([127.0.0.1]:43690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kzj8x-0001Df-MJ for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Nov 2008 21:38:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kzj8a-0001DK-Ka for help-gnu-emacs@gnu.org; Mon, 10 Nov 2008 21:37:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kzj8W-0001Ci-OL for help-gnu-emacs@gnu.org; Mon, 10 Nov 2008 21:37:52 -0500 Original-Received: from [199.232.76.173] (port=50939 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kzj8W-0001Cf-Li for help-gnu-emacs@gnu.org; Mon, 10 Nov 2008 21:37:48 -0500 Original-Received: from an-out-0708.google.com ([209.85.132.244]:19765) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kzj8V-00046P-PB for help-gnu-emacs@gnu.org; Mon, 10 Nov 2008 21:37:48 -0500 Original-Received: by an-out-0708.google.com with SMTP id c38so505249ana.21 for ; Mon, 10 Nov 2008 18:37:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=rAT+tKdBKcDHxWtDivMblAcJAtY8plNzTnZoXt6O9zg=; b=OAHniVH4zqUZ7sqk/4z5p62sYi/cbGjp7HI2Kvt2iVVSzM+/sD23WM/Wy5IquHQRqS buPeVdFmmJa+cO5mIRulv7h7BPkLi8cVNCqy5KpcNQPcO7GUkmBCAIk8Ue4Vh50u4MUL rYIXfBGtG1lSCSd7fiJxQEBZGMV90dGuqr7cg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=Iq8H7YEllUfjn9VHZptac3YPW+jESSUx/MKt2Z7HR6Z4Mxv4yZINXN98Y4mnvngZqn ihEB51XmVwZpCbjEvlT8F2u7e3mMDjqtaryyJPZa7ipo60AvNixt/y2Tdtn/3SMO9EI8 IA3FfWi5YVwEfYuGEnceTnxCdrnZQ80TZvRe4= Original-Received: by 10.100.242.20 with SMTP id p20mr2556835anh.75.1226371065562; Mon, 10 Nov 2008 18:37:45 -0800 (PST) Original-Received: by 10.100.250.18 with HTTP; Mon, 10 Nov 2008 18:37:45 -0800 (PST) In-Reply-To: <1264D6F8-0EFD-4B13-A120-A86DFC8375D1@Web.DE> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59639 Archived-At: ------=_Part_44214_8561534.1226371065522 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline hey cool thanks, i took ians function and modified it a little ... this seems to work okay i think... ;; 32 = ASCII (defun prev-word-end-three (&optional arg) (interactive "p") (let ((arg (or arg 1))) (cond ((= (preceding-char) 32) (progn (backward-word (+ arg)) (forward-word))) ;; bw fw (t (progn (backward-word (+ 1 arg)) (forward-word))) ;; bw bw fw ) );; let );;defun (global-set-key "\C-x\M-b" 'prev-word-end-three) (global-set-key "\M-B" 'prev-word-end-three) On Mon, Nov 10, 2008 at 3:11 PM, Peter Dyballa wrote: > > Am 10.11.2008 um 23:20 schrieb David Lam: > > So for example if you had... >> >> 'fooz bar' >> >> ...with the cursor anywhere within 'bar', pressing ge in vi immediatley >> positions the cursor at the 'z' !!!1 >> > > > You could create one! Comprised of backward-word, backward-word, > forward-word, delete-backward-char ... And bind it to some key. > > -- > Greetings > > Pete > > We have to expect it, otherwise we would be surprised. > > > > ------=_Part_44214_8561534.1226371065522 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline hey cool thanks, i took ians function and modified it a little ... this seems to work okay i think... 

;; 32 = ASCII <space>
(defun prev-word-end-three (&optional arg)
 (interactive "p")
 (let ((arg (or arg 1)))
   (cond
    ((= (preceding-char) 32)  (progn (backward-word (+ arg)) (forward-word))) ;; bw fw
    (t  (progn (backward-word (+ 1 arg)) (forward-word)))                     ;; bw bw fw
    )                             
 );; let
);;defun

 (global-set-key "\C-x\M-b" 'prev-word-end-three)
 (global-set-key "\M-B" 'prev-word-end-three)


On Mon, Nov 10, 2008 at 3:11 PM, Peter Dyballa <Peter_Dyballa@web.de> wrote:

Am 10.11.2008 um 23:20 schrieb David Lam:


So for example if you had...

     'fooz bar'

...with the cursor anywhere within 'bar', pressing ge in vi immediatley
positions the cursor at the 'z' !!!1


You could create one! Comprised of backward-word, backward-word, forward-word, delete-backward-char ... And bind it to some key.

--
Greetings

 Pete

We have to expect it, otherwise we would be surprised.




------=_Part_44214_8561534.1226371065522--