Merge pull request #2285 from Fanael/master

Add a :defaults "macro" to the :files spec.
This commit is contained in:
Steve Purcell 2014-12-17 16:51:18 +00:00
commit e4fb6a6c1a
2 changed files with 13 additions and 1 deletions

View file

@ -246,6 +246,11 @@ to the root of the package.* More complex options are available,
submit an [Issue](https://github.com/milkypostman/melpa/issues) if the submit an [Issue](https://github.com/milkypostman/melpa/issues) if the
specified package requires more complex file specification. specified package requires more complex file specification.
If the the package merely requires some additional files, for example for
bundling external dependencies, but is otherwise fine with the defaults, it's
recommended to use `:defaults` as the very first element of this list, which
causes the default value shown above to be prepended to the specified file list.
[git]: http://git-scm.com/ [git]: http://git-scm.com/
[github]: https://github.com/ [github]: https://github.com/
[bzr]: http://bazaar.canonical.com/en/ [bzr]: http://bazaar.canonical.com/en/

View file

@ -848,7 +848,14 @@ for ALLOW-EMPTY to prevent this error."
(defun pb/config-file-list (config) (defun pb/config-file-list (config)
"Get the :files spec from CONFIG, or return `package-build-default-files-spec'." "Get the :files spec from CONFIG, or return `package-build-default-files-spec'."
(or (plist-get config :files) package-build-default-files-spec)) (let ((file-list (plist-get config :files)))
(cond
((null file-list)
package-build-default-files-spec)
((eq :default (car file-list))
(append package-build-default-files-spec (cdr file-list)))
(t
file-list))))
(defun pb/expand-source-file-list (dir config) (defun pb/expand-source-file-list (dir config)
"Shorthand way to expand paths in DIR for source files listed in CONFIG." "Shorthand way to expand paths in DIR for source files listed in CONFIG."