You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any prevailing wisdom on when to use the (interactive (list ...)) form over the body code (setq arg-1 (or arg-1 (get-default))? Personally I prefer (and more often see) the former, but I've realized I have no good reasoning either way.
The text was updated successfully, but these errors were encountered:
If the mandatory argument can be worked out with the interactive code letters I prefer that and set the optional args in the body. So if I have (beg end &optional flag) then I would use (interactive "r") because that's probably the intended semantics.
I would never set optional args in the interactive form if they are not for interactive use. If they are some flags which can be determined during interactive use I would prefer the list spec except when it would be overly complicated (then I would prefer simple code letters/prompts and the logic in the body).
I understand my answer is pretty vague :D But a definitive rule for me is: never use the interactive list spec if non-interactive use-case can run through it.
Is there any prevailing wisdom on when to use the
(interactive (list ...))
form over the body code(setq arg-1 (or arg-1 (get-default))
? Personally I prefer (and more often see) the former, but I've realized I have no good reasoning either way.The text was updated successfully, but these errors were encountered: