mirror of
https://github.com/correl/melpa.git
synced 2024-11-14 19:19:32 +00:00
Merge pull request #2285 from Fanael/master
Add a :defaults "macro" to the :files spec.
This commit is contained in:
commit
e4fb6a6c1a
2 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
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/
|
||||
[github]: https://github.com/
|
||||
[bzr]: http://bazaar.canonical.com/en/
|
||||
|
|
|
@ -848,7 +848,14 @@ for ALLOW-EMPTY to prevent this error."
|
|||
|
||||
(defun pb/config-file-list (config)
|
||||
"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)
|
||||
"Shorthand way to expand paths in DIR for source files listed in CONFIG."
|
||||
|
|
Loading…
Reference in a new issue