I've been working on another patch to the manual, documenting commands
and custom types. In the course of writing an example of a custom type,
I discovered that you can't have a type return a nil value: it aborts
the interactive call. This is mentioned in a FIXME in
`call-interactively'.

For more complicated custom types I don't see why returning a nil value
should make the command blow up altogether. I've attached a patch which
allows nil return values -- I doubt it will cause any problems, but I'm
also happy to just run it locally for a few weeks first and see if
anything happens.

E

>From 013ecba15953248ac1058a3200be488311a7293b Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <e...@ericabrahamsen.net>
Date: Fri, 21 Mar 2014 10:56:10 +0800
Subject: [PATCH 1/2] Allow types to return nil values

---
 command.lisp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/command.lisp b/command.lisp
index 861af42..4ba4551 100644
--- a/command.lisp
+++ b/command.lisp
@@ -488,8 +488,7 @@ user aborted."
                                        (argument-line-end-p arg-line))
                                   (loop-finish)
                                   ;; FIXME: Is it presumptuous to assume NIL means abort?
-                                  (or (funcall fn arg-line prompt)
-                                      (throw 'error :abort)))))))
+                                  (funcall fn arg-line prompt)t)))))
       ;; Did the whole string get parsed?
       (unless (or (argument-line-end-p arg-line)
                   (position-if 'alphanumericp (argument-line-string arg-line) :start (argument-line-start arg-line)))
-- 
1.9.1

_______________________________________________
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel

Reply via email to