From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#47128: 28.0.50; Be more helpful regarding message-syntax-checks Date: Sat, 13 Mar 2021 14:38:56 -0800 Message-ID: <87k0qasmpr.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40344"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 47128@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 13 23:40:26 2021 Return-path: Envelope-to: geb-bug-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 1lLCvp-000AJb-4G for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 23:40:25 +0100 Original-Received: from localhost ([::1]:36540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLCvm-0001A3-Hw for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 17:40:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLCvR-00019A-Tl for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 17:40:01 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLCvR-0001RV-Lv for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 17:40:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lLCvR-000241-K5 for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 17:40:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Mar 2021 22:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47128 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16156751567876 (code B ref -1); Sat, 13 Mar 2021 22:40:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Mar 2021 22:39:16 +0000 Original-Received: from localhost ([127.0.0.1]:60877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLCui-00022x-3B for submit@debbugs.gnu.org; Sat, 13 Mar 2021 17:39:16 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:38122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLCud-00022m-HY for submit@debbugs.gnu.org; Sat, 13 Mar 2021 17:39:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLCud-00014D-AR for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 17:39:11 -0500 Original-Received: from ericabrahamsen.net ([52.70.2.18]:60652 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLCua-0000yV-Og for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 17:39:11 -0500 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id BBA32FA0FB for ; Sat, 13 Mar 2021 22:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1615675140; bh=bBJIuIrZKAJDdI84Ih524PJoYyNlpoIB6HtbpStVX9E=; h=From:To:Subject:Date:From; b=u/b6JD5EQBwDhtTorp3j2y7kAsoUaJFygrxn4rtNOCSCBg/5UyM585iHR20veQ0PX 7eLhetKEgZObMmDX0XiadEejjUqsqPgzMi9igJm1GonRP9xQuI5iFbUk1heioFBp46 QvpN66vMKeJ/BKBHTsC/vtcYCaONXkrZe6GP5q+g= Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:202317 Archived-At: --=-=-= Content-Type: text/plain The `message-syntax-checks' option doesn't have a very useful customization :type, and the manual section explaining what it does isn't in the most obvious spot. This patch moves the manual explanation from "News Headers" to the more general "Message Headers" section, as the option governs both mail and news. It also expands the :type definition to explicitly list all the possible options. The defcustom originally had two comments on it, one saying "Guess this one shouldn't be easy to customize...", and another on the :type line saying "improve this". That seems a bit contradictory. Anyway, I don't see the point of actually obfuscating the use of this option; this patch should make it a little more discoverable. What would be even better is to obsolete this in favor of a new `message-disabled-syntax-checks' option that was simply a plain list of symbols. Eric --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Improvements-to-message-syntax-checks-docs-and-optio.patch >From e9c6ce1195200916f1ce4ee428ca1379de4d4f44 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sat, 13 Mar 2021 14:25:47 -0800 Subject: [PATCH] Improvements to message-syntax-checks docs and options * doc/misc/message.texi: Move the manual entry from the "News Headers" section to the "Message Headers" section, as it is generally applicable, not just to News. * lisp/gnus/message.el (message-syntax-checks): Add an explicit alist type specifying the valid options; point to the manual for more information. --- doc/misc/message.texi | 163 +++++++++++++++++++++--------------------- lisp/gnus/message.el | 22 +++--- 2 files changed, 94 insertions(+), 91 deletions(-) diff --git a/doc/misc/message.texi b/doc/misc/message.texi index 1497c710e4..d2353e6cec 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi @@ -1792,8 +1792,89 @@ Message Headers @code{message-carefully-insert-headers} will not insert a @code{To} header when the message is already @code{CC}ed to the recipient. +@item message-syntax-checks +@vindex message-syntax-checks +Controls what syntax checks should not be performed on outgoing posts. +To disable checking of long signatures, for instance, add + +@lisp +(signature . disabled) +@end lisp + +to this list. + +Valid checks are: + +@table @code +@item approved +@cindex approved +Check whether the article has an @code{Approved} header, which is +something only moderators should include. +@item continuation-headers +Check whether there are continuation header lines that don't begin with +whitespace. +@item control-chars +Check for invalid characters. +@item empty +Check whether the article is empty. +@item existing-newsgroups +Check whether the newsgroups mentioned in the @code{Newsgroups} and +@code{Followup-To} headers exist. +@item from +Check whether the @code{From} header seems nice. +@item illegible-text +Check whether there is any non-printable character in the body. +@item invisible-text +Check whether there is any invisible text in the buffer. +@item long-header-lines +Check for too long header lines. +@item long-lines +@cindex long lines +Check for too long lines in the body. +@item message-id +Check whether the @code{Message-ID} looks syntactically ok. +@item multiple-headers +Check for the existence of multiple equal headers. +@item new-text +Check whether there is any new text in the messages. +@item newsgroups +Check whether the @code{Newsgroups} header exists and is not empty. +@item quoting-style +Check whether text follows last quoted portion. +@item repeated-newsgroups +Check whether the @code{Newsgroups} and @code{Followup-To} headers +contains repeated group names. +@item reply-to +Check whether the @code{Reply-To} header looks ok. +@item sender +@cindex Sender +Insert a new @code{Sender} header if the @code{From} header looks odd. +@item sendsys +@cindex sendsys +Check for the existence of version and sendsys commands. +@item shoot +Check whether the domain part of the @code{Message-ID} header looks ok. +@item shorten-followup-to +Check whether to add a @code{Followup-To} header to shorten the number +of groups to post to. +@item signature +Check the length of the signature. +@item size +Check for excessive size. +@item subject +Check whether the @code{Subject} header exists and is not empty. +@item subject-cmsg +Check the subject for commands. +@item valid-newsgroups +Check whether the @code{Newsgroups} and @code{Followup-To} headers +are valid syntactically. @end table +All these conditions are checked by default, except for @code{sender} +for which the check is disabled by default if +@code{message-insert-canlock} is non-@code{nil} (@pxref{Canceling News}). + +@end table @node Mail Headers @section Mail Headers @@ -2072,88 +2153,6 @@ News Headers @table @code -@item message-syntax-checks -@vindex message-syntax-checks -Controls what syntax checks should not be performed on outgoing posts. -To disable checking of long signatures, for instance, add - -@lisp -(signature . disabled) -@end lisp - -to this list. - -Valid checks are: - -@table @code -@item approved -@cindex approved -Check whether the article has an @code{Approved} header, which is -something only moderators should include. -@item continuation-headers -Check whether there are continuation header lines that don't begin with -whitespace. -@item control-chars -Check for invalid characters. -@item empty -Check whether the article is empty. -@item existing-newsgroups -Check whether the newsgroups mentioned in the @code{Newsgroups} and -@code{Followup-To} headers exist. -@item from -Check whether the @code{From} header seems nice. -@item illegible-text -Check whether there is any non-printable character in the body. -@item invisible-text -Check whether there is any invisible text in the buffer. -@item long-header-lines -Check for too long header lines. -@item long-lines -@cindex long lines -Check for too long lines in the body. -@item message-id -Check whether the @code{Message-ID} looks syntactically ok. -@item multiple-headers -Check for the existence of multiple equal headers. -@item new-text -Check whether there is any new text in the messages. -@item newsgroups -Check whether the @code{Newsgroups} header exists and is not empty. -@item quoting-style -Check whether text follows last quoted portion. -@item repeated-newsgroups -Check whether the @code{Newsgroups} and @code{Followup-To} headers -contains repeated group names. -@item reply-to -Check whether the @code{Reply-To} header looks ok. -@item sender -@cindex Sender -Insert a new @code{Sender} header if the @code{From} header looks odd. -@item sendsys -@cindex sendsys -Check for the existence of version and sendsys commands. -@item shoot -Check whether the domain part of the @code{Message-ID} header looks ok. -@item shorten-followup-to -Check whether to add a @code{Followup-To} header to shorten the number -of groups to post to. -@item signature -Check the length of the signature. -@item size -Check for excessive size. -@item subject -Check whether the @code{Subject} header exists and is not empty. -@item subject-cmsg -Check the subject for commands. -@item valid-newsgroups -Check whether the @code{Newsgroups} and @code{Followup-To} headers -are valid syntactically. -@end table - -All these conditions are checked by default, except for @code{sender} -for which the check is disabled by default if -@code{message-insert-canlock} is non-@code{nil} (@pxref{Canceling News}). - @item message-ignored-news-headers @vindex message-ignored-news-headers Regexp of headers to be removed before posting. The default is@* diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 1e0362a3bf..3eaf8ed162 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -186,22 +186,26 @@ message-insert-canlock (defcustom message-syntax-checks (if message-insert-canlock '((sender . disabled)) nil) - ;; Guess this one shouldn't be easy to customize... "Controls what syntax checks should not be performed on outgoing posts. To disable checking of long signatures, for instance, add `(signature . disabled)' to this list. Don't touch this variable unless you really know what you're doing. -Checks include `approved', `bogus-recipient', `continuation-headers', -`control-chars', `empty', `existing-newsgroups', `from', `illegible-text', -`invisible-text', `long-header-lines', `long-lines', `message-id', -`multiple-headers', `new-text', `newsgroups', `quoting-style', -`repeated-newsgroups', `reply-to', `sender', `sendsys', `shoot', -`shorten-followup-to', `signature', `size', `subject', `subject-cmsg' -and `valid-newsgroups'." +See the Message manual for the meanings of the valid syntax check +types." :group 'message-news - :type '(repeat sexp)) ; Fixme: improve this + :link '(custom-manual "(message)Message Headers") + :type '(alist + :key-type symbol + :value-type (const disabled) + :options (approved bogus-recipient continuation-headers + control-chars empty existing-newsgroups from illegible-text + invisible-text long-header-lines long-lines message-id + multiple-headers new-text newgroups quoting-style + repeated-newsgroups reply-to sender sendsys shoot + shorten-followup-to signature size subject subject-cmsg + valid-newsgroups))) (defcustom message-required-headers '((optional . References) From) -- 2.30.1 --=-=-=--