I wanted to combine a couple of modes for soft-wrapped text, so I wrote:
(defun soft-wrap-modes ()
(interactive)
"Turn on minor modes for soft wrap"
(if (called-interactively-p) (call-interactively 'adaptive-wrap-prefix-mode) (adaptive-wrap-prefix-mode))
(if (called-interactively-p) (call-interactively 'window-margin-mode) (window-margin-mode)))
The idea is that soft-wrap-modes should toggle when used interactively, just like the underlying mode commands. But this is not very nice. It could be made a bit nicer using map, but is there no way to transparently pass the interactivity of the current command down to the sub-commands? I couldn't see a way to do this with the standard methods for testing whether a command is called in interactive mode.
--