[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how-many/count-matches for non-interactive use
From: |
Luc Teirlinck |
Subject: |
Re: how-many/count-matches for non-interactive use |
Date: |
Sat, 23 Oct 2004 15:36:29 -0500 (CDT) |
Richard Stallman wrote:
It is not a no-op, but it is not correct either. These commands as
currently written would behave incorrectly in some cases in a keyboard
macro.
I do not believe so (I checked). I still believe those lines are
no-ops and should simply be deleted, like my patch does.
(interactive "r\nNSet left margin to column: ")
! (setq width (prefix-numeric-value width))
That second line is redundant. The `N' code character already _gives_ the
numeric value.
Your approach to the first two is to delete the call to
prefix-numeric-value. As far as I can see, that would extend the
bug to the non-macro case.
I do not believe so. I checked. The `N' already gives the numeric value.
! (setq inc (if inc (prefix-numeric-value current-prefix-arg)
! standard-indent))
That would appear wrong for non-interactive calls. For such calls
`current-prefix-arg' would not give the prefix arg of
`increase-right-margin', but of whichever function was actually called
interactively (and then directly or indirectly called
`increase-right-margin').
The line I used:
! (setq inc (if inc (prefix-numeric-value inc) standard-indent)
is the _same_ line that is used in the three other completely analogous
functions in indent.el. If there is something wrong with that line
for `increase-right-margin', then there would be something wrong in
the three other {in,de}crease-{left,right}-margin functions. I
believe we need to use consistent code in all four. Anything else
would appear to make no sense.
I still believe my original patch is the logical solution in all three
cases.
>From (elisp)Interactive Codes:
`N'
The numeric prefix argument; but if there is no prefix argument,
read a number as with `n'. Requires a number. *Note Prefix
Command Arguments::. Prompt.
Note: The numeric prefix argument;
Sincerely,
Luc.
- Re: Convert keyboard macros to Lisp (was: how-many/count-matches for non-interactive use), (continued)
- Re: Convert keyboard macros to Lisp (was: how-many/count-matches for non-interactive use), Richard Stallman, 2004/10/23
- Re: how-many/count-matches for non-interactive use, Luc Teirlinck, 2004/10/22
- Re: how-many/count-matches for non-interactive use, Luc Teirlinck, 2004/10/22
- Re: how-many/count-matches for non-interactive use, Luc Teirlinck, 2004/10/22
- Re: how-many/count-matches for non-interactive use, John Paul Wallington, 2004/10/23
- Re: how-many/count-matches for non-interactive use, Richard Stallman, 2004/10/23
- Re: how-many/count-matches for non-interactive use, Ken Manheimer, 2004/10/25
- Re: how-many/count-matches for non-interactive use, Richard Stallman, 2004/10/27
- Re: how-many/count-matches for non-interactive use, Ken Manheimer, 2004/10/28
- Re: how-many/count-matches for non-interactive use, Richard Stallman, 2004/10/23
- Re: how-many/count-matches for non-interactive use,
Luc Teirlinck <=
- Re: how-many/count-matches for non-interactive use, Richard Stallman, 2004/10/24
- Re: how-many/count-matches for non-interactive use, Luc Teirlinck, 2004/10/25
- Re: how-many/count-matches for non-interactive use, Kim F. Storm, 2004/10/26
- Re: how-many/count-matches for non-interactive use, Luc Teirlinck, 2004/10/23
- Re: how-many/count-matches for non-interactive use, Richard Stallman, 2004/10/24
- Re: how-many/count-matches for non-interactive use, Richard Stallman, 2004/10/24
- Re: how-many/count-matches for non-interactive use, Luc Teirlinck, 2004/10/24
- Re: how-many/count-matches for non-interactive use, Richard Stallman, 2004/10/26
- Re: how-many/count-matches for non-interactive use, Luc Teirlinck, 2004/10/24
- Re: how-many/count-matches for non-interactive use, Richard Stallman, 2004/10/26