This might seem like an overkill… but that's how xparse works.
With the “complex code” what I do is define new type of xparse arguments, k, K, a, b, A, B. Being a and A the correspondent to subscripts. The others are explained here
\documentclass{scrartcl}
\usepackage{mathtools,amssymb,xparse}
\ExplSyntaxOn
\cs_new_protected:Npn \__xparse_count_type_k:w #1
{
\__xparse_single_token_check:n { #1 }
\quark_if_recursion_tail_stop_do:Nn #1 { \__xparse_bad_arg_spec:wn }
\__xparse_count_mandatory:N
}
\cs_new_protected:Npn \__xparse_count_type_K:w #1 #2
{
\__xparse_single_token_check:n { #1 }
\quark_if_recursion_tail_stop_do:nn { #2 } { \__xparse_bad_arg_spec:wn }
\__xparse_count_mandatory:N
}
\cs_new_protected:Npn \__xparse_add_type_k:w #1
{ \exp_args:NNo \__xparse_add_type_K:w #1 { \c__xparse_no_value_tl } }
\cs_new_protected:Npn \__xparse_add_type_K:w #1 #2
{
\__xparse_flush_m_args:
\__xparse_add_grabber_optional:N K
\tl_put_right:Nn \l__xparse_signature_tl { #1 { #2 } }
\__xparse_prepare_signature:N
}
\cs_new_protected:Npn \__xparse_add_expandable_type_k:w #1
{
\exp_args:NNo \__xparse_add_expandable_type_K:w #1 { \c__xparse_no_value_tl }
}
\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_K:w #1 #2
{
\__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { K }
\__xparse_add_expandable_type_m:w % May be create this?
}
\cs_new_protected:Npn \__xparse_grab_K:w #1 #2 #3 \l__xparse_args_tl
{
\__xparse_grab_K_aux:NnnNn #1 { #2 } { #3 } \cs_set_protected_nopar:Npn
{ _ignore_spaces }
}
\cs_new_protected:Npn \__xparse_grab_K_long:w #1 #2 #3 \l__xparse_args_tl
{
\__xparse_grab_K_aux:NnnNn #1 { #2 } { #3 } \cs_set_protected:Npn
{ _ignore_spaces }
}
\cs_new_protected:Npn \__xparse_grab_K_trailing:w #1 #2 #3 \l__xparse_args_tl
{
\__xparse_grab_K_aux:NnnNn #1 { #2 } { #3 } \cs_set_protected_nopar:Npn
{ _ignore_spaces }
}
\cs_new_protected:Npn \__xparse_grab_K_long_trailing:w #1 #2 #3 \l__xparse_args_tl
{
\__xparse_grab_K_aux:NnnNn #1 { #2 } { #3 } \cs_set_protected:Npn
{ _ignore_spaces }
}
\cs_new_protected:Npn \__xparse_grab_K_aux:NnnNn #1 #2 #3 #4 #5
{
\exp_after:wN #4 \l__xparse_fn_tl ##1
{
\__xparse_add_arg:n { ##1 }
#3 \l__xparse_args_tl
}
\use:c { peek_meaning_remove #5 :NTF } #1
{ \l__xparse_fn_tl }
{
\__xparse_add_arg:n { #2 }
#3 \l__xparse_args_tl
}
}
\prop_put:Nnn \c__xparse_shorthands_prop { a } { k \sb }
\prop_put:Nnn \c__xparse_shorthands_prop { b } { k \sp }
\prop_put:Nnn \c__xparse_shorthands_prop { A } { K \sb }
\prop_put:Nnn \c__xparse_shorthands_prop { B } { K \sp }
\ExplSyntaxOff
\let\originalint\int
\RenewDocumentCommand\int{ t\limits a }
{\originalint\IfBooleanT{#1}{\limits}\IfValueT{#2}{_{\mathclap{#2}}}}
\begin{document}
\[
\int\limits_{verylonglimit} x \, dx
\]
\end{document}

I redefine the \int command first to gobble (and use) any \limits following it (if you want a different behaviour it can be changed, for instance if you want all of them to have \limits so \int_a would equal \int\limits_{\mathclap{a}}) then the command checks if there's a subscript like _{whatever} then pases whatever as second argument, we then pass it through a _{\mathclap{#2}} automatically.
\limitsin a document – David Carlisle Jun 03 '15 at 16:49\limitsyou will redefine\stackrel,\buildrel,\doteqand any other command that uses\limitsinternally. – David Carlisle Jun 03 '15 at 16:52\int_{\mathclap{verylonglimit}}\frac{1}{x}\,dx? – egreg Jun 03 '15 at 16:52amsmath(ormathtools) package with the optionintlimits. (b) If typing\mathclapfrequently is too tedious, just create a shortcut named, say,\mcto ease the job. – Mico Jun 03 '15 at 17:01intlimitsoption, but I still have to write every time the\mathclappart. Do you think the best option is to redefine and to use the shorthand? @DavidCarlisle do you mean the same as @Mico? And yes, that redefine could be a problem. @egreg still the same as @Mico? And in that case by using big integrands I could be in danger of an overlap between limits and integrands. In general, is it possible to redefine a command comprising the underscore? – Alex Pacini Jun 03 '15 at 17:08xparseyou can use the code from this answer to have\let\originalint\int \NewDocumentCommand\int{b}{\originalint\limits\IfValueT{#2}{_{\mathclap{#2}}}}and then use\int_{whatever}to act as\int\limits_{\mathclap{whatever}}(while you don't need to always input limits\int f(x) \, dtwould also work. – Manuel Jun 03 '15 at 19:45