emacs-wiki-discuss
[Top][All Lists]
Advanced

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

[emacs-wiki-discuss] Re: 'planner-create-task-from-buffer' is not autolo


From: drkm
Subject: [emacs-wiki-discuss] Re: 'planner-create-task-from-buffer' is not autoloaded.
Date: Wed, 13 Jul 2005 23:46:34 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (windows-nt)

Frederik Fouvry writes:

> ,-- On Tue, 12 Jul 2005 01:30:30 +0800, Sacha Chua wrote:

> | Right, excellent idea. I'll add that within the week. =) Or someone
> | can be ultranice and put autoload markers on all the useful functions.

  Wise decision :-)

> And variables.  (Useful to make package variables available to
> external packages before loading the file.)  But probably
> defcustom() variables are automatically autoloaded ...

  No.  I can't see how they could be.

> Looking at the results of the autoload generation is also a nice
> way to check if the user interface(s) make(s) sense.

> Some guidelines: if a function starts with an (interactive ...)
> declaration, it is a good/likely candidate for autoload.

  No.  The good condidates are the main entry points (with a good
definition for "main entry point" :-p).  A lot of interactive
functions can be called only in Planner Mode (so when planner.el
is loaded).

  Don't forget the Loaddefs Files will be loaded at each startup
of Emacs, like ~/.emacs.el.

> Interactive functions that are never called first thing in
> Planner (such as planner-renumber-tasks) need not be autoloaded,
> because planner mode is loaded first anyway.

> | We also need the eval-after-load stuff, I think. That's pretty
> | handy...

  I don't see what you think to.  Could you explain a bit
further?

  If you use CEDET, you can use 'cedet-autogen' to easily
generate the Loaddefs File (remember this file can be generated
by the maintainers before releases, so no dependence is added on
final user).  So you can type (in the shell prompt or in a shell
script):

    emacs -batch -l <cedet-dir>/common/cedet-autogen.el \
      -f cedet-batch-update-autoloads loaddefs.el

  For example (including response to the defcustom handling):

    ~> cat tmp.el
    (defvar var-no nil
      "`var-no' doc.")
    (defcustom cus-no nil
      "`cus-no' doc.")
    (defun fun-no ()
      "`fun-no' doc."
      nil)
    (put 'sym-no :prop-no nil)

    ;;;###autoload
    (defvar var-yes t
      "`var-yes' doc.")
    ;;;###autoload
    (defcustom cus-yes t
      "`cus-yes' doc.")
    ;;;###autoload
    (defun fun-yes ()
      "`fun-yes' doc."
      t)
    ;;;###autoload (put 'sym-yes :prop-yes nil)
    (put 'sym-yes :prop-yes nil)

    ~> emacs -batch -l <cedet-dir>/common/cedet-autogen.el \
         -f cedet-batch-update-autoloads tmp-al.el

    ~> cat tmp-al.el
    ;;; tmp-al.el --- Auto-generated CEDET autoloads
    ;;
    ;;; Code:

    
    ;;;### (autoloads (fun-yes cus-yes) "tmp" "tmp.el" (17109 34373))
    ;;; Generated autoloads from tmp.el

    (defvar var-yes t "\
    `var-yes' doc.")

    (defvar cus-yes t "\
    `cus-yes' doc.")

    (custom-autoload (quote cus-yes) "tmp")

    (autoload (quote fun-yes) "tmp" "\
    `fun-yes' doc.

    \(fn)" nil nil)
     (put 'sym-yes :prop-yes nil)

    ;;;***
    
    ;; Local Variables:
    ;; version-control: never
    ;; no-byte-compile: t
    ;; no-update-autoloads: t
    ;; End:
    ;;; tmp-al.el ends here

--drkm





reply via email to

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