GNU bug report logs - #34941
27.0.50; map-inplace and map-not-inplace errors

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Fri, 22 Mar 2019 02:22:02 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34941 in the body.
You can then email your comments to 34941 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34941; Package emacs. (Fri, 22 Mar 2019 02:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 22 Mar 2019 02:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Cc: Nicolas Petton <nicolas <at> petton.fr>
Subject: 27.0.50; map-inplace and map-not-inplace errors
Date: Fri, 22 Mar 2019 03:20:44 +0100
Hi,

in *scratch* I eval for testing

  (map-put! nil 1 1)

and get the error message

  map-put!: Cannot modify map in-place: %S: ((1 . 1))

I guess this "%S" in the error definition doesn't work as intended, it
is printed literally - likewise for the map-inplace error I guess.

And IMHO the code outputs the value of the wrong variable:

      (let ((oldmap map))
        (setf (alist-get key map key nil (or testfn #'equal)) value)
        (unless (eq oldmap map)
          (signal 'map-not-inplace (list map)))))
                                         ^^^

with OLDMAP that would make more sense IMO.  To be clear, the error
message I would expect would be

  map-put!: Cannot modify map in-place: nil


TIA,

Michael.


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
 of 2019-03-21 built on drachen
Repository revision: acf2e0691e64b94185c493defb281ef280087d7a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux buster/sid





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34941; Package emacs. (Fri, 22 Mar 2019 09:50:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Petton <nicolas <at> petton.fr>
To: Michael Heerdegen <michael_heerdegen <at> web.de>, bug-gnu-emacs <at> gnu.org
Subject: Re: 27.0.50; map-inplace and map-not-inplace errors
Date: Fri, 22 Mar 2019 10:34:25 +0100
[Message part 1 (text/plain, inline)]
close 34941
tags 34941 fixed
thanks

Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Hi,

Hi Michael,

> with OLDMAP that would make more sense IMO.  To be clear, the error
> message I would expect would be
>
>   map-put!: Cannot modify map in-place: nil

I fixed both issues in master (commit 4174409c53), let me know if it
doesn't work for you.

Cheers,
Nico
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34941; Package emacs. (Fri, 22 Mar 2019 15:11:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Nicolas Petton <nicolas <at> petton.fr>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 27.0.50; map-inplace and map-not-inplace errors
Date: Fri, 22 Mar 2019 16:09:48 +0100
Nicolas Petton <nicolas <at> petton.fr> writes:

> I fixed both issues in master (commit 4174409c53), let me know if it
> doesn't work for you.

Thanks.  You forgot to change map-inplace:

  (map-insert 'x 1 1)

  |- map-insert: Can only modify map in place: %S: x


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34941; Package emacs. (Sat, 23 Mar 2019 00:16:02 GMT) Full text and rfc822 format available.

Message #14 received at 34941 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 34941 <at> debbugs.gnu.org
Subject: Re: bug#34941: 27.0.50; map-inplace and map-not-inplace errors
Date: Sat, 23 Mar 2019 01:14:53 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Hi,
>
> in *scratch* I eval for testing
>
>   (map-put! nil 1 1)
>
> and get the error message
>
>   map-put!: Cannot modify map in-place: %S: ((1 . 1))
>
> I guess this "%S" in the error definition doesn't work as intended, it
> is printed literally - likewise for the map-inplace error I guess.

Stefan, some similar error definitions are from you.  Are these mistakes
or does this %S thing work in some context?


;;; *** /home/micha/software/emacs/lisp/emacs-lisp/cl-generic.el

;;;; Line 636
(define-error 'cl--generic-cyclic-definition "Cyclic definition: %S")


;;; *** /home/micha/software/emacs/lisp/emacs-lisp/cl-macs.el

;;;; Line 3094
(define-error 'cl-struct-unknown-slot "struct %S has no slot %S")


;;; *** /home/micha/software/emacs/lisp/emacs-lisp/gv.el

;;;; Line 77
(define-error 'gv-invalid-place "%S is not a valid place expression")


Thanks,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34941; Package emacs. (Sat, 23 Mar 2019 02:00:03 GMT) Full text and rfc822 format available.

Message #17 received at 34941 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 34941 <at> debbugs.gnu.org
Subject: Re: bug#34941: 27.0.50; map-inplace and map-not-inplace errors
Date: Fri, 22 Mar 2019 21:59:49 -0400
> Stefan, some similar error definitions are from you.  Are these mistakes
> or does this %S thing work in some context?

I plead guilty!

> (define-error 'cl-struct-unknown-slot "struct %S has no slot %S")

But the "correct" definition makes the error much less readable here :-(


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34941; Package emacs. (Sun, 24 Mar 2019 20:55:01 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Petton <nicolas <at> petton.fr>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 27.0.50; map-inplace and map-not-inplace errors
Date: Sun, 24 Mar 2019 21:54:20 +0100
[Message part 1 (text/plain, inline)]
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Nicolas Petton <nicolas <at> petton.fr> writes:
>
>> I fixed both issues in master (commit 4174409c53), let me know if it
>> doesn't work for you.
>
> Thanks.  You forgot to change map-inplace:

Yep, thanks for noticing, I'll fix it.

Nico
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34941; Package emacs. (Wed, 27 Mar 2019 09:24:02 GMT) Full text and rfc822 format available.

Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Petton <nicolas <at> petton.fr>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 27.0.50; map-inplace and map-not-inplace errors
Date: Wed, 27 Mar 2019 10:23:30 +0100
[Message part 1 (text/plain, inline)]
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Thanks.  You forgot to change map-inplace:

I just pushed a fix.

Nico
[signature.asc (application/pgp-signature, inline)]

Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 02 Apr 2019 23:55:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 34941 <at> debbugs.gnu.org and Michael Heerdegen <michael_heerdegen <at> web.de> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 02 Apr 2019 23:55:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 01 May 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 362 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.