From: Joe Bloggs <who@cares.invalid>
To: help-gnu-emacs@gnu.org
Subject: Re: Is there any elisp functions to tell whether the cursor is in a comment block?
Date: Mon, 14 Jul 2008 16:05:57 +0100 [thread overview]
Message-ID: <87iqv8sdyi.fsf@DEBLAP1.BeNet> (raw)
In-Reply-To: 71bcf427-442c-45b8-95d6-5f8289c85297@z72g2000hsb.googlegroups.com
sunway <sunwayforever@gmail.com> writes:
> I will recommend YAsnippet package to you [ code.google.com/p/
> yasnippet ]
> and
> (add-hook 'c-mode-hook
> '(lambda ()
> (setq yas/buffer-local-condition
> '(if (nth 8 (syntax-ppss (point)))
> '(require-snippet-condition . force-in-
> comment)
> t))))
> will do what you want.
>
Thanks for the tip, that's a great package! Just what I need.
The code you give above doesn't work for me (emacs 21),
it doesn't recognize 'syntax-ppss'.
I guess I would have to adapt Johan's code to get it to work in
emacs 21, but thanks anyway.
next prev parent reply other threads:[~2008-07-14 15:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-13 5:06 Is there any elisp functions to tell whether the cursor is in a comment block? sunway
2008-07-13 9:53 ` Johan Bockgård
2008-07-13 17:55 ` Joe Bloggs
2008-07-13 19:03 ` Johan Bockgård
2008-07-14 1:36 ` Joe Bloggs
2008-07-14 1:49 ` Johan Bockgård
2008-07-14 1:36 ` sunway
2008-07-14 15:05 ` Joe Bloggs [this message]
2008-07-14 15:44 ` Lennart Borgman (gmail)
[not found] ` <mailman.14707.1216050306.18990.help-gnu-emacs@gnu.org>
2008-07-14 20:10 ` Joe Bloggs
2008-07-14 23:20 ` Lennart Borgman (gmail)
2008-07-14 23:43 ` Drew Adams
2008-07-14 23:49 ` Lennart Borgman (gmail)
2008-07-15 6:02 ` Drew Adams
[not found] ` <mailman.14727.1216079418.18990.help-gnu-emacs@gnu.org>
2008-07-15 22:27 ` David Kastrup
2008-07-20 13:59 ` Eli Zaretskii
2008-07-15 1:27 ` Tom Tromey
2008-07-15 7:31 ` Lennart Borgman (gmail)
2008-07-15 14:15 ` Drew Adams
2008-07-15 20:50 ` Lennart Borgman (gmail)
2008-07-15 21:21 ` Drew Adams
2008-07-15 21:34 ` Lennart Borgman (gmail)
2008-07-15 22:06 ` Drew Adams
2008-07-15 22:19 ` Lennart Borgman (gmail)
2008-07-15 22:32 ` Drew Adams
2008-07-15 22:47 ` Lennart Borgman (gmail)
2008-07-15 22:53 ` Drew Adams
[not found] ` <mailman.14800.1216160423.18990.help-gnu-emacs@gnu.org>
2008-07-17 17:40 ` Giorgos Keramidas
2008-07-17 17:30 ` Giorgos Keramidas
2008-07-19 15:17 ` Joe Bloggs
2008-07-20 0:10 ` Giorgos Keramidas
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iqv8sdyi.fsf@DEBLAP1.BeNet \
--to=who@cares.invalid \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.