Subject: bug#66196: 30.0.50; Address defcustom :type warnings

From: "Basil L. Contovounesios" <[email-masked]>
Date: Mon, 25 Sep 2023 21:25:33 +0200

Severity: minor
Tags: patch

Building master, I see the following (abridged) warnings:

     diary-lib.el: ‘diary-display-function’     : misplaced :tag keyword in ‘const’ type
     icalendar.el: ‘icalendar-export-alarms’    : misplaced :tag keyword in ‘const’ type
         elint.el: ‘elint-ignored-warnings’     : misplaced :tag keyword in ‘const’ type
     mm-decode.el: ‘mm-text-html-renderer’      : misplaced :tag keyword in ‘const’ type
       message.el: ‘message-send-mail-function’ : misplaced :tag keyword in ‘function-item’ type
                   ‘message-tool-bar’           : duplicated :type keyword argument
      sendmail.el: ‘send-mail-function’         : misplaced :tag keyword in ‘function-item’ type
        gnutls.el: ‘gnutls-verify-error’        : misplaced :tag keyword in ‘const’ type
       idlwave.el: ‘idlwave-begin-line-comment’ : type should not be quoted: regexp
       ps-mode.el: ‘ps-mode-paper-size’         : duplicated value in ‘choice’: ‘(612 936)’
glyphless-mode.el: ‘glyphless-mode-types’       : duplicated value in ‘choice’: ‘no-font’

The warnings appear only on master, but their underlying cause can be
fixed on emacs-29.

Is the attached patch okay for emacs-29?

Thanks,
-- 
Basil

>From 24a93c1cd6583b94cfcb178a8cf2eefedbf8922e Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email-masked]>
Date: Mon, 25 Sep 2023 20:38:23 +0200
Subject: [PATCH] Address defcustom :type warnings

* lisp/calendar/diary-lib.el (diary-display-function):
* lisp/calendar/icalendar.el (icalendar-export-alarms):
* lisp/emacs-lisp/elint.el (elint-ignored-warnings):
* lisp/mail/sendmail.el (send-mail-function):
* lisp/net/gnutls.el (gnutls-verify-error):
* lisp/gnus/mm-decode.el (mm-text-html-renderer):
* lisp/gnus/message.el (message-send-mail-function): Fix misplaced
defcustom :tags.
(message-tool-bar): Remove duplicate, overwritten, and nonexistent
defcustom :type gmm-tool-bar-list-item.
* lisp/progmodes/idlwave.el (idlwave-begin-line-comment): Strip
excessive defcustom :type quoting.
* lisp/progmodes/ps-mode.el (ps-mode-paper-size): Consolidate paper
sizes with same dimensions into a single defcustom menu entry.
* lisp/textmodes/glyphless-mode.el (glyphless-mode-types): Remove
duplicate defcustom :type choice.
---
 lisp/calendar/diary-lib.el       |  4 ++--
 lisp/calendar/icalendar.el       |  4 ++--
 lisp/emacs-lisp/elint.el         | 20 ++++++++++----------
 lisp/gnus/message.el             |  9 +++------
 lisp/gnus/mm-decode.el           |  6 +++---
 lisp/mail/sendmail.el            | 10 +++++-----
 lisp/net/gnutls.el               |  2 +-
 lisp/progmodes/idlwave.el        |  2 +-
 lisp/progmodes/ps-mode.el        |  6 ++----
 lisp/textmodes/glyphless-mode.el |  1 -
 10 files changed, 29 insertions(+), 35 deletions(-)

diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 44fb5eb5a86..ab40301a05b 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -167,8 +167,8 @@ diary-display-function
 entry for the given date.  This can be used, for example, to
 produce a different buffer for display (perhaps combined with
 holidays), or hard copy output."
-  :type '(choice (const diary-fancy-display :tag "Fancy display")
-                 (const diary-simple-display :tag "Basic display")
+  :type '(choice (const :tag "Fancy display" diary-fancy-display)
+                 (const :tag "Basic display" diary-simple-display)
                  (const :tag "No display" ignore)
                  (function :tag "User-specified function"))
   :initialize 'custom-initialize-default
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index e51251d6d9f..51e6a7d1170 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -276,9 +276,9 @@ icalendar-export-alarms
                                 :value 10)
                        (set :tag "Alarm type"
                             (list :tag "Audio"
-                                  (const audio :tag "Audio"))
+                                  (const :tag "Audio" audio))
                             (list :tag "Display"
-                                  (const display :tag "Display"))
+                                  (const :tag "Display" display))
                             (list :tag "Email"
                                   (const email)
                                   (repeat :tag "Attendees"
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index 9812c663ea8..700f007d6b4 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -79,16 +79,16 @@ elint-ignored-warnings
   empty-let           - let-bindings with empty variable lists"
   :type '(choice (const :tag "Don't suppress any warnings" nil)
 		 (repeat :tag "List of issues to ignore"
-			 (choice (const undefined-functions
-					:tag "Calls to unknown functions")
-				 (const unbound-reference
-					:tag "Reference to unknown variables")
-				 (const unbound-assignment
-					:tag "Assignment to unknown variables")
-				 (const macro-expansion
-					:tag "Failure to expand macros")
-				 (const empty-let
-					:tag "Let-binding with empty varlist"))))
+                         (choice (const :tag "Calls to unknown functions"
+                                        undefined-functions)
+                                 (const :tag "Reference to unknown variables"
+                                        unbound-reference)
+                                 (const :tag "Assignment to unknown variables"
+                                        unbound-assignment)
+                                 (const :tag "Failure to expand macros"
+                                        macro-expansion)
+                                 (const :tag "Let-binding with empty varlist"
+                                        empty-let))))
   :safe (lambda (value) (or (null value)
 			    (and (listp value)
 				 (equal value
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index b0407cc12eb..5b9ce60497c 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -747,16 +747,14 @@ message-send-mail-function
 `message-send-mail-function'.
 
 See also `send-mail-function'."
-  :type '(radio (function-item message--default-send-mail-function
-		               :tag "Use send-mail-function")
+  :type '(radio (function-item message--default-send-mail-function)
 		(function-item message-send-mail-with-sendmail)
 		(function-item message-send-mail-with-mh)
 		(function-item message-send-mail-with-qmail)
 		(function-item message-smtpmail-send-it)
-		(function-item smtpmail-send-it)
+                (function-item :doc "Use SMTPmail package." smtpmail-send-it)
 		(function-item feedmail-send-it)
-		(function-item message-send-mail-with-mailclient
-			       :tag "Use Mailclient package")
+                (function-item message-send-mail-with-mailclient)
  		(function :tag "Other"))
   :group 'message-sending
   :version "27.1"
@@ -8210,7 +8208,6 @@ message-tool-bar
 It can be either a list or a symbol referring to a list.  See
 `gmm-tool-bar-from-list' for the format of the list.  The
 default key map is `message-mode-map'."
-  :type '(repeat gmm-tool-bar-list-item)
   :type '(choice (repeat :tag "User defined list" gmm-tool-bar-item)
 		 (symbol))
   :version "29.1"
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index b9beedf6c5c..3c7d1e7e073 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -119,7 +119,7 @@ mm-text-html-renderer
 	((executable-find "links") 'links)
         ((executable-find "lynx") 'lynx)
         (t 'shr))
-  "Render of HTML contents.
+  "Renderer of HTML contents.
 It is one of defined renderer types, or a rendering function.
 The defined renderer types are:
 `shr': use the built-in Gnus HTML renderer;
@@ -131,8 +131,8 @@ mm-text-html-renderer
   :version "29.1"
   :type '(choice (const shr)
                  (const gnus-w3m)
-                 (const w3m :tag "emacs-w3m")
-		 (const w3m-standalone :tag "standalone w3m" )
+                 (const :tag "emacs-w3m" w3m)
+                 (const :tag "standalone w3m" w3m-standalone)
 		 (const links)
 		 (const lynx)
 		 (function))
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 8d7e90ccacf..8306bd3b30c 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -151,11 +151,11 @@ send-mail-function
 that matches the variable `mail-header-separator'.
 This is used by the default mail-sending commands.  See also
 `message-send-mail-function' for use with the Message package."
-  :type '(radio (function-item sendmail-send-it :tag "Use Sendmail package")
-		(function-item sendmail-query-once :tag "Query the user")
-		(function-item smtpmail-send-it :tag "Use SMTPmail package")
-		(function-item feedmail-send-it :tag "Use Feedmail package")
-		(function-item mailclient-send-it :tag "Use Mailclient package")
+  :type '(radio (function-item sendmail-send-it)
+                (function-item sendmail-query-once)
+                (function-item :doc "Use SMTPmail package." smtpmail-send-it)
+                (function-item feedmail-send-it)
+                (function-item mailclient-send-it)
 		function)
   :version "24.1")
 
diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el
index f7361f38130..375659bd8ca 100644
--- a/lisp/net/gnutls.el
+++ b/lisp/net/gnutls.el
@@ -96,7 +96,7 @@ gnutls-verify-error
           (repeat :tag "List of hostname regexps with flags for each"
            (list
             (choice :tag "Hostname"
-                    (const ".*" :tag "Any hostname")
+                    (const :tag "Any hostname" ".*")
                     regexp)
             (set (const :trustfiles)
                  (const :hostname))))))
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 0b5ed93068a..3076f51832f 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -309,7 +309,7 @@ idlwave-begin-line-comment
 the line should begin with \"^\"."
   :group 'idlwave-code-formatting
   :type '(choice (const :tag "Any line beginning with `;'" nil)
-		 'regexp))
+                 regexp))
 
 (defcustom idlwave-code-comment ";;[^;]"
   "A comment that starts with this regular expression on a line by
diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el
index 1147db816bb..01a075d6512 100644
--- a/lisp/progmodes/ps-mode.el
+++ b/lisp/progmodes/ps-mode.el
@@ -97,11 +97,9 @@ ps-mode-paper-size
 	  (const :tag "archC"       (1296 1728))
 	  (const :tag "archB"        (864 1296))
 	  (const :tag "archA"        (648  864))
-	  (const :tag "flsa"         (612  936))
-	  (const :tag "flse"         (612  936))
+          (const :tag "flsa, flse"   (612  936))
 	  (const :tag "halfletter"   (396  612))
-	  (const :tag "11x17"        (792 1224))
-	  (const :tag "tabloid"      (792 1224))
+          (const :tag "11x17, tabloid" (792 1224))
 	  (const :tag "ledger"      (1224  792))
 	  (const :tag "csheet"      (1224 1584))
 	  (const :tag "dsheet"      (1584 2448))
diff --git a/lisp/textmodes/glyphless-mode.el b/lisp/textmodes/glyphless-mode.el
index 99bbb2769e4..eb4447f3048 100644
--- a/lisp/textmodes/glyphless-mode.el
+++ b/lisp/textmodes/glyphless-mode.el
@@ -30,7 +30,6 @@ glyphless-mode-types
 `all', for all glyphless characters."
   :version "29.1"
   :type '(repeat (choice (const :tag "All" all)
-                         (const :tag "No font" no-font)
                          (const :tag "C0 Control" c0-control)
                          (const :tag "C1 Control" c1-control)
                          (const :tag "Format Control" format-control)
-- 
2.40.1

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.17.8, Xaw3d scroll bars) of 2023-09-21 built on tia
Repository revision: 57c6c067d35e519bc3787966cd6346904bc75e16
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Debian GNU/Linux trixie/sid

Configured using:
 'configure 'CFLAGS=-O2 -ggdb3' -C --prefix=/home/blc/.local
 --enable-checking=structs --with-file-notification=yes
 --with-x-toolkit=lucid --with-x'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM
LUCID ZLIB

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty move-toolbar make-network-process emacs)

Memory information:
((conses 16 38028 9284) (symbols 48 5209 0) (strings 32 14018 1699)
 (string-bytes 1 384875) (vectors 16 10297)
 (vector-slots 8 156208 14956) (floats 8 23 23) (intervals 56 259 0)
 (buffers 992 10))