all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pit@gmail.com>
To: Robert Weiner <rswgnu@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Autoloads and subdirectories
Date: Sat, 28 May 2016 01:13:40 -0400	[thread overview]
Message-ID: <57492904.7050603@gmail.com> (raw)
In-Reply-To: <CA+OMD9j0sneAk3Xm765Zp9Ft7iynzJBg=YxEGzZLBHpspmvzWw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3898 bytes --]

On 2016-05-28 01:00, Robert Weiner wrote:
> You missed my message and solution for this 5 days back, so I have
> included the solution here. 

Indeed, I did miss it! Thanks for sharing it.

> Just replace this one function in package.el in the lisp/emacs-lisp/
> subdirectory of your emacs installation. No one had any comments on
> it surprisingly. I have added the patch file here as well. Let me
> know how it goes for you.

It looks like a neat patch. Small question: why do you only accept directories that start with a letter? The regular expression that you pass to directory files seems rather restrictive.

That being said, this is no really the kind of answers that I'm looking for: applying this patch would fix the problem for future version of Emacs, but I'd like to support current versions of Emacs too, and the upcoming release as well.

Ideally, I'd love a solution that works with current Emacsen, and that won't be broken by future upstream fixes. One such solution is to statically generate my autoloads (using code similar to the one you posted) and ship these as part of my package, while adding an autoloaded form to a new file in my content directory that just loads the additional autoloads file that I ship. This isn't very pretty, though.

Thanks for your help!
Clément.

> (defun package-generate-autoloads (name pkg-dir)
>   (let* ((auto-name (format "%s-autoloads.el" name))
>          ;;(ignore-name (concat name "-pkg.el"))
>          (generated-autoload-file (expand-file-name auto-name pkg-dir))
>          ;; Silence `autoload-generate-file-autoloads'.
>          (noninteractive inhibit-message)
>          (backup-inhibited t)
>          (version-control 'never))
>     (package-autoload-ensure-default-file generated-autoload-file)
>     (apply #'update-directory-autoloads pkg-dir
>   (delq nil (mapcar (lambda (f) (and (file-directory-p f)
>      (not (file-symlink-p f))
>      f))
>     (directory-files pkg-dir t "[a-zA-Z].*" nil))))
>     (let ((buf (find-buffer-visiting generated-autoload-file)))
>       (when buf (kill-buffer buf)))
>     auto-name))
> 
> -------
> *** package-orig.el2016-05-28 00:54:25.000000000 -0400
> --- package.el2016-05-28 00:54:25.000000000 -0400
> ***************
> *** 916,928 ****
>            (backup-inhibited t)
>            (version-control 'never))
>       (package-autoload-ensure-default-file generated-autoload-file)
> !     (update-directory-autoloads pkg-dir)
>       (let ((buf (find-buffer-visiting generated-autoload-file)))
>         (when buf (kill-buffer buf)))
>       auto-name))
>   
>   (defun package--make-autoloads-and-stuff (pkg-desc pkg-dir)
>    "Generate autoloads, description file, etc.. for PKG-DESC installed at PKG-DIR."
>     (package-generate-autoloads (package-desc-name pkg-desc) pkg-dir)
>     (let ((desc-file (expand-file-name (package--description-file pkg-dir)
>                                        pkg-dir)))
> --- 911,927 ----
>            (backup-inhibited t)
>            (version-control 'never))
>       (package-autoload-ensure-default-file generated-autoload-file)
> !     (apply #'update-directory-autoloads pkg-dir
> !   (delq nil (mapcar (lambda (f) (and (file-directory-p f)
> !      (not (file-symlink-p f))
> !      f))
> !     (directory-files pkg-dir t "[a-zA-Z].*" nil))))
>       (let ((buf (find-buffer-visiting generated-autoload-file)))
>         (when buf (kill-buffer buf)))
>       auto-name))
>   
>   (defun package--make-autoloads-and-stuff (pkg-desc pkg-dir)
>    "Generate autoloads, description file, etc. for PKG-DESC installed at PKG-DIR."
>     (package-generate-autoloads (package-desc-name pkg-desc) pkg-dir)
>     (let ((desc-file (expand-file-name (package--description-file pkg-dir)
>                                        pkg-dir)))
> ***************
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2016-05-28  5:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28  4:25 Autoloads and subdirectories Clément Pit--Claudel
2016-05-28  5:00 ` Robert Weiner
2016-05-28  5:13   ` Clément Pit--Claudel [this message]
2016-05-28 18:18     ` Stefan Monnier
2016-05-28 18:47       ` Clément Pit--Claudel
2016-05-28 19:07         ` Stefan Monnier
2016-05-28 19:21           ` Clément Pit--Claudel
2016-05-29 15:01             ` Stefan Monnier
2016-05-29 15:39               ` Clément Pit--Claudel

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

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

  git send-email \
    --in-reply-to=57492904.7050603@gmail.com \
    --to=clement.pit@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rswgnu@gmail.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.