GNU bug report logs - #71406
30.0.50; string-edit signals error when user aborts and :abort-callback parameter nil

Previous Next

Package: emacs;

Reported by: Nicholas Vollmer <nv <at> parenthetic.dev>

Date: Fri, 7 Jun 2024 03:51:03 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

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 71406 in the body.
You can then email your comments to 71406 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#71406; Package emacs. (Fri, 07 Jun 2024 03:51:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicholas Vollmer <nv <at> parenthetic.dev>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 07 Jun 2024 03:51:03 GMT) Full text and rfc822 format available.

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

From: Nicholas Vollmer <nv <at> parenthetic.dev>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; string-edit signals error when user aborts and
 :abort-callback parameter nil
Date: Thu, 06 Jun 2024 12:03:34 -0400
1. emacs -q
2. eval (string-edit "test" "" #'ignore)
3. In the "*edit string*" buffer eval string-edit-abort.

The following error is signaled:

Debugger entered--Lisp error: (void-variable 
string-edit--abort-callback)
 string-edit-abort()
 funcall-interactively(string-edit-abort)
 command-execute(string-edit-abort)

Seeing as string-edit specifies this parameter as a &key, it 
should either provide a default (#'ignore?) or error if the caller 
does not provide an abort function (Though why specify it as a 
keyword arg if it's mandatory?).





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71406; Package emacs. (Sat, 08 Jun 2024 13:11:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nicholas Vollmer <nv <at> parenthetic.dev>
Cc: 71406 <at> debbugs.gnu.org
Subject: Re: bug#71406: 30.0.50;
 string-edit signals error when user aborts and :abort-callback
 parameter nil
Date: Sat, 08 Jun 2024 16:09:33 +0300
> From: Nicholas Vollmer <nv <at> parenthetic.dev>
> Date: Thu, 06 Jun 2024 12:03:34 -0400
> 
> 
> 1. emacs -q
> 2. eval (string-edit "test" "" #'ignore)
> 3. In the "*edit string*" buffer eval string-edit-abort.
> 
> The following error is signaled:
> 
> Debugger entered--Lisp error: (void-variable 
> string-edit--abort-callback)
>   string-edit-abort()
>   funcall-interactively(string-edit-abort)
>   command-execute(string-edit-abort)
> 
> Seeing as string-edit specifies this parameter as a &key, it 
> should either provide a default (#'ignore?) or error if the caller 
> does not provide an abort function (Though why specify it as a 
> keyword arg if it's mandatory?).

Thanks, I fixed this with the patch below.

diff --git a/lisp/textmodes/string-edit.el b/lisp/textmodes/string-edit.el
index 03be426..cafed5a 100644
--- a/lisp/textmodes/string-edit.el
+++ b/lisp/textmodes/string-edit.el
@@ -75,8 +75,7 @@ string-edit
     (setq buffer-undo-list nil)
     (string-edit-mode)
     (setq-local string-edit--success-callback success-callback)
-    (when abort-callback
-      (setq-local string-edit--abort-callback abort-callback))
+    (setq-local string-edit--abort-callback abort-callback)
     (setq-local header-line-format
                 (substitute-command-keys
                  "Type \\<string-edit-mode-map>\\[string-edit-done] when you've finished editing or \\[string-edit-abort] to abort"))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71406; Package emacs. (Mon, 10 Jun 2024 20:52:01 GMT) Full text and rfc822 format available.

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

From: Nicholas Vollmer <nv <at> parenthetic.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71406 <at> debbugs.gnu.org
Subject: Re: bug#71406: 30.0.50; string-edit signals error when user aborts
 and :abort-callback parameter nil
Date: Mon, 10 Jun 2024 16:50:29 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks, I fixed this with the patch below.

Makes sense. Works on my end, too.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 15 Jun 2024 11:01:02 GMT) Full text and rfc822 format available.

Notification sent to Nicholas Vollmer <nv <at> parenthetic.dev>:
bug acknowledged by developer. (Sat, 15 Jun 2024 11:01:02 GMT) Full text and rfc822 format available.

Message #16 received at 71406-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nicholas Vollmer <nv <at> parenthetic.dev>
Cc: 71406-done <at> debbugs.gnu.org
Subject: Re: bug#71406: 30.0.50; string-edit signals error when user aborts
 and :abort-callback parameter nil
Date: Sat, 15 Jun 2024 13:42:34 +0300
> From: Nicholas Vollmer <nv <at> parenthetic.dev>
> Cc: 71406 <at> debbugs.gnu.org
> Date: Mon, 10 Jun 2024 16:50:29 -0400
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Thanks, I fixed this with the patch below.
> 
> Makes sense. Works on my end, too.

Thanks, I'm therefore closing this bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 13 Jul 2024 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 341 days ago.

Previous Next


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