From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: Checking if cursor is inside a comment Date: Fri, 18 Jul 2008 10:59:22 +0200 Message-ID: <87bq0vk1p1.fsf@ambire.localdomain> References: <2b227bd6-aceb-4298-8c25-ddaa25f9dcc1@j1g2000prb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1216371780 32714 80.91.229.12 (18 Jul 2008 09:03:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jul 2008 09:03:00 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?utf-8?Q?Nordl=C3=B6w?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 18 11:03:48 2008 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.50) id 1KJlsR-0004J8-Pl for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Jul 2008 11:03:48 +0200 Original-Received: from localhost ([127.0.0.1]:55056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJlrZ-0002Ic-6d for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Jul 2008 05:02:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJlr0-0002GW-QD for help-gnu-emacs@gnu.org; Fri, 18 Jul 2008 05:02:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJlqy-0002E9-MK for help-gnu-emacs@gnu.org; Fri, 18 Jul 2008 05:02:18 -0400 Original-Received: from [199.232.76.173] (port=33085 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJlqy-0002Dq-FV for help-gnu-emacs@gnu.org; Fri, 18 Jul 2008 05:02:16 -0400 Original-Received: from [151.61.143.235] (port=33362 helo=ambire.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KJlqx-0003FY-P9 for help-gnu-emacs@gnu.org; Fri, 18 Jul 2008 05:02:16 -0400 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1KJloA-0002CK-Mx; Fri, 18 Jul 2008 10:59:22 +0200 In-Reply-To: <2b227bd6-aceb-4298-8c25-ddaa25f9dcc1@j1g2000prb.googlegroups.com> (=?utf-8?Q?=22Nordl=C3=B6w=22's?= message of "Fri, 18 Jul 2008 00:10:38 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:55701 Archived-At: () Nordl=C3=B6w () Fri, 18 Jul 2008 00:10:38 -0700 (PDT) Is there a general or mode-specific (c-mode for my application) way of checking whether the cursor is currently placed inside a comment or not? Perhaps you can use `hs-inside-comment-p', which would require you to enable/configure hideshow (not difficult, but not "out of the box"). What is the most clever way of doing this? It depends on how you conceptualize "clever". thi