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: Thu, 26 Nov 2020 16:23: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="13817"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: daniela-spit@gmx.it Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 26 16:28:04 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 1kiJBk-0003Ss-CM for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 26 Nov 2020 16:28:04 +0100 Original-Received: from localhost ([::1]:48108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kiJBj-0003fW-74 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 26 Nov 2020 10:28:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiJ73-00010u-78 for help-gnu-emacs@gnu.org; Thu, 26 Nov 2020 10:23:13 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:60329) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiJ71-0001BX-00 for help-gnu-emacs@gnu.org; Thu, 26 Nov 2020 10:23:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606404187; bh=ZTFcTebhdPEA4SlVLsLozxtWiA7pIgYXyYNLXZxLtEQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=d+X4JIy/B1RVjFmwxWWeLP1i2yk70ubAWLAm97RTA70QE+0sGP0T7qIiyjvPZS/Us c/7tIJxPKG1OuMGij2ynhekSw8c+wNC+/gX43aRapgG37X/ctYQS/E6LK5s48cj/JY FUvFJhltZ8a/OSwx9aYDv2EkPbFuo5x7xNflHQSI= 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-bs15.server.lan [172.19.170.183]) (via HTTP); Thu, 26 Nov 2020 16:23:07 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:2yQ3MHXGSJUqKFs+Pr9KLZYq+rlVpTmFesc3Q1wRVlZH7NqIOJBLG/+3eBmKgGc8D/Q6s ZRQ6X946+tQu1KlirskuE2wewRu+MgFlWzAQxtf0p2p5GbAKwbalLI4weRWla1pS6NzQWdJlXjW9 wJR+JA4+hVeuaa8vbT+2jAbl3D+V7tEpY0/JWN06XFPpLzh3EKOumOdT0GMNjY1SnF9NsBHQIFpF BLK9NpDPUPDaA4ubTuxePUVTK4O5KwQFfI1a/QfKbOYuSBghXc6nyUVptmBYLtrTkPSFeIvfveJI eY= X-UI-Out-Filterresults: notjunk:1;V03:K0:tdTmQ2rgPtY=:z+vuz1f7R82cJk68rfTlvP Elryo4EI7LBec/6lCJi/fpq4eiJPJOG+t4xo5RUp/IxVV4wk4GafUtehlL73MzVFIY2P9Z83z 8agcoLMtqgZ4/7RKoOv3PnQaLTqayu8zOSWIZrVW2bt85hJZvMJptvVY6kDR3trbJChbQ7ihU qXLFyIxsabC0vWjTHiBZWmUT5XzXrJiWAXKOblUZVmy+KOxJzraIMEaBo+9kv+aCMdXo/sks3 2drW+KQfRG1a28V0zXp7Spb6Y6d5M4jc2vMzce5GfLLT+BcIoSjXkt6e7eFy5/iYiya3vfWjb p4SHTU4xQpUfQu0ynNCin9hAL72ycqTidaymWKRKR7VVkKjHcjVl5DtTCnGgcrfGa6iDuszB8 XT6eRkFP/QiCO4jQtWJ2EcePNrV8HBJuc4XIg2+NR0sNPzKQkla5dmftcZsHLhELq21naQga3 IIpeb394sujVZqQ+I1yolZa0gs8pCHdV3PTIrtwkdrIM4+/YLA0J+mm/VuDs99u2jcoT04NSg MJPEZApx5uaOwV0Di1yMqbmsoE4fGJq6N+RmsoIMkjfPZTnFgHMpnjH6+zMQ3lNMh2xQmxrEW ORWa9z97ggPdM= Received-SPF: pass client-ip=212.227.15.15; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:125566 Archived-At: I am getting somewhat confused because I have also seen people using set-fill-column and setq-default. Is doing fill-column and set-fill-column the same thing? (add-hook 'text-mode-hook '(lambda() (turn-on-auto-fill) (set-fill-column 72) )) (setq-default fill-column 72) > Sent: Thursday, November 26, 2020 at 4:13 PM > From: daniela-spit@gmx.it > To: "Christopher Dimech" > Cc: help-gnu-emacs@gnu.org > Subject: Re: Auto Fill Comments > > We currently have just a hook to text-mode > > (add-hook 'text-mode-hook > '(lambda() > (turn-on-auto-fill) > (set-fill-column 80) )) > > > Sent: Thursday, November 26, 2020 at 4:56 AM > > From: "Christopher Dimech" > > To: "Christopher Dimech" > > Cc: help-gnu-emacs@gnu.org > > Subject: Re: Auto Fill Comments > > > > > > I am still stuck with trying to do autofill by cycling through a key b= inding. > > In summary I want to cycle between > > > > 1. Auto Fill only comments > > 2. Auto Fill entire buffer > > 3. Disable Auto Fill > > > > What command can be used to set the three commands? > > > > > Sent: Wednesday, November 25, 2020 at 8:59 AM > > > From: "Christopher Dimech" > > > To: "Robert Thorpe" > > > Cc: help-gnu-emacs@gnu.org > > > Subject: Re: Auto Fill Comments > > > > > > M-q was what I have been doing. Want to try out auto fill, see if i= t 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 langu= age 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)))) )) > > > > > > > > Notice that "M-q" performs paragraph filling for comments in C and= other > > > > languages. It is not *auto* filling certainly, but it's very usef= ul. > > > > > > > > I've found that to be the best myself. That's because of commenti= ng 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 aut= o-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 > > > > > > > > > > > > > > > > > > > > > > >