I have a small ELlisp package that configures Emacs to use a vertical bar caret.  It takes into account the differences between GNU Emacs and XEmacs.

In this package I have the following line.

(setq-default cursor-type '(bar . bk-preferred-caret-width))

bk-preferred-caret-width is a defcustom variable with a default value of 2.

Unfortunately this does not have the desired effect.  However, the following does work.

(setq-default cursor-type '(bar . 2))

Can anyone suggest how I might get this to work?

Thanks.