[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: |
Richard Stallman |
Subject: |
Re: how-many/count-matches for non-interactive use |
Date: |
Sat, 23 Oct 2004 14:49:03 -0400 |
For most others, the current behavior prevents nuisance
messaging, as intended.
Could you tell me some of the functions where you reached this
conclusion?
I checked it now. The functions `set-left-margin' and
`set-right-margin' do not give any problems with keyboard macros.
However, their call to `interactive-p' is a useless and ugly no-op.
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. They are certainly instances of the problem I was worried
about: expecting interactive-p not to be affected by keyboard macros.
They need to be fixed.
Your approach to the third one is to replace interactive-p with t (in
effect). I think that is the right approach for all three. 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.
So I think this is the right fix for those.
*** indent.el 12 Oct 2004 04:45:09 -0400 1.58
--- indent.el 23 Oct 2004 13:29:00 -0400
***************
*** 205,211 ****
Interactively, WIDTH is the prefix argument, if specified.
Without prefix argument, the command prompts for WIDTH."
(interactive "r\nNSet left margin to column: ")
! (if (interactive-p) (setq width (prefix-numeric-value width)))
(save-excursion
;; If inside indentation, start from BOL.
(goto-char from)
--- 205,211 ----
Interactively, WIDTH is the prefix argument, if specified.
Without prefix argument, the command prompts for WIDTH."
(interactive "r\nNSet left margin to column: ")
! (setq width (prefix-numeric-value width))
(save-excursion
;; If inside indentation, start from BOL.
(goto-char from)
***************
*** 229,235 ****
Interactively, WIDTH is the prefix argument, if specified.
Without prefix argument, the command prompts for WIDTH."
(interactive "r\nNSet right margin to width: ")
! (if (interactive-p) (setq width (prefix-numeric-value width)))
(save-excursion
(goto-char from)
(skip-chars-backward " \t")
--- 229,235 ----
Interactively, WIDTH is the prefix argument, if specified.
Without prefix argument, the command prompts for WIDTH."
(interactive "r\nNSet right margin to width: ")
! (setq width (prefix-numeric-value width))
(save-excursion
(goto-char from)
(skip-chars-backward " \t")
***************
*** 289,297 ****
the right margin width.
If `auto-fill-mode' is active, re-fill the region to fit the new margin."
(interactive "r\nP")
! (if (interactive-p)
! (setq inc (if inc (prefix-numeric-value current-prefix-arg)
! standard-indent)))
(save-excursion
(alter-text-property from to 'right-margin
(lambda (v) (+ inc (or v 0))))
--- 289,296 ----
the right margin width.
If `auto-fill-mode' is active, re-fill the region to fit the new margin."
(interactive "r\nP")
! (setq inc (if inc (prefix-numeric-value current-prefix-arg)
! standard-indent))
(save-excursion
(alter-text-property from to 'right-margin
(lambda (v) (+ inc (or v 0))))
- Convert keyboard macros to Lisp (was: how-many/count-matches for non-interactive use), (continued)
- 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 <=
- 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, 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