From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Auto Fill Comments Date: Wed, 25 Nov 2020 08:59:07 +0100 Message-ID: References: <87pn419aha.fsf@robertthorpeconsulting.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22628"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Robert Thorpe Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 25 09:02:50 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khplJ-0005ls-GQ for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 25 Nov 2020 09:02:49 +0100 Original-Received: from localhost ([::1]:57492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khplH-0004wr-H5 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 25 Nov 2020 03:02:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khphp-0004wi-C2 for help-gnu-emacs@gnu.org; Wed, 25 Nov 2020 02:59:13 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:34229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khphn-0004fw-7d for help-gnu-emacs@gnu.org; Wed, 25 Nov 2020 02:59:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606291147; bh=xF9pOEPQopERejLX4aI044VlKRPql9DI05NoeNXl630=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=PBrjgaUBxnqe/1hBFyrsX8Uu6T59zose2yp8zZS4bmqfZWo1TJnYvuzYWhNLiQVw0 7T+0kGPd8wpgVJLgPH1xO+tkgYzqlMoq5VfxLhMCZgCJvYFdsh3vDGRV/dLRaqZ99g wr8z55GsAf5fykgnPNtyY3g2VHQ2tNyGLtrt+KWM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs13.server.lan [172.19.170.181]) (via HTTP); Wed, 25 Nov 2020 08:59:07 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <87pn419aha.fsf@robertthorpeconsulting.com> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:TK4FNZBV9Q3z9wUro612FqqLE5wM+hGnhlBQxmF3btKqlDWWXkfJ8BlQYF78XZ+lXpmel F2TDbE7rah4L3Z2cSOE7t1dMK08IegJLB/ZrQ/ULXAFnh6SR9qeHeiFVK1fzGEc9pgOO3MBtnVMU VElTxKc57bQiihRq9qbXpj3jr8nGJR9Gi9r3bUm389YdKQV3kAXr5IYk4xjtJEm4bfsqy4/u5Qiw 8JNCwh+IU/GXFv5NIrCUauIAy7DO5ZBE1qMCihCaPT06B7i07Bxl+BxrUlYlDTAE7Y76+gCTAl6z QU= X-UI-Out-Filterresults: notjunk:1;V03:K0:p/ozcbL218Q=:K/Cu0PrvWf8GSxCprmp6AI OUINDdIIVBZQppbNqPC6zHbUxXX8QWH/MZAdZWFzXgvpYk9usmkjE3CoHPg5wPX445yQSgYt5 HOG30AnMMNCN6czHroZ8bA6xD962cYNUAVsO2uIgdvIGRihfwcuqgIjVc/UXkIPfbx5CSztvj dQAe/CZHK3gkpSmfqb59BDOXJc9dGu56Nja8mK0bTh4Ycfl1rYoxxaCqP5hrHZfByuhQAMvRb ENov4PcKCyYZQhSfeRuAxeYKZYFbuTM2f98AYqF46hWm5iAbUSxBf3U6C9VTlmf1tM1p3TPL3 ZAtDS6oPIQFD3ibJ8FS/wd0EG07Dnfwpk1ASHDBzd1nX2QftivhhtmRojrdmOiwKWnVYTyhmy yf6QWcqkOt+WFoWZJEnQswD33Q4bLVExQv8CLMy1l7uUAIKWKoB3UiKOyA0dKC6bzJXtZD/vv +ZLhC0AFV28vcQl2fFMYXo7PgEF6KOBbFcQsEDKpJF47YIEgpeuno98Ne2DoE9EB1L7xvV8IY lSOi7+PQGSLysu6gTiGsz2BVWXlDyKsBQHq77/v0LgNEbqrecitiJ6YuRI9qEQupw0i8sIn/C eGkx08Gx4zC1g= Received-SPF: pass client-ip=212.227.17.22; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125554 Archived-At: M-q was what I have been doing. Want to try out auto fill, see if it can = save me using the key binding. I usually keep code quite compact, but will check = out what you discussed. > Sent: Wednesday, November 25, 2020 at 8:11 AM > From: "Robert Thorpe" > To: "Christopher Dimech" > Cc: help-gnu-emacs@gnu.org > Subject: Re: Auto Fill Comments > > Christopher Dimech writes: > > > 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 mo= des. > > (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)))) )) > > Notice that "M-q" performs paragraph filling for comments in C and other > languages. It is not *auto* filling certainly, but it's very useful. > > I've found that to be the best myself. That's because of commenting out > code. The problem is if you comment out code then modify it when it's a > comment. If you set Emacs to auto-fill comments, then it will auto-fill > those code comments as though they're text. That's wrong when you want > to uncomment the block and make it back into code, it removes the > indentation. > > BR, > Robert Thorpe > > >