From: Robert Weiner <rswgnu@gmail.com>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Autoloads and subdirectories
Date: Sat, 28 May 2016 01:00:09 -0400 [thread overview]
Message-ID: <CA+OMD9j0sneAk3Xm765Zp9Ft7iynzJBg=YxEGzZLBHpspmvzWw@mail.gmail.com> (raw)
In-Reply-To: <57491DA5.4020002@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3134 bytes --]
On Sat, May 28, 2016 at 12:25 AM, Clément Pit--Claudel <
clement.pit@gmail.com> wrote:
> Hi emacs-devel,
>
> What is the proper way to organize the sources of a multi-file package
> into subdirectories, without breaking autoloads? As far as I can see
> `update-directory-autoloads` doesn't explore subdirectories recursively
>
You missed my message and solution for this 5 days back, so I have included
the solution here. 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.
(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.el 2016-05-28 00:54:25.000000000 -0400
--- package.el 2016-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: Type: text/html, Size: 5941 bytes --]
next prev parent reply other threads:[~2016-05-28 5:00 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 [this message]
2016-05-28 5:13 ` Clément Pit--Claudel
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
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='CA+OMD9j0sneAk3Xm765Zp9Ft7iynzJBg=YxEGzZLBHpspmvzWw@mail.gmail.com' \
--to=rswgnu@gmail.com \
--cc=clement.pit@gmail.com \
--cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).