all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Johnson <tim@akwebsoft.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Copy whitespace-delimited text to variable
Date: Thu, 8 Mar 2018 07:15:48 -0900	[thread overview]
Message-ID: <20180308161548.GC12710@mail.akwebsoft.com> (raw)
In-Reply-To: <86zi3jqer1.fsf@zoho.com>

* Emanuel Berg <moasen@zoho.com> [180307 21:27]:
> Tim Johnson wrote:
> 
> > Example: in elpy
> > g.args (where cursor is at or following 's')
> > (current-word) would just return 'args', I need 'g.args'
> > and I don't wish to modify the syntax table.
> >
> > Before I roll my own, I'd rather not
> > re-invent the wheel...
> 
> Why not? To quote the barrel racer, just try -
> and you will fly :)
> 
> (defun previous-word ()
>   (interactive)
>   (save-excursion
>     (let((word-stop (progn (backward-word 1)
>                            (forward-word  1)
>                            (point) ))
>          (word-start (re-search-backward "[[:space:]]" (point-min) t)) )
>       (when word-start
>         (message
>          (string-trim
>           (buffer-substring-no-properties word-start word-stop) ))))))
  :) I'm ready to fly ... and have already been using subr-x
  thanks, Emanuel
-- 
Tim 
http://www.akwebsoft.com, http://www.tj49.com



  parent reply	other threads:[~2018-03-08 16:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.10256.1520462425.27995.help-gnu-emacs@gnu.org>
2018-03-08  6:10 ` Copy whitespace-delimited text to variable Emanuel Berg
2018-03-08  6:37   ` Emanuel Berg
2018-03-08 16:15   ` Tim Johnson [this message]
     [not found]   ` <mailman.10281.1520525754.27995.help-gnu-emacs@gnu.org>
2018-03-09  6:47     ` Emanuel Berg
2018-03-09 16:20       ` Tim Johnson
     [not found]       ` <mailman.10333.1520612428.27995.help-gnu-emacs@gnu.org>
2018-03-11  0:21         ` Emanuel Berg
2018-03-11 16:18           ` Tim Johnson
     [not found]           ` <mailman.10425.1520785140.27995.help-gnu-emacs@gnu.org>
2018-03-11 22:17             ` Emanuel Berg
2018-03-07 22:40 Tim Johnson

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=20180308161548.GC12710@mail.akwebsoft.com \
    --to=tim@akwebsoft.com \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.