Re: bugzilla being used? bug report



D M German <dmg uvic ca> writes:

> I have a minor bug report. It involves call-command
>
> When invoked interactively, call-command does what it is supposed to do,
> except when the use types <ESCAPE>
>
> In that case, I get an error: "Error: Null argument to command:
> call-command." Which clutters my screen until I try to do something else
> that involves display-message which cleans it up.

This is something I've run into, but has never annoyed me enough to fix
-- as Teika said, you can click on the message to make it go away.
The problem is that esc cancels the prompt input and call-command
doesn't check for a nil value.  Either the call-command function or the
call-command command should be changed to silently ignore nil values.

This is a common problem; the define-command statement needs to be
something like:

  (define-command 'call-command (lambda (c) (and c (call-command c)))
    #:spec "CEnter command:\nP")

Instead of the simpler and more readable:

  (define-command 'call-command call-command
    #:spec "CEnter command:\nP")

Because the function gets called even if no value is input.  The best
solution would probably be to modify define-command to have a flag to
set up the command to ignore nil values.  Because often (but not always)
that's the right thing for a command expecting input to do.  But I
haven't looked at it, so I'm not sure how easy that would be to do.
Maybe when I'm done trying to understand how sawfish-pager calculates
size values...?

-- 
Jeremy Hankins <nowan nowan org>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]