help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Select Text Inside Parentheses


From: Esben Stien
Subject: Re: Select Text Inside Parentheses
Date: Sun, 02 Sep 2012 15:17:39 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

"Drew Adams" <drew.adams@oracle.com> writes:

> I showed it correctly (\\s-, not \s-) in the detailed rundown
> that followed.

Right, this is what I do: 

       (defun everything-of-interest-between-parens ()
         "..."
         (interactive)
         (when (re-search-forward
                "(\\(\\s-\\|[\n]\\)*\\(.+\\)\\(\\s-\\|[\n]\\)*)" nil t) 
           (goto-char (match-beginning 2))
           (push-mark nil 'nomsg 'activate)
           (goto-char (match-end 2))
           )
         )

> What that code, which you say does nothing, does is to set the mark
> where the 2nd subgroup-match starts, then move point to where the 2nd
> subgroup-match ends, then ensure that the mark remains active after
> the command.

I've tried this on two platforms now; on my own distro, where I run
emacs-22.3.2 and on an Ubuntu 12.04 with emacs-23.3.1

I place my point on "b" in bar in this code: 

(
foo
bar
baz
)

, then I M-x everything-of-interest-between-parens RET, but the point
stands at the same place and nothing is selected. 

I have transient-mark-mode enabled. 

> But again, this is not a real parsing of lists, so there is no treatment of,
> say, nested lists.

Nope. I have no need for that. 

> And as I say, perhaps someone else will help you more, or differently.

Thank you very much for your help so far. 

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n



reply via email to

[Prev in Thread] Current Thread [Next in Thread]