From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: autoload Date: Mon, 24 Jan 2011 08:41:11 +0100 Message-ID: <87mxmqzr3c.fsf@ambire.localdomain> References: <065C351A-6288-4442-831F-327DD8525288@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1295855236 25857 80.91.229.12 (24 Jan 2011 07:47:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 24 Jan 2011 07:47:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 24 08:47:12 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PhH8q-00084c-Hd for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Jan 2011 08:47:12 +0100 Original-Received: from localhost ([127.0.0.1]:53104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhH8p-000239-It for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Jan 2011 02:47:11 -0500 Original-Received: from [140.186.70.92] (port=55970 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhH8R-000233-J3 for help-gnu-emacs@gnu.org; Mon, 24 Jan 2011 02:46:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhH8Q-0002xR-3J for help-gnu-emacs@gnu.org; Mon, 24 Jan 2011 02:46:47 -0500 Original-Received: from smtp204.alice.it ([82.57.200.100]:47324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhH8P-0002x2-Pe for help-gnu-emacs@gnu.org; Mon, 24 Jan 2011 02:46:46 -0500 Original-Received: from ambire.localdomain (95.244.65.54) by smtp204.alice.it (8.5.124.08) id 4C88E33B0B1D7862 for help-gnu-emacs@gnu.org; Mon, 24 Jan 2011 08:46:43 +0100 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1PhH31-0001oO-Mh for help-gnu-emacs@gnu.org; Mon, 24 Jan 2011 08:41:11 +0100 In-Reply-To: <065C351A-6288-4442-831F-327DD8525288@gmail.com> (Perry Smith's message of "Sun, 23 Jan 2011 22:49:13 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78700 Archived-At: --=-=-= Content-Type: text/plain () Perry Smith () Sun, 23 Jan 2011 22:49:13 -0600 Its not a lot of work but it just seemed like I can't be the only person doing this. You are not alone.... (cue eery music here :-D). Below is do/update-autoload-file.el from ttn-pers-elisp (nb: copyright out of date; recent changes have been made, but the package itself has not been released yet). The cruft is from Emacs 19 dayz -- feel free to ignore. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=update-autoload-file.el Content-Transfer-Encoding: quoted-printable ;;; update-autoload-file.el ;;; ;;; Copyright (C) 2008 Thien-Thi Nguyen ;;; ;;; This file is part of ttn's personal elisp library, released under ;;; the terms of the GNU General Public License as published by the ;;; Free Software Foundation; either version 3, or (at your option) any ;;; later version. There is NO WARRANTY. See file COPYING for details. ;;; Commentary: ;; Usage: emacs --script $0 FILENAME ;; ;; Update autoload file FILENAME. ;; Temporarily set (let-bind) `generated-autoload-file' to FILENAME, ;; then determine FILENAME's directory's immediate subdirectories and ;; apply `update-directory-autoloads' to them. ;;; Code: (require 'autoload) (let* ((vc-handled-backends nil) ; disable vc (backup-inhibited t) (uda (cond ((fboundp 'update-directory-autoloads) 'update-directory-autoloads) ((fboundp 'update-autoloads-from-directories) 'update-autoloads-from-directories) (t (error "Cannot determine `uda'")))) (generated-autoload-file (expand-file-name (car command-line-args-left))) (lispdir (file-name-directory generated-autoload-file)) (subdirs-el (expand-file-name "subdirs.el" (file-name-directory generated-autoload-file))) dirs) (dolist (x (directory-files lispdir)) (cond ((member x '("." ".."))) ((file-directory-p (setq x (expand-file-name x lispdir))) (push x dirs)))) (message "Updating autoload file: %s" generated-autoload-file) ;; Emacs checks for existence of subdirs.el; if found, the filenames ;; are basename only; otherwise, the relative name. We want basename ;; only for hysterical raisons, but don't use the normal subdirs.el ;; mechanism, hence its temporary existence around the =E2=80=98uda=E2=80= =99 call. (call-process "touch" nil nil nil subdirs-el) (apply uda dirs) (delete-file subdirs-el)) ;;; update-autoload-file.el ends here --=-=-=--