[comp.emacs] Auto-load gripe

dld@theory.cs.cmu.edu (David Detlefs) (08/20/87)

Just a little flame --

It would have made sense to me that when I put, say

(autoload 'ispell-buffer "ispell")

in my .emacs file, that thereafter 'ispell-buffer would be treated as
a known command.  (M-x ispell-buffer would work, command completion
would find it, etc.)  Is there a good technical or user interface
reason for this not being the case that I'm missing, or have I had a
good idea?

Dave

drw@cullvax.UUCP (Dale Worley) (08/24/87)

dld@theory.cs.cmu.edu (David Detlefs) writes:
> [When I say:]
> (autoload 'ispell-buffer "ispell")
> M-x ispell-buffer would work, command completion should find it, etc.

Probably because it doesn't declare 'ispell-buffer' to be
*interactive*, i.e., Emacs thinks that it's not intended to be called
directly from the keyboard.  You need a further argument to declare
that it's interactive:

autoload:
[...]
Fourth arg INTERACTIVE if non-nil says function can be called interactively.
[...]

Dale
-- 
Dale Worley	Cullinet Software		ARPA: cullvax!drw@eddie.mit.edu
UUCP: ...!seismo!harvard!mit-eddie!cullvax!drw
OS/2: Yesterday's software tomorrow	    Nuclear war?  There goes my career!

thomas%spline.uucp@utah-gr.UUCP (Spencer W. Thomas) (08/24/87)

In article <1068@theory.cs.cmu.edu> dld@theory.cs.cmu.edu (David Detlefs) writes:
>It would have made sense to me that when I put, say
>(autoload 'ispell-buffer "ispell")
>in my .emacs file, that thereafter 'ispell-buffer would be treated as
>a known command.

Ah, but if you read the documentation for the autoload function, you
will see that there are more than 3 arguments.  In particular:

  Third arg DOCSTRING is documentation for the function.
  Fourth arg INTERACTIVE if non-nil says function can be called interactively.

Thus, you should be saying
(autoload 'ispell-buffer "ispell" "Run ispell on the current buffer" T)

If you don't, the missing arguments default to NIL, and ispell-buffer
is assumed to not be an interactively callable command.

=Spencer   ({ihnp4,decvax}!utah-cs!thomas, thomas@cs.utah.edu)