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

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

Auto Fill Comments


From: Christopher Dimech
Subject: Auto Fill Comments
Date: Tue, 24 Nov 2020 18:05:55 +0100

Would this be good enough  to Auto Fill Comments in c language.
What can I use for Auto Fill Comments for other languages, e.g.
fortran, elisp, c++, texinfo, bash, awk, org, R.

;; Apply Auto Fill to comments but not code in programming language modes.
(add-hook 'c-mode-common-hook
   (lambda ()
      (auto-fill-mode 1)
      (set
         (make-local-variable 'fill-nobreak-predicate)
         (lambda ()
            (not (eq (get-text-property (point) 'face)
                    'font-lock-comment-face)))) ))




reply via email to

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