From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: [OT] Re: What is the best way to navigate #ifdef and #endif in C program Date: Wed, 04 Aug 2010 12:27:14 +0200 Organization: Informatimago Message-ID: <87y6cmsmf1.fsf@kuiper.lan.informatimago.com> References: <53f62f81-fb10-4fb6-87ce-0eb5609d12f5@h17g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291854025 21723 80.91.229.12 (9 Dec 2010 00:20:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 00:20:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 01:20:21 2010 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.69) (envelope-from ) id 1PQUFB-00011x-7q for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 01:20:21 +0100 Original-Received: from localhost ([127.0.0.1]:60280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQUFA-0002v2-HA for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 19:20:20 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp,comp.lang.scheme Original-Lines: 95 Original-X-Trace: individual.net gd5l48darbxpif8dsHTWEwilka/Jp/+9ofABCTpw2DvhYYSUv6 Cancel-Lock: sha1:N2Q1NjllYzNjMGNmOWQyMzEzOTk3NDdkMmRiNDBkZWE4ZjMyNmQ4NQ== sha1:i3ChQHxZmtOrGR/ZkX2A5lHvoT8= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.2 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:180345 comp.lang.lisp:290877 comp.lang.scheme:87265 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:76285 Archived-At: Fren Zeee writes: > On Aug 2, 5:31 pm, "Daniel (Youngwhan)" wrote: >> Hi, >> >> If there is curly brace, it is easy to navigate between them by M-C-f >> and M-C-b in c-mode. >> >> However, I cannot find a way to navigate in like curly brace when it >> comes to #ifdef, #else, and #endif. >> >> For example, if there is a code like this: >> >> #ifdef A_DEFINED >> (...100 lines) >> #else >> (... 500 lines) >> #endif >> >> , is there a easy way to move the cursor from #endif to #ifdef or >> #else and vice versa? >> >> Daniel > > You might get better luck posting in a C group also. > > I use #ifdef ... #endif often also to comment out blocks of code > during debugging. > > My question to CLISP/ELISP/scheme people is clisp is an implementation, not a language. There is a language named Common Lisp, abreviated as CL. Perhaps you mean that? > If there is a wrapper do nothing type function in elisp/clisp/scheme > which can have the same effect as commenting out. > > This is because I dont like to do comment-region/uncomment-region in > emacs. > > These three lispy languages dont seem to have comment block construct > like C ie /* and */ AFAIK, emacs lisp doesn't have any block comment feature, and I know no standard way to do block comment in r5rs scheme, but scheme implementation may provide the same as in Common Lisp, or with a different syntax. In Common Lisp you could try to use #| |#, but unfortunately, it is not like C /* and */: int a[]={ /* hello /* world */ 1,2}; // a contains {1,2}. (let ((a '( #| hello #| world |# 1 2))) a) is a syntactic error. You would have to write: (let ((a '( #| hello #| world |# |# 1 2))) a) --> (1 2) However, in Common Lisp, you could implement a reader macro with a behavior similar to C /* comments */. This is the reason why there is no point asking whether there is a feature X in CL. You can always add any feature to the language, thanks to its macros or reader macros, and metalinguistic abilities in general. -- __Pascal Bourguignon__ http://www.informatimago.com/