unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How can I add space between operands and operator in emacs?
@ 2005-02-26  2:25 Zhou Lei
  2005-02-26 21:56 ` B.T. Raven
  0 siblings, 1 reply; 3+ messages in thread
From: Zhou Lei @ 2005-02-26  2:25 UTC (permalink / raw)



Hi friends, how can I add a space between operands and operator, like this: from
"a=c+++3;" to "a = c++ + 3;"? I use GNU Indent for C code, but GNU Indent cannot
deal with something for C++. What should I do? Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How can I add space between operands and operator in emacs?
  2005-02-26  2:25 How can I add space between operands and operator in emacs? Zhou Lei
@ 2005-02-26 21:56 ` B.T. Raven
  2005-02-27 10:25   ` Zhou Lei
  0 siblings, 1 reply; 3+ messages in thread
From: B.T. Raven @ 2005-02-26 21:56 UTC (permalink / raw)



"Zhou Lei" <dark_eaglet@hotmail.com> wrote in message
news:87wtsw5a72.fsf@hotmail.com...
>
> Hi friends, how can I add a space between operands and operator, like
this: from
> "a=c+++3;" to "a = c++ + 3;"? I use GNU Indent for C code, but GNU
Indent cannot
> deal with something for C++. What should I do? Thanks.

M-% +++ ret ++ + ret !

Since addition is a commutative operation you could have written a = 3 +
c++;
What is the operator precedence of inc and binary +?

Here's an example of something even more perverse:

char*f="char*f=%c%s%c;main()
     {printf(f,34,f,34,10);}%c";
     main(){printf(f,34,f,34,10);}


or, more on topic:

((lambda (x)
       (list x (list (quote quote) x)))
      (quote
         (lambda (x)
           (list x (list (quote quote) x)))))

Both programs print themselves and were called quines by Douglas
Hofstadter, after the logician:

http://www.nyx.net/~gthompso/quine.htm

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How can I add space between operands and operator in emacs?
  2005-02-26 21:56 ` B.T. Raven
@ 2005-02-27 10:25   ` Zhou Lei
  0 siblings, 0 replies; 3+ messages in thread
From: Zhou Lei @ 2005-02-27 10:25 UTC (permalink / raw)



Ok, I'd better use M-| astyle to do that rather than using emacs...  Thanks for
your explanation.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-27 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-26  2:25 How can I add space between operands and operator in emacs? Zhou Lei
2005-02-26 21:56 ` B.T. Raven
2005-02-27 10:25   ` Zhou Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).