unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Perry Smith <pedzsan@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: autoload
Date: Sun, 23 Jan 2011 22:49:13 -0600	[thread overview]
Message-ID: <065C351A-6288-4442-831F-327DD8525288@gmail.com> (raw)
In-Reply-To: <jwvd3nnq6yz.fsf-monnier+gnu.emacs.help@gnu.org>


On Jan 23, 2011, at 10:09 PM, Stefan Monnier wrote:

>> I just spent the past few hours constructing various scripts to
>> automatically byte compile the new files
> 
> As in byte-recompile-directory?

Roughtly.  but batch-byte-recompile-directory does not create the elc if it doesn't already exist unless you wrap it.  So I wrote:

(defun batch-byte-recompile-directory-all ()
  (batch-byte-recompile-directory 0))


> 
>> and also create a myautoloads.el file that I load at startup.
> 
> As in update-directory-autoloads?

Again... roughly but you have to wrap it so that the autoloads go to a local file:

(defun batch-update-my-autoloads (&optional file)
  (defvar command-line-args-left)	;Avoid 'free variable' warning
  (let ((generated-autoload-file "~/.emacs.d/pedz/myloaddefs.el")
	(temp command-line-args-left))
    (while temp
      (update-file-autoloads (car temp))
      (setq temp (cdr temp)))
    (save-some-buffers t)))

Oh... And update-directory-autoloads doesn't walk down the tree...

Its not a lot of work but it just seemed like I can't be the only person doing this.

I coupled it with a script:

#!/bin/sh
#
# Script to run after doing a git pull
#
# Emacs is taken as /Applications/Emacs.app/Contents/MacOS/Emacs if it
# exists (a Mac platform), otherwise, we just use emacs.
if [[ -x /Applications/Emacs.app/Contents/MacOS/Emacs ]] ; then
    EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
else
    EMACS=emacs
fi

# First, make all the .elc files:

${EMACS} -batch -l batch-commands.el -f batch-byte-recompile-directory-all

# Now, update the myloaddefs.el file:

find . -type f -name '*.el' -print | \
    egrep -v '/\.git' | \
    xargs egrep -l '# *autoload' | \
    xargs ${EMACS} \
        -batch \
        -l batch-commands.el \
        -f batch-update-my-autoloads

# We don't want myloaddefs.el compiled because it confuses me.

rm -f pedz/myloadsdefs.elc

pedz




  reply	other threads:[~2011-01-24  4:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.6.1295832280.28254.help-gnu-emacs@gnu.org>
2011-01-24  4:09 ` autoload Stefan Monnier
2011-01-24  4:49   ` Perry Smith [this message]
2011-01-24  6:51     ` autoload e20100633
2011-01-24 16:34       ` autoload Perry Smith
2011-01-24  7:41     ` autoload Thien-Thi Nguyen
     [not found]     ` <mailman.5.1295855209.17297.help-gnu-emacs@gnu.org>
2011-01-28  4:11       ` autoload rusi
2011-01-28 10:10         ` autoload Thien-Thi Nguyen
     [not found]   ` <mailman.22.1295844560.28254.help-gnu-emacs@gnu.org>
2011-01-24 17:28     ` autoload Stefan Monnier
2011-01-24 19:42       ` autoload Perry Smith
2011-01-24  0:40 autoload Perry Smith
2011-01-24 12:38 ` autoload Oleksandr Gavenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=065C351A-6288-4442-831F-327DD8525288@gmail.com \
    --to=pedzsan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).