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

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

Re: marrying braket for ?: operator


From: Alan Mackenzie
Subject: Re: marrying braket for ?: operator
Date: Thu, 28 Jul 2005 22:04:50 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Robert Marshall <spam@chezmarshall.freeserve.co.uk> wrote on Thu, 28 Jul
2005 21:06:20 +0100:
> On Thu, 28 Jul 2005, Alan Mackenzie wrote:

>> Baloff <washdc@wash.edu> wrote on 28 Jul 2005 15:20:51 +1000:
>>> Hello

>>> when I move my pointer to a braket, it highlight its marrying
>>> braket.  but how can I get it to do the same with the ternary
>>> if-else operator (?:) I hope this is a good group for this question
>>> otherwise please point me.

>> It's exactly the right group!

>> There is no command which jumps from a ? to it's : or vice versa.
>> Maybe there should be one.  Maybe somebody, somewhere, has
>> implemented one, and will jump in here with a URL pointing to the
>> source code.

>> The thing is, though, how useful would this command be?  Programmers
>> tend not to nest these conditional expressions very much.  The
>> command would have to bound to a key sequence, something like C-c :
>> (that's "control-c colon").  By the time you've typed that in, you
>> could just as well have found the colon by interactive search by
>> typing C-s :.


> And it's probably not straightforward (for either case), you might have

>  (x > 4) ? weeble::kerplunk(funky::gibbon ? whoop : holler()) : 
> foible::gibber::eugh();

Believe me, compared with some of the stuff that's already in CC Mode,
that's nothing.  ;-)

> Robert
> -- 
> La grenouille songe..dans son château d'eau

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").



reply via email to

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