From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: daniela-spit@gmx.it Newsgroups: gmane.emacs.help Subject: Re: Auto Fill Comments Date: Thu, 26 Nov 2020 16:13:47 +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="32278"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 26 16:14:35 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 1kiIyh-0008Ir-Dv for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 26 Nov 2020 16:14:35 +0100 Original-Received: from localhost ([::1]:48148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kiIyg-0008Vl-CQ for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 26 Nov 2020 10:14:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiIxz-0008Vf-VJ for help-gnu-emacs@gnu.org; Thu, 26 Nov 2020 10:13:51 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:40431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiIxx-0006SL-QI for help-gnu-emacs@gnu.org; Thu, 26 Nov 2020 10:13:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606403627; bh=lpzNTkmPV+HtWDE+kACrq7CXIJdJ7KrLoqVlxObXPoU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=MviN4aMP4TZ4JVDwYoDWG2PsP5PP7MZIkPX52JIfkJK3CscZwa8tZuzi83tMHFGoS rLI/E66bhgoctYcA/i6hiHMqcM6/f17IzdH++CL25iuiIS6JxIka/h0CKwcT6SVmdL tZfNlDYrxjragI9xEsQDcR3fo+AE0vj/uQavA5zs= 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:13:47 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:zaO5zCk01zMrjv3xqUPFjHfCAG0eD1IqzAv/2WNUAcW/TlTOs6gPq6RaKRI/WRdsr5YFL fJoA/7we6e5iFAX+7aAeoAzp2GpKlSWsY5RFgJwnNzxhsL9hCSNVUBaWGozXRhAonTEL6bdQtbDL XKr8KChC4WByHi3IDAu9OW0BAN1JE1tIZsE6lDkQWFdFGZ5VtJ1f13k5nlWwkngdoL6Pef3200AZ YKdoL095nEGN6r7Y96u1y1TrfRN/zMLotR6TAwz7pG2BH5L+ZI/gSpHy4k4k6G+QNceOi1vJxH1p rU= X-UI-Out-Filterresults: notjunk:1;V03:K0:r0eEqeYKjFo=:B9oI9SdH/AqWexDYWqge/l mP7tetO+wUlA+qxGIMnvPFILvn+Le/vLASKpbmD8LKOuHvEJg+yW4RUCcLx8k/PZDsK8MfWMt XYHqYaXoPlbc1o0hRJgDCvv51bTsqXD9sOUoUt/mzGEZmMpSEfzpualmcUvIEyQ4wF6Itu05W RMQ5nB1SWIZJO2SeXHkxDpJEOw90QcpjAsrNJ4MwqqZ81FjmU2kKy6rkx9tvsw2EiSiWTlAG1 AzuucqcrG6q5rSfzyYEn6WMkbTHoGbGVVVhSzjpLKiFUwCBz+TWVlgHsJ0SOs/z5/EBOiSH78 WtW+yYSpZrLkvO2FMBFYr6VEzgEWDv3oaXDqyBr7F1vDRy/omQuDxyEVEkt0ocdXHIST59Sqc wQxxf5KhkvN10UJ46/vyg43EcvfuXzcnUBLxNcUEPDspSCsy3tZ6fx959rXfeX6GNZtLaSFh+ xrZzcOY0SJF9KhrDV0MUDhfNTwGHjhr+6r4bOJH4Vtjs9MFS+N+wnYj1SP+lpgGak5a0VoWY8 sqifY3djgIaUTVhvfI7EUKVToNJKh4GT45rPfWfbIat0RxzS3gW8jOCO70Coe9qgDTulG0K8z tffZi/CYjpfKg= Received-SPF: pass client-ip=212.227.15.18; envelope-from=daniela-spit@gmx.it; 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:125564 Archived-At: 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 bin= ding. > 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 it = can save me > > using the key binding. I usually keep code quite compact, but will ch= eck 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 languag= e 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 o= ther > > > 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 w= ant > > > to uncomment the block and make it back into code, it removes the > > > indentation. > > > > > > BR, > > > Robert Thorpe > > > > > > > > > > > > > > >