Subject: Re: bug#14974: 24.3.50; adaptive-wrap 0.3 calls potentially void function easy-menu-add-item

From: Stephen Berman <[email-masked]>
Date: Tue, 30 Jul 2013 01:30:55 +0200

On Mon, 29 Jul 2013 18:15:14 -0400 Stefan Monnier <[email-masked]> wrote:

>> What is a recipe to getting the error, so I can understand what the
>> issue is?
>
> 1- install adaptive-wrap from ELPA.
> 2- restart Emacs.

Now I see, thanks.

>>   '(menu-item "Adaptive Wrap" (lambda ()
>> 				(interactive)
>> 				(if adaptive-wrap-prefix-mode
>> 				    (adaptive-wrap-prefix-mode -1)
>> 				  (adaptive-wrap-prefix-mode 1)))
>
> The binding should simply be adaptive-wrap-prefix-mode, shouldn't it?

You mean (lambda () (interactive) (adaptive-wrap-prefix-mode 'toggle))?
Yes, that's better.

>> 	      :enable t
>> 	      :visible (and (menu-bar-menu-frame-live-and-visible-p)
>> 			    (featurep 'adaptive-wrap))
>
> Why not always show it?

Then the check box remains in the menu after unloading adaptive-wrap.el,
but it becomes a noop.  Making visibility depend on whether the feature
is present is, AFAICS, a way of avoiding a separate
adaptive-wrap-unload-function.  Or am I wrong about this, or do you mean
something else?

>> 	      :button (:toggle . adaptive-wrap-prefix-mode))
>
> adaptive-wrap-prefix-mode only exists after adaptive-wrap has been
> loaded, so better use (bound-and-true-p adaptive-wrap-prefix-mode).

Ok.

Steve Berman