emacs-devel
[Top][All Lists]
Advanced

[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: Tue, 26 Oct 2004 05:05:55 -0400

    I know looked at the three remaining calls in simple.el myself.  The
    call in `kill-ring-save' _seems_ to me to be an example of correct
    non-message use.

I agree, in this case.  This code gives the user visual feedback,
which is what message does.

    There are tons of uses in help.el, help-fns, faces.el, apropos.el,
    which are all of exactly the same "help-xref" type.  I did not check
    these.  However, I somehow get the impression that whoever wrote the
    code knew what they were doing.

I think those are all erroneous.

The behavior controlled in this case is clearing a stack.
Whether to clear the stack should be the same regardless
of whether a keyboard macro is executing.

Can someone look at how to fix these?


    That leaves:

I started checking these, and I found:

    man.el: Man-cleanup-manpage

I think the reason for checking interactive-p here is just in case
someone wants to do M-x Man-cleanup-manpage.  I am not sure that
feature is worth having, but in any case the code is not correct.

    menubar.el: menu-bar-make-toggle

That was a bug.  It was using interactive-p to control whether to call
customize-mark-as-set.  The toggle command would have done the wrong
thing in a keyboard macro.

    pcomplete.el:  pcomplete

That is a bug too.  The code does something substantive, not just
visual feedback for the user.

    woman.el: woman

That is a bug too.  The code it controls does find-file; it is not
just visual feedback.

So far, four errors out of four.  I fixed these.  Could other people
check the rest?  The rule is simple: if it conditionalizes anything
more than visual feedback for the user, it is wrong to use
interactive-p.  Therefore, you don't have to really master the code to
fix these problems.


Here is what is left on that list:

comint.el: comint-strip-ctrl-m
strokes.el: several.  Of those, strokes-prompt-user-save-strokes is
            another one that seems suspicious.  I am completely
            unfamiliar with strokes.el.  But these seem to be mouse
            related functions.  I do not know whether calling these
            from keyboard macros makes any sense to begin with.
newcomment.el: comment-indent-new-line
printing.el: several
dired-x.el: dired-omit-expunge, dired-x-bind-find-file
bookmark.el: bookmark-maybe-historicize-string, bookmark-bmenu-list 
ffap.el: several.
completion.el: add-completion, add-permanent-completion





reply via email to

[Prev in Thread] Current Thread [Next in Thread]