here is the ecb-autogen.el which is based onto semantic-autogen.el
but IMHO slightly enhanced - especially for XEmacs. In addition it
also generates a provide statement for GNU Emacs so users can always
use require which IMHO is more conveniant than load*....
The main differences between this and semantic-autogen.el are in the
If you find my enhancements useful then i'm sure you can steal back
the ecb-code to semantic-autogen.el :-)
Here is the code:
;;; ecb-autogen.el --- Auto load statement generator
;;; Copyright (C) 2003 Klaus Berndl
;; $Id: ecb-autogen.el,v 1.4 2003/02/26 17:18:59 berndl Exp $
;; This file is not part of GNU Emacs.
;; ECB is free software; you can redistribute it and/or modify it under the
;; terms of the GNU General Public License as published by the Free Software
;; Foundation; either version 2, or (at your option) any later version.
;; This software is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;; Automatically generate autoloads for ECB
;; This code is based onto semantic-autogen.el, the autoload generator of
;; Emacs knows only a variable noninteractive whereas XEmacs knows both,
;; funtion and variable. Therefore we silence here the byte-compiler.
(defun ecb-autogen-noninteractive ()
"Return non-nil if running non-interactively."
(if (featurep 'xemacs)
;; If the user is doing this non-interactively, we need to set up
;; these conveniences.
(add-to-list 'load-path nil)
(setq find-file-hooks nil
"Auto-generated ecb autoloads"
"Header of the auto-generated autoloads file.")
(defconst ecb-autogen-file "ecb-autoloads.el"
"Name of the auto-generated autoloads file.")
(defconst ecb-autoload-feature "ecb-autoloads"
"Featurename of the autoloads")
(defvar ecb-autogen-subdirs nil
"Sub-directories to scan for autoloads.")
(defun ecb-autogen-update-header ()
"Update header of the auto-generated autoloads file.
Run as `write-contents-hooks'."
(when (string-equal generated-autoload-file (buffer-file-name))
(let ((tag (format ";;; %s ---" (file-name-nondirectory
(message "Updating header...")
;; Replace existing header line
((re-search-forward (concat "^" (regexp-quote tag)) nil t)
;; Insert header before first ^L encountered (XEmacs)
((re-search-forward "^" nil t)
(insert tag " " ecb-autogen-header)
(message "Updating header...done")
nil ;; Say not already written.
(defun ecb-update-autoloads ()
"Update ecb autoloads from sources.
Autoloads file name is defined in variable `ecb-autogen-file'. If ECB is
installed as regular XEmacs-package then this function reports an error and
(ecb-error "Updating autoloads not possible for regular XEmacs-packages!")
(when (and (not ecb-running-xemacs)
(not (file-exists-p (expand-file-name ecb-autogen-file))))
;; generate a new one if ecb-autogen-file does not exist, but do this not
;; for XEmacs because XEmacs must(!) handle this itself
(with-temp-file (expand-file-name ecb-autogen-file)
(let* ((default-directory (file-name-directory (locate-library "ecb")))
(generated-autoload-file (expand-file-name ecb-autogen-file))
;; needed for XEmacs to ensure that always a feature 'ecb-autoloads
;; is provided and not a feature like 'ecb-1.91.2-autoloads (XEmacs
;; uses the installation-directory of ECB as feature prefix if
;; autoload-package-name is not provided.
(subdirs (mapcar 'expand-file-name ecb-autogen-subdirs))
(command-line-args-left (cons default-directory subdirs))
;; XEmacs adds autom. the provide statement but for GNU Emacs we must do
(when (not ecb-running-xemacs)
(set-buffer (find-file-noselect (expand-file-name ecb-autogen-file)))
(when (not (re-search-forward (format "^(provide '%s)"
ecb-autoload-feature) nil t))
(insert (format "\n(provide '%s)\n" ecb-autoload-feature))
;;; ecb-autogen.el ends here
From: Eric M. Ludlam [mailto:eric@...]
Sent: Monday, March 17, 2003 6:57 PM
Subject: [CEDET-devel] semantic-autogen.el?
>Did an XEmacs fix for semantic-autogen ever get worked out?