unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: daniela-spit@gmx.it
To: Christopher Dimech <dimech@gmx.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Auto Fill Comments
Date: Thu, 26 Nov 2020 16:13:47 +0100	[thread overview]
Message-ID: <trinity-ecec5438-da9c-4746-9cdd-e73d756d9733-1606403627268@3c-app-mailcom-bs15> (raw)
In-Reply-To: <trinity-bd917da6-8593-496f-ad5d-e94bd80ab4d1-1606362968280@3c-app-mailcom-bs15>

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" <dimech@gmx.com>
> To: "Christopher Dimech" <dimech@gmx.com>
> 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 binding.
> 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" <dimech@gmx.com>
> > To: "Robert Thorpe" <rt@robertthorpeconsulting.com>
> > 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 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" <rt@robertthorpeconsulting.com>
> > > To: "Christopher Dimech" <dimech@gmx.com>
> > > Cc: help-gnu-emacs@gnu.org
> > > Subject: Re: Auto Fill Comments
> > >
> > > Christopher Dimech <dimech@gmx.com> 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 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 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
> > >
> > >
> > >
> >
> >
>
>



  reply	other threads:[~2020-11-26 15:13 UTC|newest]

Thread overview: 155+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 17:05 Auto Fill Comments Christopher Dimech
2020-11-24 19:42 ` daniela-spit
2020-11-24 19:52   ` Christopher Dimech
2020-11-24 20:02     ` daniela-spit
2020-11-24 20:53     ` Christopher Dimech
2020-11-25  0:56       ` Christopher Dimech
2020-11-27  4:40   ` Dante Catalfamo
2020-11-27  4:56     ` Christopher Dimech
2020-11-27  5:47       ` Arthur Miller
2020-11-25  7:11 ` Robert Thorpe
2020-11-25  7:59   ` Christopher Dimech
2020-11-26  3:56     ` Christopher Dimech
2020-11-26 15:13       ` daniela-spit [this message]
2020-11-26 15:23         ` Christopher Dimech
2020-11-26 16:00           ` tomas
2020-11-26 17:22             ` Christopher Dimech
2020-11-26 17:35               ` daniela-spit
2020-11-26 18:27               ` tomas
2020-11-26 18:44                 ` Christopher Dimech
2020-11-26 19:19                   ` Christopher Dimech
2020-11-26 20:16                   ` tomas
2020-11-26 20:29                     ` Christopher Dimech
2020-11-26 20:44                     ` Christopher Dimech
2020-11-26 21:14                     ` Christopher Dimech
2020-11-26 21:51                   ` Drew Adams
2020-11-27  0:47                     ` Christopher Dimech
2020-11-27  1:57                       ` arthur miller
2020-11-27  2:20                         ` Christopher Dimech
2020-11-27  3:04                           ` arthur miller
2020-11-27  3:46                           ` Jean Louis
2020-11-27  6:27                             ` Arthur Miller
2020-11-27  6:34                               ` Christopher Dimech
2020-11-27  7:02                                 ` Arthur Miller
2020-11-27  7:15                                   ` Christopher Dimech
2020-11-27  7:29                                     ` Arthur Miller
2020-11-27  7:00                               ` Jean Louis
2020-11-27  7:10                                 ` Christopher Dimech
2020-11-27  8:26                                 ` Arthur Miller
2020-11-27 13:26                                   ` Jean Louis
2020-11-27  7:33                         ` Eli Zaretskii
2020-11-27  2:15                       ` Drew Adams
2020-11-27  2:41                         ` Christopher Dimech
2020-11-27  3:21                           ` Drew Adams
2020-11-27  5:47                           ` Jean Louis
2020-11-27  6:06                             ` Christopher Dimech
2020-11-27  6:21                               ` Jean Louis
2020-11-27  6:27                                 ` Christopher Dimech
2020-11-27  6:34                                   ` Jean Louis
2020-11-27  6:35                                   ` Arthur Miller
2020-11-27  3:32                         ` Jean Louis
2020-11-27  5:32                           ` Drew Adams
2020-11-27  6:02                             ` Jean Louis
2020-11-27  7:28                       ` Eli Zaretskii
2020-11-27  7:59                         ` Christopher Dimech
2020-11-27  8:11                           ` Robert Pluim
2020-11-27  9:07                             ` Christopher Dimech
2020-11-27  8:25                           ` Eli Zaretskii
2020-11-27  9:11                             ` Christopher Dimech
2020-11-27  8:51                           ` Arthur Miller
2020-11-27  9:23                             ` Christopher Dimech
2020-11-27 13:44                               ` Jean Louis
2020-11-27 16:02                                 ` tomas
2020-11-27 17:41                                   ` Christopher Dimech
2020-11-27 17:53                                     ` tomas
2020-11-27 18:07                                       ` Christopher Dimech
2020-11-27 18:45                                         ` Christopher Dimech
2020-11-27 21:16                                           ` tomas
2020-11-27 21:32                                             ` Christopher Dimech
2020-11-27 19:03                                         ` Arthur Miller
2020-11-27 19:39                                           ` Christopher Dimech
2020-11-27 21:26                                             ` Arthur Miller
2020-11-27 21:40                                               ` Christopher Dimech
2020-11-27 22:15                                                 ` Michael Heerdegen
2020-11-27 22:38                                                   ` Christopher Dimech
2020-11-28  1:06                                                     ` Jean Louis
2020-11-28  1:24                                                       ` Christopher Dimech
2020-11-27 22:55                                                   ` Christopher Dimech
2020-11-28  1:08                                                     ` Jean Louis
2020-11-28  1:45                                                       ` Christopher Dimech
2020-11-28  2:54                                                         ` Jean Louis
2020-11-28  7:46                                                   ` Eli Zaretskii
2020-11-28 12:05                                                     ` Christopher Dimech
2020-11-28 15:58                                                       ` Andy Moreton
2020-11-28 16:15                                                       ` Eli Zaretskii
2020-11-28 16:29                                                         ` Christopher Dimech
2020-11-29  0:08                                                       ` Arthur Miller
2020-11-29  0:21                                                         ` Christopher Dimech
2020-11-29  0:25                                                           ` Arthur Miller
2020-11-29  0:44                                                             ` Christopher Dimech
2020-11-29  1:15                                                           ` Michael Heerdegen
2020-11-29  2:24                                                             ` Christopher Dimech
2020-11-29  2:56                                                               ` Michael Heerdegen
2020-11-29  3:21                                                                 ` Christopher Dimech
2020-11-29 23:41                                                                   ` Michael Heerdegen
2020-11-30  0:06                                                                     ` Christopher Dimech
2020-11-30  1:06                                                                       ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-11-30  1:49                                                                         ` Christopher Dimech
2020-11-30  2:05                                                                           ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-11-30  8:58                                                                           ` tomas
2020-11-30 10:09                                                                             ` Christopher Dimech
2020-11-30 10:41                                                                               ` tomas
2020-11-30 11:47                                                                                 ` Jean Louis
2020-11-30 12:43                                                                                 ` Christopher Dimech
2020-11-30  2:38                                                                         ` Drew Adams
2020-11-30  3:03                                                                           ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-01 18:47                                                                           ` Andreas Eder
2020-11-30  6:45                                                                       ` Jean Louis
2020-11-30 21:19                                                                       ` Michael Heerdegen
2020-11-30 22:14                                                                         ` Christopher Dimech
2020-11-30 22:26                                                                           ` tomas
2020-11-30 22:32                                                                             ` Stefan Monnier
2020-11-30 23:44                                                                               ` Christopher Dimech
2020-12-01  8:45                                                                               ` tomas
2020-11-30 22:45                                                                           ` Drew Adams
2020-11-30 23:22                                                                             ` Christopher Dimech
2020-12-01  8:42                                                                               ` tomas
2020-12-01 15:50                                                                                 ` Christopher Dimech
2020-12-01 16:35                                                                                   ` Jean Louis
2020-12-01 18:14                                                                                     ` Christopher Dimech
2020-12-01 19:33                                                                                       ` Michael Heerdegen
2020-12-01 19:56                                                                                         ` Christopher Dimech
2020-12-01 21:42                                                                                           ` Michael Heerdegen
2020-12-01 22:13                                                                                             ` Christopher Dimech
2020-12-01 22:55                                                                                         ` Christopher Dimech
2020-12-01 23:16                                                                                           ` Michael Heerdegen
2020-12-01 23:27                                                                                             ` Christopher Dimech
2020-12-02  4:49                                                                                         ` Jean Louis
2020-12-01 16:07                                                                                 ` Christopher Dimech
2020-11-30 23:12                                                                           ` Michael Heerdegen
2020-11-30 23:38                                                                             ` Christopher Dimech
2020-11-29  7:52                                                               ` Yuri Khan
2020-11-29 18:43                                                                 ` Christopher Dimech
2020-11-28 12:08                                                     ` Christopher Dimech
2020-11-28  7:33                                               ` Eli Zaretskii
2020-11-28 12:02                                                 ` Christopher Dimech
2020-11-29  0:05                                                   ` Arthur Miller
2020-11-27 19:06                                         ` Drew Adams
2020-11-27 19:43                                           ` Christopher Dimech
2020-11-27 16:25                               ` Arthur Miller
2020-11-27 13:31                             ` Jean Louis
2020-11-27 16:42                               ` Arthur Miller
2020-11-27 17:00                                 ` Jean Louis
2020-11-27 17:54                                   ` Christopher Dimech
2020-11-27 18:40                                     ` Arthur Miller
2020-11-27 18:47                                       ` Christopher Dimech
2020-11-27 18:30                                   ` Arthur Miller
2020-11-27  8:48                       ` tomas
2020-11-27 13:27                         ` Jean Louis
2020-11-27 14:20                         ` Stefan Monnier
2020-11-26 20:45           ` Stefan Monnier
2020-11-26 20:45         ` Stefan Monnier
     [not found] <<trinity-3a306896-e4f9-4747-b475-4220d2926968-1606237554995@3c-app-mailcom-bs16>
     [not found] ` <<87pn419aha.fsf@robertthorpeconsulting.com>
     [not found]   ` <<trinity-60beb4e8-9aad-4720-921c-26bcd854bea8-1606291146852@3c-app-mailcom-bs13>
     [not found]     ` <<trinity-bd917da6-8593-496f-ad5d-e94bd80ab4d1-1606362968280@3c-app-mailcom-bs15>
     [not found]       ` <<trinity-ecec5438-da9c-4746-9cdd-e73d756d9733-1606403627268@3c-app-mailcom-bs15>
     [not found]         ` <<trinity-5525c10b-09da-40b7-a9d8-ad6d12d86a62-1606404187770@3c-app-mailcom-bs15>
     [not found]           ` <<20201126160013.GD28931@tuxteam.de>
     [not found]             ` <<trinity-0fef3278-2e4b-4baa-a18e-44d71359e02c-1606411346268@3c-app-mailcom-bs06>
     [not found]               ` <<20201126182734.GA5175@tuxteam.de>
     [not found]                 ` <<trinity-e374e86a-0c1e-4936-be3d-cceef6d0d436-1606416249978@3c-app-mailcom-bs06>
     [not found]                   ` <<54331aa0-6a9a-4809-9f2d-88deee31558b@default>
     [not found]                     ` <<trinity-878f6b95-e9e7-4431-959d-bbf323277c4c-1606438028794@3c-app-mailcom-bs06>
     [not found]                       ` <<AM0PR06MB65775932B66B36CFDBB1813696F80@AM0PR06MB6577.eurprd06.prod.outlook.com>
     [not found]                         ` <<83o8jjp83z.fsf@gnu.org>
2020-11-27 17:51                           ` Drew Adams
2020-11-27 18:00                             ` Jean Louis
2020-11-27 19:00                               ` Drew Adams
2020-11-28  0:59                                 ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-ecec5438-da9c-4746-9cdd-e73d756d9733-1606403627268@3c-app-mailcom-bs15 \
    --to=daniela-spit@gmx.it \
    --cc=dimech@gmx.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).