all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Nicholas Vollmer <nv@parenthetic.dev>
Cc: 71406@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <86cyord1iq.fsf@gnu.org> (raw)
In-Reply-To: <87bk4eawix.fsf@parenthetic.dev> (message from Nicholas Vollmer on Thu, 06 Jun 2024 12:03:34 -0400)

> From: Nicholas Vollmer <nv@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"))





  reply	other threads:[~2024-06-08 13:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 16:03 bug#71406: 30.0.50; string-edit signals error when user aborts and :abort-callback parameter nil Nicholas Vollmer
2024-06-08 13:09 ` Eli Zaretskii [this message]
2024-06-10 20:50   ` Nicholas Vollmer
2024-06-15 10:42     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86cyord1iq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71406@debbugs.gnu.org \
    --cc=nv@parenthetic.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.