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: problem with "comment-auto-fill-only-comments" Date: Sat, 30 Jan 2021 13:51:15 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38771"; mail-complaints-to="usenet@ciao.gmane.io" To: Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 30 13:51:50 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 1l5pjC-0009zQ-DQ for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 30 Jan 2021 13:51:50 +0100 Original-Received: from localhost ([::1]:34800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5pjB-00037L-9m for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 30 Jan 2021 07:51:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5pii-00037A-9j for help-gnu-emacs@gnu.org; Sat, 30 Jan 2021 07:51:20 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:49105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5pig-0003N5-5V for help-gnu-emacs@gnu.org; Sat, 30 Jan 2021 07:51:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612011075; bh=Fbg2j7HdaCOrizAVj02PsFp6X++nzBtuBnJTau9em4I=; h=X-UI-Sender-Class:From:To:Subject:Date; b=D4QHiZ6ZSJAzcm42H73imCUeyyleIKANZKbn42R95O4gXpb69IJbzFQViN5TY2I5h oH55ofof1MyQvbJbvzSeCplZM54kGFgVMedIrGEanFI5e9/26m53+jXcvUlSLDSqBE 33dpkpXjejZa9yUeoNFXpghcLGOyTZ4Pcz74Db1I= 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); Sat, 30 Jan 2021 13:51:15 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:84mqItFdCK+LJ3A35wamq8mGkrucEAdf/pmBjrS0eg5WlScLRe4om0wWum8CaNyTcimpS 5eq6GFol13vPyOJn5o7hXDb/lbWnfrtrxuIyw7fsKhEWjV5XHb3jyiTd1GAPQW8SnoTWPsJscpLQ /jj3AFSBVmF+SLkGxZYdeddFRNHeOYxGgre8PSKl3A8Qir56FRRL/7LHxpQYn9sGdHn2388ebCqY jwOMlEb93HvVPVRnx71ink8xoXcM4AajLwou589ZMslOu08CePinNuOu6/Dy4Wkajg7db3lMfI1K j8= X-UI-Out-Filterresults: notjunk:1;V03:K0:MtQB6QwquWI=:XxMILvtZFvF39REw8t8BCj HdwTMshQlBfhe+gr4riMV9rJExuhgG0GmMNXvsdqOd2RD8EsiB3R6dTQ3geoSaVN1qboZmuC/ eVKJ7W91HChnTf9oRCi9CUzqcD7aG6TeDdm+su6igm6XPybVqRMIcoMxpgu0t3NcHqdWNfsah ELfHV7aJCRxA0+6WVM8mbW1K7aalt+wTj26XAl8XtvGTPQGaDxmaPEdLL6JPiVMRu34Q8I1HN S/WIA3k9yV5E3qYke1n3XPAap9lzAz69YBCp8jzvKYHHI8lo3oL56Cgu6klQck5Pg7st1lauB n06MPvfMHaXycfZyFnp/aTzc3ziCnLOgCZdIsmoJkq03DGyfbqAhakoympqb3O9ijIbvqiueS dMyTr5mpuSOtHEMWOsUipRY+cJY9ygXB4tYhGfCZGsYzvuQFqg6x9loJRFAByQsh7uRiRhqxc xs3PCp7b1Hf89APgRYiwZVhSjRbFmCaT+DS0GX3ENr/7v1tn22mG5HfVs61IhGxApoFbbi1EJ wQsC3EOaZ5NCh23LP/gmLQ3uTGL1yj4UMiMuqwGDAT/4Tg4/XDNxM5us3QZX29mlxPZ7lqNNI oVhBbw9lmhuf9LCMkl0uqQkLUWiaQ8bgES Received-SPF: pass client-ip=212.227.17.21; envelope-from=michael-franzese@gmx.com; helo=mout.gmx.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:127442 Archived-At: I am having problem with the following code. I cannot locate the problem though. ;; Break lines using auto-fill made. (defun break-comments-din () "Break lines when they exceed a specific character length." (setq-local comment-auto-fill-only-comments t)) (defvar dfv-break-comments-state nil) ;; Cycles line breaking tool (defun cycle-break-comments-din () "Break comments in programming languages." (pcase dfv-break-comments-state ;; (1 (auto-fill-mode 1) (add-hook 'sh-mode-hook #'break-comments-din) (add-hook 'fortran-mode-hook #'break-comments-din) (add-hook 'emacs-lisp-mode-hook #'break-comments-din) (add-hook 'c-mode-hook #'break-comments-din) (add-hook 'c++-mode-hook #'break-comments-din) (add-hook 'awk-mode-hook #'break-comments-din) (add-hook 'R-mode-hook #'break-comments-din) (add-hook 'octave-mode-hook #'break-comments-din) (setq dfv-break-comments-state 2) (message "%s" "Enable: Break comments")) ;; (2 (auto-fill-mode 0) (setq dfv-break-comments-state 0) (message "%s" "Disable: Break comments")) ;; (_ (auto-fill-mode 1) (add-hook 'prog-mode-hook #'break-comments-din) (setq dfv-break-comments-state 1) (message "%s" "Break comments using prog-mode-hook")) ) ;; Break comments Keybinding for breaking comments using Auto Fill (add-hook 'texinfo-mode-hook #'break-comment-din) (add-hook 'text-mode-hook #'break-comment-din) (global-set-key (kbd "C-c q") #'break-comment-din) )