all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#58319: 29.0.50; Not logical compilation warnings
@ 2022-10-05 18:25 Jean Louis
  2022-10-06  5:33 ` Eli Zaretskii
  2022-10-06 10:54 ` Mattias Engdegård
  0 siblings, 2 replies; 8+ messages in thread
From: Jean Louis @ 2022-10-05 18:25 UTC (permalink / raw)
  To: 58319


I am testing new function M-x emacs-lisp-native-compile-and-load
and I can see some new warnings that I have not seen before.

These warnings are not enlightening neither helpful.

It is not clear what the sign + after number means. It is unclear if it
means "5 and more" or "more than five". That sign is not helpful.

To me it looks same 5+ and 5-10, as both mean to me that it is 5 and
more arguments. But maybe author wants to say what it should mean.

In rcd-db-report:
rcd-cf.el:365:8: Warning: function rcd-db-report used to take 5+ arguments,
    now takes 5-10

In cf-address-add:
rcd-cf.el:956:8: Warning: function cf-address-add used to take 0+ arguments,
    now takes 0-10

In cf-people-relations-add:
rcd-cf.el:3351:8: Warning: function cf-people-relations-add used to take 0+
    arguments, now takes 0-19



In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.17.6, Xaw3d scroll bars) of 2022-10-05 built on
 protected.rcdrun.com
Repository revision: 9449e0740cd97bbcdbaeb4713dc2dd51e65994fd
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Parabola GNU/Linux-libre

Configured using:
 'configure --with-x-toolkit=lucid --with-native-compilation'

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

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: @im=exwm-xim
  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
  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 mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra
help-mode bytecomp byte-compile cconv cl-lib sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip eldoc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel term/x-win x-win term/common-win x-dnd 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
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 make-network-process native-compile emacs)

Memory information:
((conses 16 79594 8370)
 (symbols 48 7181 0)
 (strings 32 20866 1702)
 (string-bytes 1 622658)
 (vectors 16 16150)
 (vector-slots 8 279952 10661)
 (floats 8 29 30)
 (intervals 56 277 0)
 (buffers 1000 13))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58319: 29.0.50; Not logical compilation warnings
  2022-10-05 18:25 bug#58319: 29.0.50; Not logical compilation warnings Jean Louis
@ 2022-10-06  5:33 ` Eli Zaretskii
  2022-10-06 10:06   ` Jean Louis
  2022-10-06 10:54 ` Mattias Engdegård
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2022-10-06  5:33 UTC (permalink / raw)
  To: Jean Louis; +Cc: 58319

> From: "Jean Louis" <bugs@rcdrun.com>
> Date: Wed, 05 Oct 2022 21:25:00 +0300
> 
> 
> I am testing new function M-x emacs-lisp-native-compile-and-load
> and I can see some new warnings that I have not seen before.

The aspects of the warnings you are asking about have nothing to do
with native-compilation, the warnings are emitted by the byte
compiler.

> These warnings are not enlightening neither helpful.

Maybe you need to get used to what they say, that's all.

> It is not clear what the sign + after number means. It is unclear if it
> means "5 and more" or "more than five". That sign is not helpful.

It means 5 or more.  Usually, it means the function's signature has 5
mandatory arguments and then something like "&rest args".

> To me it looks same 5+ and 5-10, as both mean to me that it is 5 and
> more arguments. But maybe author wants to say what it should mean.

Emacs can only say "5-10" when the function uses &optional, because
only in that case it is possible to know how many more can follow.

I think this format of warnings exists since about forever.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58319: 29.0.50; Not logical compilation warnings
  2022-10-06  5:33 ` Eli Zaretskii
@ 2022-10-06 10:06   ` Jean Louis
  0 siblings, 0 replies; 8+ messages in thread
From: Jean Louis @ 2022-10-06 10:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 58319

* Eli Zaretskii <eliz@gnu.org> [2022-10-06 08:35]:
> > From: "Jean Louis" <bugs@rcdrun.com>
> > Date: Wed, 05 Oct 2022 21:25:00 +0300
> > 
> > 
> > I am testing new function M-x emacs-lisp-native-compile-and-load
> > and I can see some new warnings that I have not seen before.
> 
> The aspects of the warnings you are asking about have nothing to do
> with native-compilation, the warnings are emitted by the byte
> compiler.

Thanks, I get understanding.

> > These warnings are not enlightening neither helpful.
> 
> Maybe you need to get used to what they say, that's all.

Of course I can get used to less meaningful expression, but I protest
against such.

> > It is not clear what the sign + after number means. It is unclear if it
> > means "5 and more" or "more than five". That sign is not helpful.
> 
> It means 5 or more.  Usually, it means the function's signature has 5
> mandatory arguments and then something like "&rest args".

> > To me it looks same 5+ and 5-10, as both mean to me that it is 5 and
> > more arguments. But maybe author wants to say what it should mean.
> 
> Emacs can only say "5-10" when the function uses &optional, because
> only in that case it is possible to know how many more can follow.
> 
> I think this format of warnings exists since about forever.

That means when it says "5-10" that it is limited to 10, and "5+"
means it is not limited to how many arguments it can take.

That meaning is not clearly expressed, it is something only insiders
know.

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58319: 29.0.50; Not logical compilation warnings
  2022-10-05 18:25 bug#58319: 29.0.50; Not logical compilation warnings Jean Louis
  2022-10-06  5:33 ` Eli Zaretskii
@ 2022-10-06 10:54 ` Mattias Engdegård
  2022-10-06 12:22   ` Lars Ingebrigtsen
  2022-10-07 10:58   ` Jean Louis
  1 sibling, 2 replies; 8+ messages in thread
From: Mattias Engdegård @ 2022-10-06 10:54 UTC (permalink / raw)
  To: 58319; +Cc: Eli Zaretskii, Stefan Monnier, Jean Louis

[-- Attachment #1: Type: text/plain, Size: 692 bytes --]

The warnings not being "logical" is of course nonsense, but I actually agree that '5+' is a tad on the obscure side. This is a human-facing message and we can be nicer: either '5 or more' or 'at least 5' would be clearer.

'5-10' is not quite as problematic. 'from 5 to 10' would probably do, and 'between 5 and 10' is better but also worse since it could be misinterpreted as the set {6..9} unless we append ' inclusive'. No strong opinion here.

As a special case, '5-6' is always better written as '5 or 6'.

I've looked through the various contexts where the messages appear and the patch below (which keeps 'X-Y') should be an improvement in all cases. Anyone strongly against?


[-- Attachment #2: arity-warning-message.diff --]
[-- Type: application/octet-stream, Size: 693 bytes --]

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 03c45e44a5..74ba8984f2 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1469,9 +1469,11 @@ byte-compile-arglist-signatures-congruent-p
 
 (defun byte-compile-arglist-signature-string (signature)
   (cond ((null (cdr signature))
-	 (format "%d+" (car signature)))
+	 (format "%d or more" (car signature)))
 	((= (car signature) (cdr signature))
 	 (format "%d" (car signature)))
+	((= (1+ (car signature)) (cdr signature))
+	 (format "%d or %d" (car signature) (cdr signature)))
 	(t (format "%d-%d" (car signature) (cdr signature)))))
 
 (defun byte-compile-function-warn (f nargs def)

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#58319: 29.0.50; Not logical compilation warnings
  2022-10-06 10:54 ` Mattias Engdegård
@ 2022-10-06 12:22   ` Lars Ingebrigtsen
  2022-10-07 11:00     ` Jean Louis
  2022-10-07 12:07     ` Mattias Engdegård
  2022-10-07 10:58   ` Jean Louis
  1 sibling, 2 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-10-06 12:22 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Eli Zaretskii, Jean Louis, Stefan Monnier, 58319

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

> I've looked through the various contexts where the messages appear and
> the patch below (which keeps 'X-Y') should be an improvement in all
> cases. Anyone strongly against?

I think your change looks like an improvement -- it clarifies without
making the warnings substantially longer.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58319: 29.0.50; Not logical compilation warnings
  2022-10-06 10:54 ` Mattias Engdegård
  2022-10-06 12:22   ` Lars Ingebrigtsen
@ 2022-10-07 10:58   ` Jean Louis
  1 sibling, 0 replies; 8+ messages in thread
From: Jean Louis @ 2022-10-07 10:58 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Eli Zaretskii, Stefan Monnier, 58319

* Mattias Engdegård <mattias.engdegard@gmail.com> [2022-10-06 13:56]:
> The warnings not being "logical" is of course nonsense, but I
> actually agree that '5+' is a tad on the obscure side. This is a
> human-facing message and we can be nicer: either '5 or more' or 'at
> least 5' would be clearer.

Good.

But it should be something like:

- 5 or more without limit
- 5 to maximum 10

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58319: 29.0.50; Not logical compilation warnings
  2022-10-06 12:22   ` Lars Ingebrigtsen
@ 2022-10-07 11:00     ` Jean Louis
  2022-10-07 12:07     ` Mattias Engdegård
  1 sibling, 0 replies; 8+ messages in thread
From: Jean Louis @ 2022-10-07 11:00 UTC (permalink / raw)
  To: Lars Ingebrigtsen
  Cc: Mattias Engdegård, 58319, Eli Zaretskii, Stefan Monnier

* Lars Ingebrigtsen <larsi@gnus.org> [2022-10-06 16:06]:
> Mattias Engdegård <mattias.engdegard@gmail.com> writes:
> 
> > I've looked through the various contexts where the messages appear and
> > the patch below (which keeps 'X-Y') should be an improvement in all
> > cases. Anyone strongly against?
> 
> I think your change looks like an improvement -- it clarifies without
> making the warnings substantially longer.

Cutting the meaning for purpose of making warnings shorter is
detrimental.

Warnings are for human and they are not stored anywhere. You waste no
hard disk space.

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58319: 29.0.50; Not logical compilation warnings
  2022-10-06 12:22   ` Lars Ingebrigtsen
  2022-10-07 11:00     ` Jean Louis
@ 2022-10-07 12:07     ` Mattias Engdegård
  1 sibling, 0 replies; 8+ messages in thread
From: Mattias Engdegård @ 2022-10-07 12:07 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 58319-done, Eli Zaretskii, Stefan Monnier

6 okt. 2022 kl. 14.22 skrev Lars Ingebrigtsen <larsi@gnus.org>:

> I think your change looks like an improvement -- it clarifies without
> making the warnings substantially longer.

Thank you, pushed to master.
(Of course '3-5' should really be '3–5' but who knows what terminal trouble that would cause.)






^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-07 12:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 18:25 bug#58319: 29.0.50; Not logical compilation warnings Jean Louis
2022-10-06  5:33 ` Eli Zaretskii
2022-10-06 10:06   ` Jean Louis
2022-10-06 10:54 ` Mattias Engdegård
2022-10-06 12:22   ` Lars Ingebrigtsen
2022-10-07 11:00     ` Jean Louis
2022-10-07 12:07     ` Mattias Engdegård
2022-10-07 10:58   ` Jean Louis

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.