From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: michael-franzese@gmx.com Newsgroups: gmane.emacs.help Subject: Re: Strange behaviour of auto-fill Date: Sat, 24 Apr 2021 02:47:16 +0200 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="28718"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: michael-franzese@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 24 02:47:54 2021 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 1la6Sf-0007M6-9Z for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 24 Apr 2021 02:47:53 +0200 Original-Received: from localhost ([::1]:59320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1la6Se-0007SP-7j for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 23 Apr 2021 20:47:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1la6S8-0007S5-TN for help-gnu-emacs@gnu.org; Fri, 23 Apr 2021 20:47:20 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:40537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1la6S6-0001EO-MU for help-gnu-emacs@gnu.org; Fri, 23 Apr 2021 20:47:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1619225236; bh=dkCWIk1QoRkJKgCHPmz3C55n30iwv9Q04+albX061oE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=iBgihHAKwj6VHirPcgf8O55nK+G3rNJ5CTwbu3H9u0v9XN7NJeklkKzI5WzjBrwmQ OcQ5jMaR405EqodcqilDpX74E/YfYoWdLO4ALxrXUbUcO40w6aJRJznJYBkoIqXprO hhdkk0SF0pV3Ui39xZilfB6rk3Psk5zZgXGtKSHk= 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-bs03.server.lan [172.19.170.169]) (via HTTP); Sat, 24 Apr 2021 02:47:16 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:664e2zDhMham+bqkciWRqp+rScYGnlg7D01o+YFisRpnm0D3INpDPFU5IrxPj6iC29FqG 9aaLJzk5brdptAmHvPz75KcDoxt6T3/tNlyeSsP3HGy3QmeNeZYxzSXbhz8v0+hBWWY58rmC9I0A ML/VKg8VG7oS0GtL1zrwx/accMlFiK8LSntd49rc51E5ku/PDVGovhRigrT2klhQnIN2kDuzFBFy NULPhfV05riaeINomOCydNmTvwCidhvAcWa4cgzBw7nF4w47OAu7rUwdWZlwvX2IZE/arVSoWu4U IU= X-UI-Out-Filterresults: notjunk:1;V03:K0:rnf9RrBE1m0=:RJ6atOM9hpX4U1mjYhzFtC wdf+mXSTkk2g0EesncJWmArrgl1Y1SHg1vCL4GDws2FBGR2bMDPanfrMn50Hxq/oCmgQgG+YL 4OFHhp5spFtZisa+jRDk8dnztef3FT+ggIJLH0N1n8WoD8f8xllXQv5NVPST4Pmb1uapEIOKc VYjXbhKIag7PKuWzVWIhP7LU94ysgLnIGU67ADQIo5QJYUJZk147PwJ7BNiP9aZF9AJyw5pJo 9aBNtkXWyFynoGwM6s8H4IBJDQ/ADrWmPhtHJc9PyvlOGZq7MP5eJWAjjfSx2zuDu5taakYy9 7VHCf5QPPBMOxn0HxIPmWjQDLMQram+PRohxvKh3sIdwnxduO7dehowZLerabEFpGLbt4N86I PWsyIWsu2RE3jXEUhLE3xfNSK+DykT9143fqgfaUKevSxFIZqwyDaxXU/ETgdOBWBJdNMrrJo dsJnyqryZ8SV6RV1rjeCjGpcnFKoI/GER3ZNEQpyR7qB9SLtyJxMb30iSb6T/JC2nxmLKkMcl 9z1D1itomvttyphe/dge+XOcE9MX2JPF7Sc3wMoR4fqz7T0lDUnY+u0kuvDfIZeZVd6RCJoYo uUH+olwYtaJSArfLumuzSY9UZD4KiznspeND2MvCLSasvZpYlNj5PIf1sodbdBxd5l89odb14 QF/Phko7rCxrWf1bsQpo1mbmgCLSep+dmHwkPrt95uY3cPE8aFW5OvGSCb9y47O6C6cTU+H72 GNKnhQyN58qP/7xrxgFuawv7u0RKjuZv6cwi+YaYe9tLOFg2Z7xhmx5Y3MsKf1gn4nt7i/Hd Received-SPF: pass client-ip=212.227.17.22; envelope-from=michael-franzese@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:129140 Archived-At: I am trying to write a workaround, but am struggling with elisp. Would like to have a function that sets the order. But do not know how to make string variables, then use pcase. (defun break-line-order () (setq n ) (pcase n ("off-on" ;; initially do not break lines (setq break-line 0)) ("on-off" ;; initially break lines (setq break-line 1) (setq-default auto-fill-function 'do-auto-fill)) )) > Sent: Saturday, April 24, 2021 at 11:23 AM > From: michael-franzese@gmx.com > To: "Christopher Dimech" > Cc: "Help Gnu Emacs" > Subject: Re: Strange behaviour of auto-fill > > Actually, when I call (turn-off-auto-fill) after calling > (setq-default auto-fill-function 'do-auto-fill) does tell > turn the mode off. > > > Sent: Saturday, April 24, 2021 at 11:21 AM > > From: "Christopher Dimech" > > To: michael-franzese@gmx.com > > Cc: "Help Gnu Emacs" > > Subject: Re: Strange behaviour of auto-fill > > > > > > Have had another go and noticed that calling > > > > (turn-off-auto-fill) > > > > will not break lines if the following is present > > > > (setq-default auto-fill-function 'do-auto-fill) > > > > My impression would be for developers to take a closer look at the > > code, so that it's use would be simplified. Or perhaps some good > > examples on how to use it, as it does not look so clear to me. > > > > > Sent: Saturday, April 24, 2021 at 9:42 AM > > > From: michael-franzese@gmx.com > > > To: "Help Gnu Emacs" > > > Subject: Strange behaviour of auto-fill > > > > > > I am trying to set "auto-fill", with some tools to change "on-off" b= ehaviour. > > > > > > Things get very confusing. When I comment out "(setq-default auto-f= ill-function 'do-auto-fill)", "auto-fill-mode" will still break comments e= ven though "break-line" is "0" > > > and one sets "(auto-fill-mode 0)". > > > > > > > > > > > > (setq-default auto-fill-function 'do-auto-fill) > > > (defvar break-line 0) > > > > > > (defun break-line-ddd () > > > "Breaks long lines using auto-fill tool." > > > (interactive) > > > > > > (pcase break-line > > > ((or 'nil 0) > > > (setq comment-auto-fill-only-comments nil) > > > (auto-fill-mode 0) > > > (message "%s %s" > > > "Disable: Break line; " break-line) > > > (setq break-line 1)) > > > (1 > > > (setq fill-column 72) > > > (setq comment-auto-fill-only-comments t) > > > (auto-fill-mode 1) > > > (message "%s" "Enable: Break only comments") > > > (setq break-line 2)) > > > (_ > > > (setq comment-auto-fill-only-comments nil) > > > (auto-fill-mode 1) > > > (message "%s" "Enable: Break all long lines") > > > (setq break-line 0)) )) > > > > > > (defun break-line-set () > > > "Breaks long lines using auto-fill." > > > (break-line-ddd) > > > (global-set-key (kbd "H-b") #'break-line-ddd) ) > > > > > > (break-line-set) > > > > > > > > > > > >