in my .emacs configuration, I have the following:
(defun fold-long-comment-lines ()
"This functions allows us to fold long comment lines
automatically in programming modes. Quite handy."
(auto-fill-mode 1)
(set (make-local-variable 'fill-no-break-predicate)
(lambda ()
(not (eq (get-text-property (point) 'face)
'font-lock-comment-face)))))
the above is called as part of the "c-mode-common-hook" and correctly provides automatic folding of long comment lines.
however, the above thing works indiscriminately, regardless of whether I use one line comment, for example. a description of the structure fields or multi-line comments describing a complex piece of code.
So, the main question: how can I automatically add long lines of comments only if it is a multi-line comment?
thanks Anupam
edit-1: explanation of several lines when I say "multi-line comment", it basically means comments like this:
code follows
a respectively, a single line comment would be something like this
struct foo {
char buf_state : 3;
char buf_value : 5;
}
elisp, . , .