From: Nordlöw <per.nordlow@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Checking if cursor is inside a comment
Date: Fri, 18 Jul 2008 00:10:38 -0700 (PDT) [thread overview]
Message-ID: <2b227bd6-aceb-4298-8c25-ddaa25f9dcc1@j1g2000prb.googlegroups.com> (raw)
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? What is the most clever way of doing this? Should I use looking-
at(), use or perhaps extend thing-at-point(), or use search-forward/
backward() or is there some other state or function that should be
used for this specific case. I believe c-mode has some variables and
functions for accessing the result of its parsing, for example c-
syntactic-information-on-region().
My main reason for asking is that I have a lot of clever code helpers
especially for c-mode that I don't want to be enable inside comments.
Thanks in advance,
Nordlöw
next reply other threads:[~2008-07-18 7:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 7:10 Nordlöw [this message]
2008-07-18 8:59 ` Checking if cursor is inside a comment Thien-Thi Nguyen
2008-07-18 19:06 ` Johan Bockgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2b227bd6-aceb-4298-8c25-ddaa25f9dcc1@j1g2000prb.googlegroups.com \
--to=per.nordlow@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).