mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-12 16:23:57 +00:00
(tparam1): Add handling for `%pN', which
means use param N for the next substitution.
This commit is contained in:
parent
08a39b8304
commit
9ad4bf7a45
14
src/tparam.c
14
src/tparam.c
@ -144,7 +144,9 @@ tparam1 (string, outstring, len, up, left, argp)
|
||||
int outlen = 0;
|
||||
|
||||
register int tem;
|
||||
int *old_argp = argp;
|
||||
int *old_argp = argp; /* can move */
|
||||
int *fixed_argp = argp; /* never moves */
|
||||
int explicit_param_p = 0; /* set by %p */
|
||||
int doleft = 0;
|
||||
int doup = 0;
|
||||
|
||||
@ -180,7 +182,10 @@ tparam1 (string, outstring, len, up, left, argp)
|
||||
if (c == '%')
|
||||
{
|
||||
c = *p++;
|
||||
tem = *argp;
|
||||
if (explicit_param_p)
|
||||
explicit_param_p = 0;
|
||||
else
|
||||
tem = *argp;
|
||||
switch (c)
|
||||
{
|
||||
case 'd': /* %d means output in decimal. */
|
||||
@ -203,7 +208,10 @@ tparam1 (string, outstring, len, up, left, argp)
|
||||
*op++ = tem % 10 + '0';
|
||||
argp++;
|
||||
break;
|
||||
|
||||
case 'p': /* %pN means use param N for next subst. */
|
||||
tem = fixed_argp[(*p++) - '1'];
|
||||
explicit_param_p = 1;
|
||||
break;
|
||||
case 'C':
|
||||
/* For c-100: print quotient of value by 96, if nonzero,
|
||||
then do like %+. */
|
||||
|
Loading…
Reference in New Issue
Block a user