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: Cycle Auto-Fill Date: Sat, 5 Dec 2020 15:16:15 +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="33260"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Pankaj Jangid Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 05 15:18:46 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 1klYOb-0008XV-Ov for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 15:18:45 +0100 Original-Received: from localhost ([::1]:33880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1klYOa-0008Du-JM for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 09:18:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klYMI-0008Dj-F7 for help-gnu-emacs@gnu.org; Sat, 05 Dec 2020 09:16:22 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:35597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klYME-0001NU-Ht for help-gnu-emacs@gnu.org; Sat, 05 Dec 2020 09:16:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607177775; bh=vJTuq1nB+vSN3k9IVPH/v5d0WP6vngGMkm+lQU95p58=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=YT+uA+OUPTV7krJ4otbzBDbr5BY0nHGfktXoCDTHwBBo52Tl4g4A3Xjc/alHsj0Ls vIpw+uxw96hK/mslok1XYmnOBjgT/X5Rd1kjuSTNkalvio7Qb1PLssfFfIB3+CUPvi CaFx1U8Slom1POD9Kad/RYfObysr1V6n+gi9Z4Tg= 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-bs04.server.lan [172.19.170.170]) (via HTTP); Sat, 5 Dec 2020 15:16:15 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:8toUQtUVM7+sGrOeyC7zjZmkj1yLPr6bzMsw91ZnncEsY1PvkbajeHNcxy3vd4rHYy44H eAyDxmAtBIBlONN1Jt2NN7ZThKHW5WhHfJhA7EzdgJgpgrA5oNvmwdVIHufYZORuzXaPHVTibNk7 La4xPRY1nLao0myqi56tNxbrTJFeBjDV8ec4zuwiYiTB5zCtSkZN4+Piox+RChoh61o2YILwtCXo s46sLWna7kmk9CfCq8VzbBcwxW0TqKWDytPt5PLN33CQKGsCxH140JpiDsMbdOkVh7tVBpvpdbK4 QM= X-UI-Out-Filterresults: notjunk:1;V03:K0:+ozbo4Ldgh0=:4iG5Bn6eFtEGZCBVCLKc8z AyI72pJ+ib2adGcEGHbJ4QyHetbj+YpHBRn6WtaqquPxKo8lMVlmVP8Tna7xptxt1a/22Ktei A8zqHeYollK/PzDRr4qOoIrurFA/b3qqDzSzB6aidHhRQunh52xI2EQYyhaTszLsejVnz85kA QlZoy0YNK5qxJR+GPc36oT/o1Ur5JNM0l4i+4Y3pPOqeKiFbj9j2/grX8cD1zc8A+Qkj715XG W0TzrUnZNXLlDmM/MV7ylLq+Sd/RHmADpnwklYjOtxqFz4/mdqmxJTPdpR77girjbNzD7Cy56 NJG/zwxWjqATiujMSRk09WTrXtbdHYR8rmt+HUXpNSrrP8DJXS6OLTJLZNZi+RvfTF+xUPwWt C909otJ+cW4KZr6TSyXsAQulmTpBuONniodubZaBya3IaYxxQBzOEm6uBvduxgj2CPJkcPGq5 9VSqrtqkR1ccq04jJVOzuDSA91xpLmbDDbIUeVYMEq6teoExXVF0zXbsLb+kLygtaWRBHjrAU /EczQDV6bZZuQp1xV/xQJkermX39XWptSbX1JMl5CW95poTnXVpnDsqq8Pz2EHflfqJfDscTL HVl41Ylgn/MDI= Received-SPF: pass client-ip=212.227.15.18; envelope-from=dimech@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:126025 Archived-At: The change gives the error. Although the modified version looks reasonabl= e to me. Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) =3D(nil 2) > Sent: Saturday, December 05, 2020 at 2:59 PM > From: "Pankaj Jangid" > To: "Christopher Dimech" > Cc: "Help Gnu Emacs" > Subject: Re: Cycle Auto-Fill > > Christopher Dimech writes: > > > (defun gungadin-auto-fill-cycle () > > "Cycles Auto Fill. Automatically breaks lines that get beyond > > variable fill-column." > > (interactive) > > - (unless (get 'gungadin-auto-fill-cycle 'state) > - (put 'gungadin-auto-fill-cycle 'state 1)) > > > > > (setq n (get 'gungadin-auto-fill-cycle 'state)) > > > > - (when (=3D n 1) > + (when (or (not n) (=3D n 1)) > > > (message "Auto Fill Comments Only") > > (set (make-local-variable 'comment-auto-fill-only-comments) t) > > (auto-fill-mode 1) > > (put 'gungadin-auto-fill-cycle 'state 2)) > > (when (=3D n 2) > > (message "Auto Fill Buffer") > > (set (make-local-variable 'comment-auto-fill-only-comments) nil) > > (put 'gungadin-auto-fill-cycle 'state 3)) > > (when (=3D n 3) > > (message "Disable Auto Fill") > > (auto-fill-mode 0) > > (put 'gungadin-auto-fill-cycle 'state 1)) ) > > > > (global-set-key (kbd "H-a") #'gungadin-auto-fill-cycle) > > Will this work? > > Removed one (get) call and a conditional test. Added one conditional > test. >