help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there any elisp functions to tell whether the cursor is in a comm


From: Joe Bloggs
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
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

sunway <address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]