emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for locate.el when called with prefix arg


From: Luc Teirlinck
Subject: Re: patch for locate.el when called with prefix arg
Date: Sat, 21 Apr 2007 14:49:07 -0500 (CDT)

Richard Stallman wrote:

        (2) While C-u locate RET gives the prompt "Run locate (like this): ",
        locate-with-filter gives the same prompt, "Locate: ", regardless of
        whether or not a prefix arg is used.  The behaviour of C-u
        locate-with-filter is analogous to C-u locate (due to the value
        current-prefix-arg), but the use of a prefix arg is not documented
        for locate-with-filter.  (All of this is also true for Emacs 21.)


   That's not serious.

And apparently the feature is non-intentional.
`locate-in-alternate-database' has a similar undocumented (and
probably non-intentional) feature.

Is the way the `locate' command uses `current-prefix-arg', outside an
interactive declaration and without checking that `locate' itself was
called interactively, actually legitimate?  It means that any function
that calls locate, and uses itself the prefix arg with unrelated
meaning, has to bind `current-prefix-arg' to nil around the call to
`locate', otherwise a bug results.  (This is actually part of what my
previous patch does for `locate-update', which was necessary, because
otherwise `C-u g' produces a bug.)  This does not seem very clean to me.
In the case of `locate-with-filter' and `locate-in-alternate-database'
the result could actually be considered a feature rather than a bug.

Sincerely,

Luc Teirlinck.






reply via email to

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