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: Tue, 24 Nov 2020 21:02:59 +0100 Message-ID: References: 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="1122"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 24 21:04:05 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 1kheXl-0000Ap-FU for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 24 Nov 2020 21:04:05 +0100 Original-Received: from localhost ([::1]:60114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kheXk-0007sW-GN for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 24 Nov 2020 15:04:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kheWo-0007r8-Oo for help-gnu-emacs@gnu.org; Tue, 24 Nov 2020 15:03:06 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:52775) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kheWl-0000uS-2b for help-gnu-emacs@gnu.org; Tue, 24 Nov 2020 15:03:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606248179; bh=KzveD27ar8cnhpJNRxZUAbe3hREQ366DCaybpyv6Q74=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=k2UeWQdZi7BU+S61Xso9fJhyo8zecRjYmgAL4JBZhtp2hRug6dDUwOBatr5SBLfOf nywKYqFaDVtEz0k/+LqE5GMsDLzxiyh0+5nSqqPWm2m66nHvchXz+xi0RwI3/RWiLM gDBxY17f/n+c6n6mUz7ByR0xjVP8yc4U4aR3R00I= 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-bs16.server.lan [172.19.170.184]) (via HTTP); Tue, 24 Nov 2020 21:02:59 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:MUV4seVgwU/Si/4+h5UbMKnoahjI8UYhpX69MAfSe3yNgK/YeCIWrAXBfso9z/9O9qzXu bNFf027dkKnsUTOk+j2NGXquEuE9LUUY6TMUPVyumLReSv84aLbIuw5Mm+ZBbpcqRe8j1TBVRjcA SFh3ikYU/xuzjyv8KMVjXYt8IVPPnO7Y3xw0CbqmbyeWuVt3TWq7223AqL8slG0qn2trjWpnEHvn qvBxkyWGx6c7Er0HV6kdkiTjxxUW6WYWPyfDdp1RG09/rYvyKbNtnyBDSNH+ZhcEEWU4/RE7ZoEl Ek= X-UI-Out-Filterresults: notjunk:1;V03:K0:twNjqurX9vk=:U4M3+xFU+hA9e7YfVvPvcO SiN7BjUfIO80Wgwdx2ksoWiCzLDdhsWxJqGYA5p4y+qzuGHJq+A7E00wStlrNXaIj5eBoqHFW eDOVesopAU3JWxdTCDNei2RUDQGgVn8X9swtr/WKzUyeFVrTvad8Luc5HcuzB4albeM4RNmWq 3o1jMZQ3Zy1yfpac8ynjdr+gcUpG+qct2TssX/6FGvu/7IHYbDAwaNMNXN5q3y+Gh46tIHCH8 JErLoSnnnqI0H60eRhJ8WPezB+0yNw63Cme2MEMNP5RhxAa69xLjfgDco++l1VdamGzSLnPSh T9nsoqRfTEwEvEVXViV553FaYWxDrE4yJLR1gBc6Cm6UXET/71yAAP7ycnz+sK2ixzzsvwp90 TxmB/UKDGZQUCOT75NQVRsTkUtj14w1nb/j7UAaQkyFTYgYAMtthxuQQ3s61aYpC9aShd+Mq9 YCJ2zmjNIRuqNye+/Boe6Y5t43BV7Xi2lw9CIc3aD3qG0T0u5GpXpLJE7Jb0JYtbHp3ZH22sn 24sd6UCS0QQXhFy8PVJZS/ECN+76HagLT8knoFhAANAmaxvqyziKW71gEsEQHPiPBz+W+2pQ2 5w3izhkminwDY= Received-SPF: pass client-ip=212.227.17.20; 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:125541 Archived-At: > Sent: Tuesday, November 24, 2020 at 8:52 PM > From: "Christopher Dimech" > To: daniela-spit@gmx.it > Cc: "Help Gnu Emacs" > Subject: Re: Auto Fill Comments > > Looks quite nice. I could try to cycle through three states: > (1) auto fill comments; (2) auto fill buffer; and (3) disable > auto fill. > > Anybody done this before? I have not, don't know much elisp myself. > Regards > Christopher > > > > > Sent: Tuesday, November 24, 2020 at 8:42 PM > > From: daniela-spit@gmx.it > > To: "Christopher Dimech" > > Cc: "Help Gnu Emacs" > > Subject: Re: Auto Fill Comments > > > > This is what I use. I find no good reason to use c-mode-common-hook. > > > > (defun break-comment () > > (setq-local comment-auto-fill-only-comments t) > > (auto-fill-mode 1)) > > > > (add-hook 'sh-mode-hook #'break-comment) > > (add-hook 'fortran-mode-hook #'break-comment) > > (add-hook 'emacs-lisp-mode-hook #'break-comment) > > (add-hook 'texinfo-mode-hook #'break-comment) > > > > (add-hook 'c-mode-hook #'break-comment) > > (add-hook 'c++-mode-hook #'break-comment) > > (add-hook 'awk-mode-hook #'break-comment) > > (add-hook 'R-mode-hook #'break-comment) > > (add-hook 'octave-mode-hook #'break-comment) > > (add-hook 'text-mode-hook #'break-comment) > > > > > > > Sent: Tuesday, November 24, 2020 at 6:05 PM > > > From: "Christopher Dimech" > > > To: "Help Gnu Emacs" > > > Subject: Auto Fill Comments > > > > > > 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)))) )) > > > > > > > > > > > >