GNU bug report logs - #40600
27.0.90; M-x strokes-list-strokes error

Previous Next

Package: emacs;

Reported by: tsuucat <tsuucat <at> icloud.com>

Date: Mon, 13 Apr 2020 15:52:01 UTC

Severity: normal

Tags: fixed

Found in version 27.0.90

Fixed in version 28.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 40600 in the body.
You can then email your comments to 40600 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#40600; Package emacs. (Mon, 13 Apr 2020 15:52:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to tsuucat <tsuucat <at> icloud.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 13 Apr 2020 15:52:02 GMT) Full text and rfc822 format available.

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

From: tsuucat <tsuucat <at> icloud.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.90; M-x strokes-list-strokes error 
Date: Tue, 14 Apr 2020 00:51:17 +0900
I browsed Emacs source repository and found strokes.el package.
This is very awesome but I found a bug.

When two or more strokes are defined including string returning strokes, 
M-x strokes-list-strokes causes an error.

Reproduce steps:
1. emacs -Q
2. M-x strokes-global-set-stroke (and define a stroke and corresponding command(emacs-version))
3. M-x strokes-global-set-stroke-string (and define a stroke and corresponding string(emacs))
4. M-x strokes-list-strokes => error message
;; when (setq debug-on-error t)
Debugger entered--Lisp error: (wrong-type-argument symbolp "emacs")
  symbol-name("emacs")
  strokes-alphabetic-lessp((((6 . 0) (5 . 0) (4 . 0) (3 . 0) (2 . 0) (1 . 0) (0 . 1) (0 . 2) (0 . 3) (0 . 4) (0 . 5) (1 . 5) (2 . 6) (3 . 6) (4 . 6) (4 . 5) (5 . 4) (5 . 3) (6 . 3) (6 . 2) (6 . 1) (6 . 2) (6 . 3) (6 . 4) (7 . 5) (7 . 6) (8 . 6) (8 . 7) (8 . 8)) . emacs-version) (((5 . 2) (5 . 1) (4 . 1) (4 . 0) (3 . 0) (2 . 0) (2 . 1) (1 . 1) (1 . 2) (0 . 2) (0 . 3) (0 . 4) (0 . 5) (0 . 6) (0 . 7) (1 . 7) (2 . 7) (3 . 7) (4 . 7) (5 . 7) (6 . 7) (6 . 6) (7 . 5) (7 . 4) (7 . 5) (7 . 6) (7 . 7) (8 . 7) (8 . 8)) . "emacs"))
  sort(((((5 . 2) (5 . 1) (4 . 1) (4 . 0) (3 . 0) (2 . 0) (2 . 1) (1 . 1) (1 . 2) (0 . 2) (0 . 3) (0 . 4) (0 . 5) (0 . 6) (0 . 7) (1 . 7) (2 . 7) (3 . 7) (4 . 7) (5 . 7) (6 . 7) (6 . 6) (7 . 5) (7 . 4) (7 . 5) (7 . 6) (7 . 7) (8 . 7) (8 . 8)) . "emacs")) strokes-alphabetic-lessp)
  strokes-list-strokes(nil)
  funcall-interactively(strokes-list-strokes nil)
  call-interactively(strokes-list-strokes record nil)
  command-execute(strokes-list-strokes record)
  execute-extended-command(nil "strokes-list-strokes" "strokes-lis")
  funcall-interactively(execute-extended-command nil "strokes-list-strokes" "strokes-lis")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Thanks.

--
tsuucat





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40600; Package emacs. (Tue, 14 Apr 2020 14:39:02 GMT) Full text and rfc822 format available.

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

From: tsuucat <tsuucat <at> icloud.com>
To: 40600 <at> debbugs.gnu.org
Subject: Re: [PATCH] 27.0.90; M-x strokes-list-strokes error
Date: Tue, 14 Apr 2020 23:38:28 +0900
[Message part 1 (text/plain, inline)]
I made a patch.
Please see an attachment.

--
tsuucat
[0001-Fix-comparing-command-names-in-strokes.el-bug-40600.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40600; Package emacs. (Tue, 14 Apr 2020 16:50:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: tsuucat <tsuucat <at> icloud.com>
Cc: 40600 <at> debbugs.gnu.org
Subject: Re: bug#40600: [PATCH] 27.0.90; M-x strokes-list-strokes error
Date: Tue, 14 Apr 2020 12:48:55 -0400
tsuucat <tsuucat <at> icloud.com> writes:

> -  (let ((command-name-1 (symbol-name (cdr stroke1)))
> -	(command-name-2 (symbol-name (cdr stroke2))))
> +  (let ((command-name-1 (if (symbolp (cdr stroke1))
> +                            (symbol-name (cdr stroke1))
> +                          (prin1-to-string (cdr stroke1))))

Why use prin1-to-string?

> +        (command-name-2 (if (symbolp (cdr stroke2))
> +                            (symbol-name (cdr stroke2))
> +                          (prin1-to-string (cdr stroke2)))))
>      (string-lessp command-name-1 command-name-2)))

Actually, since string-lessp accepts symbols, an easier fix would be to
just drop the calls to symbol-name.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40600; Package emacs. (Tue, 14 Apr 2020 17:16:01 GMT) Full text and rfc822 format available.

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

From: tsuucat <tsuucat <at> icloud.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 40600 <at> debbugs.gnu.org
Subject: Re: bug#40600: [PATCH] 27.0.90; M-x strokes-list-strokes error
Date: Wed, 15 Apr 2020 02:15:02 +0900
[Message part 1 (text/plain, inline)]
> Why use prin1-to-string?

That’s simply because I imitate the code in strokes-list-strokes function.

> Actually, since string-lessp accepts symbols, an easier fix would be to
> just drop the calls to symbol-name.


Thanks for the advice! I made another patch and checked this  works well.

--
tsuucat
[0001-Fix-comparing-command-names-in-strokes.el-bug-40600.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40600; Package emacs. (Fri, 17 Apr 2020 00:51:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: tsuucat <tsuucat <at> icloud.com>
Cc: 40600 <at> debbugs.gnu.org
Subject: Re: bug#40600: [PATCH] 27.0.90; M-x strokes-list-strokes error
Date: Thu, 16 Apr 2020 20:49:56 -0400
tags 40600 fixed
close 40600 28.1
quit

tsuucat <tsuucat <at> icloud.com> writes:

> Thanks for the advice! I made another patch and checked this  works well.

Thanks, pushed to master.

[1: be77a68d52]: 2020-04-16 20:47:35 -0400
  Fix comparing command names in strokes.el (bug#40600)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=be77a68d527223f7f276e94e16fe05b49846c7a3




Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 17 Apr 2020 00:51:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 40600 <at> debbugs.gnu.org and tsuucat <tsuucat <at> icloud.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 17 Apr 2020 00:51: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. (Fri, 15 May 2020 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 40 days ago.

Previous Next


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